From 9b929fdb9da77609a21230a6b8fa0dc425f74dff Mon Sep 17 00:00:00 2001 From: jpcurbelo Date: Wed, 4 Sep 2024 17:20:27 -0600 Subject: [PATCH] Delete old install files and updated Readme --- README.md | 129 +++++++++++++++++++++--------------------- UTILS/__init__.py | 4 -- setup_reflectivity.py | 12 ---- setup_wsl.py | 31 ---------- 4 files changed, 64 insertions(+), 112 deletions(-) delete mode 100644 setup_reflectivity.py delete mode 100644 setup_wsl.py diff --git a/README.md b/README.md index 1b009645..58bfc2b0 100644 --- a/README.md +++ b/README.md @@ -54,36 +54,55 @@ Tested on Ubuntu 22.04 $ git clone https://github.com/lucaskorol21/GO-RXR.git ``` -#### 2. Prerequisites (Tested with Python 3.10.14) +#### 2. Prerequisites and Setup (Tested with Python 3.10.14) -We recommend creating a virtual enviromnment: +1. **Set Up the Virtual Environment** -```bash -$ virtualenv -p python3.10 venv-go-rxr -``` + - **Create the virtual environment**: + Inside the `GO-RXR` directory: + ```bash + $ virtualenv -p python3.10 venv-go-rxr + ``` -Install the Python libraries using `pip` + - **Activate the virtual environment**: + Activate the virtual environment directory: + ```bash + (venv-go-rxr) $ source venv-go-rxr/bin/activate + ``` -```bash -(venv-go-rxr) $ pip install . -``` +2. **Install Package Dependencies** + + Install the required Python packages using `pip`: + + ```bash + (venv-go-rxr) $ pip install . + ``` This command will handle the installation of all dependencies, including compiling any Cython extensions. -If the setup file does not work, then the libraries in the `requirements.txt` file can be installed. -```bash -(venv-go-rxr) $ pip install -r requirements.txt -``` -#### For `matplotlib`, ensure that you have `Pilow` installed +### Running the Application + + - Go back to the root of the repository and run the GUI: + ```bash + (venv-go-rxr) $ python GUI_GO.py + ``` + +After running the `GUI_GO.py` file, the start screen will be displayed: + +![Start screen of GO-RXR. The interface is divided into three main sections: 1) Toolbar, 2) Workspace Navigator, and 3) Workspace Area. \label{fig:start-screen}](FIGURES/go-rxr-start.png) + +### Troubleshooting Installation Issues + +#### For `matplotlib`, ensure that you have `Pillow` installed ```bash (venv-go-rxr) $ pip install Pillow ``` #### Resolving `PyQt5` Conflicts. -If you encounter conflicts with the PyQt5 package during installation or usage, [this discussion](https://stackoverflow.com/questions/74997556/problem-with-pyqt5-in-ubuntu-22-04-not-fount-zdapvm) might be uselful. Try the following steps: +If you encounter conflicts with the PyQt5 package during installation or usage, [this discussion](https://stackoverflow.com/questions/74997556/problem-with-pyqt5-in-ubuntu-22-04-not-fount-zdapvm) might be useful. Try the following steps: ```bash # Install necessary dependencies @@ -110,7 +129,7 @@ This configuration was tested on Windows 11 Home and Windows 11 Education. - **Enable WSL**: Open a PowerShell terminal as Administrator and run: ```bash - $ wsl --install + $ wsl --install ``` Recommended: install Ubuntu 22.04 if available. @@ -126,26 +145,27 @@ This configuration was tested on Windows 11 Home and Windows 11 Education. - **Open Ubuntu Terminal**: Update the package list: ```bash - $ sudo apt update + $ sudo apt update ``` Upgrade the installed packages: ```bash - $ sudo apt full-upgrade -y + $ sudo apt full-upgrade -y ``` + 3. **Set Up Python Environment** - **Check/Install Python version**: You may already have Python installed with Ubuntu. Check the version: ```bash - $ python3 --version + $ python3 --version ``` Recommended: Python 3.10.12 if available. - **Install `virtualenv`**: Install the virtual environment tool: ```bash - $ sudo apt install python3-virtualenv -y + $ sudo apt install python3-virtualenv -y ``` 4. **Clone the Repository** @@ -153,13 +173,13 @@ This configuration was tested on Windows 11 Home and Windows 11 Education. - **Install Git (if not already installed)**: Git should already be installed, but you can install it with: ```bash - $ sudo apt install git -y + $ sudo apt install git -y ``` - **Clone the `GO-RXR` repository**: Clone the repository using Git: ```bash - $ git clone https://github.com/lucaskorol21/GO-RXR.git + $ git clone https://github.com/lucaskorol21/GO-RXR.git ``` Navigate to the cloned directory: @@ -172,73 +192,52 @@ This configuration was tested on Windows 11 Home and Windows 11 Education. - **Create the virtual environment**: Inside the `GO-RXR` directory: ```bash - $ virtualenv venv-go-rxr + $ virtualenv venv-go-rxr ``` - **Activate the virtual environment**: Activate the virtual environment directory: ```bash - (venv-go-rxr) $ source venv-go-rxr/bin/activate + (venv-go-rxr) $ source venv-go-rxr/bin/activate ``` -6. **Install Requirements** +6. **Install Package Dependencies** - - **Install Python dependencies**: - Run the following command to install the required Python packages: - ```bash - (venv-go-rxr) $pip install -r requirements.txt - ``` + Install the required Python packages using `pip`: - - **Install additional dependencies**: - Install PyQt5 and its multimedia plugins: - ```bash - (venv-go-rxr) $sudo apt-get install pyqt5-dev libqt5multimedia5-plugins -y - ``` - - - **Run the `setup_reflectivity.py` script**: - Install the package by running: - ```bash - (venv-go-rxr) $python setup_reflectivity.py install - ``` + ```bash + (venv-go-rxr) $ pip install . + ``` + + This command will handle the installation of all dependencies, including compiling any Cython extensions. 7. **Running the Application** - Go back to the root of the repository and run the GUI: ```bash - (venv-go-rxr) $python GUI_GO.py + (venv-go-rxr) $ python GUI_GO.py ``` #### Resolving `PyQt5` Conflicts. If you encounter conflicts with the PyQt5 package during installation or usage (issues were noticed on Windows 11 Education) you might need to update the `wsl` version. Try the following steps: -With the Ubuntu terminal open, open a new console and run +1. **Update WSL**: + Open a new console and run: -```bash -wsl --update -``` -Then, got back to the Ubuntu console and run -```bash -python GUI_GO.py -``` + ```bash + $ wsl --update + ``` -## Testing +2. **Run the GUI**: -### Automated Testing via GitHub Actions + After updating WSL, return to the Ubuntu console and run: -The non-GUI tests are automatically run on every push and merge to the repository through GitHub Actions. This ensures that any new code changes do not introduce regressions or errors in the core functionality of the software. + ```bash + (venv-go-rxr) $ python GUI_GO.py + ``` -### Running Tests Locally - -You can also run all tests locally using the test scripts provided in the `TESTS` folder. This includes both GUI and non-GUI tests. - -#### 1. Running All Tests - -To run all tests at once, you can use the `run_all_tests.py` script in the `TESTS` directory: - -```bash -(venv-go-rxr) $ python TESTS/run_all_tests.py -``` +## Testing ### Automated Testing via GitHub Actions @@ -330,5 +329,5 @@ The GO-RXR software package has been utilized for analyzing the RXR data in the --- -If issues feel free to contact me at lsk601@usask.ca. +If you encounter any issues, feel free to contact me at lsk601@usask.ca. diff --git a/UTILS/__init__.py b/UTILS/__init__.py index 0ea1a458..cb5ca472 100644 --- a/UTILS/__init__.py +++ b/UTILS/__init__.py @@ -7,10 +7,6 @@ CURRENT_PATH = os.getcwd() ROOT_PATH = os.path.abspath(CURRENT_PATH) -# # Check if ROOT_PATH ends with '/GO-RXR/GO-RXR' and remove the extra 'GO-RXR' if it does -# if ROOT_PATH.endswith('/GO-RXR/GO-RXR'): -# ROOT_PATH = os.path.dirname(ROOT_PATH) - while os.path.basename(ROOT_PATH) != 'GO-RXR': ROOT_PATH = os.path.dirname(ROOT_PATH) # Check if we have reached the root of the filesystem diff --git a/setup_reflectivity.py b/setup_reflectivity.py deleted file mode 100644 index d4941e34..00000000 --- a/setup_reflectivity.py +++ /dev/null @@ -1,12 +0,0 @@ -import numpy - -# from distutils.core import setup, Extension -from setuptools import setup, Extension -from Cython.Build import cythonize - -setup(ext_modules = cythonize(Extension( - "Pythonreflectivity", # the extesion name - sources=["UTILS/Pythonreflectivity.pyx"], - language="c++", - include_dirs=[numpy.get_include()] - ))) \ No newline at end of file diff --git a/setup_wsl.py b/setup_wsl.py deleted file mode 100644 index acba1f02..00000000 --- a/setup_wsl.py +++ /dev/null @@ -1,31 +0,0 @@ -import subprocess -import sys - -try: - from setuptools import setup, find_packages -except ImportError: - print("Setuptools is not installed. Installing now...") - subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "pip", "setuptools"]) - from setuptools import setup, find_packages, Extension -setup( - name='GO-RXR', - version='1.0', - packages=find_packages(include=['Magnetic_Scattering_Factor', 'Scattering_Factor', 'Testing', 'Tutorial']), - url='https://github.com/lucaskorol21/GO-RXR', - author='Lucas Korol', - author_email='lsk601@usask.ca', - maintainer='Robert J. Green', - description='Global Optimization of Resonant X-ray Reflectometry Tool', - python_requires='>=3.7', - install_requires=[ - 'Cython==3.0.8', - 'numpy==1.26.3', - 'h5py==3.10.0', - 'numba==0.59.0', - 'pyqtgraph==0.13.3', - 'scipy==1.12.0', - 'matplotlib==3.8.1', - 'PyQt5==5.15.2' - ] -) -