From 0ffb5338f6aada6979fa352610a1122f1571a766 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 12:45:45 -0400 Subject: [PATCH 01/23] environment updated --- environment.yml | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/environment.yml b/environment.yml index 2a1abfd..807dece 100644 --- a/environment.yml +++ b/environment.yml @@ -1,23 +1,15 @@ -name: mypythonapp +name: hyspecplanningtools_dev channels: - conda-forge dependencies: - # -- Runtime dependencies - # base: list all base dependencies here - - python>=3.8 # please specify the minimum version of python here - - versioningit - # compute: list all compute dependencies here + - python>=3.8 + - pyqt == 5.* - numpy - - pandas - # plot: list all plot dependencies here, if applicable + - scipy - matplotlib - # jupyter: list all jupyter dependencies here, if applicable - - jupyterlab - - ipympl - # -- Development dependencies - # utils: - pre-commit # package building: + - versioningit - libmamba - libarchive - anaconda-client @@ -29,16 +21,9 @@ dependencies: # docs - sphinx - sphinx_rtd_theme + - sphinxcontrib-mermaid - myst-parser # required for parsing markdown files # test: list all test dependencies here - pytest - pytest-cov - pytest-xdist - # -------------------------------------------------- - # add additional sections such as Qt, etc. if needed - # -------------------------------------------------- - # if packages are not available on conda, list them here - - pip - - pip: - - bm3d-streak-removal # example - - pytest-playwright From c7d1c545c595e9aed058a5607e82665a83a75050 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 15:21:31 -0400 Subject: [PATCH 02/23] package name added, mantid logger replaced with python logger, environment updated --- environment.yml | 3 +- pyproject.toml | 12 ++-- .../__init__.py | 0 src/hyspecplanningtools/_version.py | 1 + .../configuration.py | 8 +-- .../configuration_template.ini | 0 .../help/help_model.py | 2 +- .../home/home_model.py | 4 +- .../home/home_presenter.py | 0 .../home/home_view.py | 0 .../hyspecplanningtools.py | 56 +++++++++++++++++ .../mainwindow.py | 8 +-- src/packagenamepy/packagename.py | 62 ------------------- 13 files changed, 76 insertions(+), 80 deletions(-) rename src/{packagenamepy => hyspecplanningtools}/__init__.py (100%) create mode 100644 src/hyspecplanningtools/_version.py rename src/{packagenamepy => hyspecplanningtools}/configuration.py (94%) rename src/{packagenamepy => hyspecplanningtools}/configuration_template.ini (100%) rename src/{packagenamepy => hyspecplanningtools}/help/help_model.py (80%) rename src/{packagenamepy => hyspecplanningtools}/home/home_model.py (70%) rename src/{packagenamepy => hyspecplanningtools}/home/home_presenter.py (100%) rename src/{packagenamepy => hyspecplanningtools}/home/home_view.py (100%) create mode 100644 src/hyspecplanningtools/hyspecplanningtools.py rename src/{packagenamepy => hyspecplanningtools}/mainwindow.py (84%) delete mode 100644 src/packagenamepy/packagename.py diff --git a/environment.yml b/environment.yml index 807dece..2407534 100644 --- a/environment.yml +++ b/environment.yml @@ -2,8 +2,9 @@ name: hyspecplanningtools_dev channels: - conda-forge dependencies: - - python>=3.8 + - python>=3.10 - pyqt == 5.* + - qtpy - numpy - scipy - matplotlib diff --git a/pyproject.toml b/pyproject.toml index 3943d8b..256ef68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,10 +11,10 @@ keywords = ["neutrons", "example", "python"] readme = "README.md" [project.urls] -homepage = "https://github.com/neutrons/python_project_template/" # if no homepage, use repo url -repository = "https://github.com/neutrons/python_project_template/" +homepage = "https://github.com/neutrons/HyspecPlanningTools" # if no homepage, use repo url +repository = "https://github.com/neutrons/HyspecPlanningTools" # documentation = add_url_to_readthedoc_here -issues = "https://github.com/neutrons/python_project_template/issues" +issues = "https://github.com/neutrons/HyspecPlanningTools/issues" [build-system] requires = [ @@ -38,7 +38,7 @@ dirty = "{version}+d{build_date:%Y%m%d}" distance-dirty = "{next_version}.dev{distance}+d{build_date:%Y%m%d%H%M}" [tool.versioningit.write] -file = "src/packagenamepy/_version.py" +file = "src/hyspecplanningtools/_version.py" [tool.setuptools.packages.find] where = ["src"] @@ -48,10 +48,10 @@ exclude = ["tests*", "scripts*", "docs*", "notebooks*"] "*" = ["*.yml","*.yaml","*.ini"] [project.scripts] -packagename-cli = "packagenamepy.packagename:main" +hyspecplanningtools-cli = "hyspecplanningtools.hyspecplanningtools:main" [project.gui-scripts] -packagenamepy = "packagenamepy.packagename:gui" +hyspecplanningtools = "hyspecplanningtools.hyspecplanningtools:gui" [tool.pytest.ini_options] pythonpath = [ diff --git a/src/packagenamepy/__init__.py b/src/hyspecplanningtools/__init__.py similarity index 100% rename from src/packagenamepy/__init__.py rename to src/hyspecplanningtools/__init__.py diff --git a/src/hyspecplanningtools/_version.py b/src/hyspecplanningtools/_version.py new file mode 100644 index 0000000..1628770 --- /dev/null +++ b/src/hyspecplanningtools/_version.py @@ -0,0 +1 @@ +__version__ = "0.1.0.dev1+d202410281915" diff --git a/src/packagenamepy/configuration.py b/src/hyspecplanningtools/configuration.py similarity index 94% rename from src/packagenamepy/configuration.py rename to src/hyspecplanningtools/configuration.py index 2231ab6..3052bf3 100644 --- a/src/packagenamepy/configuration.py +++ b/src/hyspecplanningtools/configuration.py @@ -8,12 +8,12 @@ from configparser import ConfigParser from pathlib import Path -from mantid.kernel import Logger +import logging -logger = Logger("PACKAGENAME") +logger = logging.getLogger("hyspecplanningtools") # configuration settings file path -CONFIG_PATH_FILE = os.path.join(Path.home(), ".packagename", "configuration.ini") +CONFIG_PATH_FILE = os.path.join(Path.home(), ".hyspecplanningtools", "configuration.ini") class Configuration: @@ -30,7 +30,7 @@ def __init__(self): # retrieve the file path of the file self.config_file_path = CONFIG_PATH_FILE - logger.information(f"{self.config_file_path} will be used") + logger.info(f"{self.config_file_path} will be used") # if template conf file path exists if os.path.exists(self.template_file_path): diff --git a/src/packagenamepy/configuration_template.ini b/src/hyspecplanningtools/configuration_template.ini similarity index 100% rename from src/packagenamepy/configuration_template.ini rename to src/hyspecplanningtools/configuration_template.ini diff --git a/src/packagenamepy/help/help_model.py b/src/hyspecplanningtools/help/help_model.py similarity index 80% rename from src/packagenamepy/help/help_model.py rename to src/hyspecplanningtools/help/help_model.py index 636472d..083a561 100644 --- a/src/packagenamepy/help/help_model.py +++ b/src/hyspecplanningtools/help/help_model.py @@ -2,7 +2,7 @@ import webbrowser -from packagenamepy.configuration import get_data +from hyspecplanningtools.configuration import get_data def help_function(context): diff --git a/src/packagenamepy/home/home_model.py b/src/hyspecplanningtools/home/home_model.py similarity index 70% rename from src/packagenamepy/home/home_model.py rename to src/hyspecplanningtools/home/home_model.py index e574925..2600c19 100644 --- a/src/packagenamepy/home/home_model.py +++ b/src/hyspecplanningtools/home/home_model.py @@ -1,8 +1,8 @@ """Model for the Main tab""" -from mantid.kernel import Logger +import logging -logger = Logger("PACKAGENAME") +logger = logging.getLogger("hyspecplanningtools") class HomeModel: # pylint: disable=too-many-public-methods diff --git a/src/packagenamepy/home/home_presenter.py b/src/hyspecplanningtools/home/home_presenter.py similarity index 100% rename from src/packagenamepy/home/home_presenter.py rename to src/hyspecplanningtools/home/home_presenter.py diff --git a/src/packagenamepy/home/home_view.py b/src/hyspecplanningtools/home/home_view.py similarity index 100% rename from src/packagenamepy/home/home_view.py rename to src/hyspecplanningtools/home/home_view.py diff --git a/src/hyspecplanningtools/hyspecplanningtools.py b/src/hyspecplanningtools/hyspecplanningtools.py new file mode 100644 index 0000000..2b7d296 --- /dev/null +++ b/src/hyspecplanningtools/hyspecplanningtools.py @@ -0,0 +1,56 @@ +"""Main Qt application""" + +import sys +import logging + +from qtpy.QtWidgets import QApplication, QMainWindow + +from hyspecplanningtools import __version__ +from hyspecplanningtools.configuration import Configuration +from hyspecplanningtools.mainwindow import MainWindow + + +logger = logging.getLogger("hyspecplanningtools") + + +class HyspecPlanningTool(QMainWindow): + """Main Package window""" + + __instance = None + + def __new__(cls): + if HyspecPlanningTool.__instance is None: + HyspecPlanningTool.__instance = QMainWindow.__new__(cls) # pylint: disable=no-value-for-parameter + return HyspecPlanningTool.__instance + + def __init__(self, parent=None): + super().__init__(parent) + logger.info(f"HyspecPlanningTool version: {__version__}") + config = Configuration() + + if not config.is_valid(): + msg = ( + "Error with configuration settings!", + f"Check and update your file: {config.config_file_path}", + "with the latest settings found here:", + f"{config.template_file_path} and start the application again.", + ) + + print(" ".join(msg)) + sys.exit(-1) + self.setWindowTitle(f"HyspecPlanning Tools - {__version__}") + self.main_window = MainWindow(self) + self.setCentralWidget(self.main_window) + + +def gui(): + """Main entry point for Qt application""" + input_flags = sys.argv[1::] + if "--v" in input_flags or "--version" in input_flags: + print(__version__) + sys.exit() + else: + app = QApplication(sys.argv) + window = HyspecPlanningTool() + window.show() + sys.exit(app.exec_()) diff --git a/src/packagenamepy/mainwindow.py b/src/hyspecplanningtools/mainwindow.py similarity index 84% rename from src/packagenamepy/mainwindow.py rename to src/hyspecplanningtools/mainwindow.py index 16c8aec..8dced0b 100644 --- a/src/packagenamepy/mainwindow.py +++ b/src/hyspecplanningtools/mainwindow.py @@ -2,10 +2,10 @@ from qtpy.QtWidgets import QHBoxLayout, QPushButton, QTabWidget, QVBoxLayout, QWidget -from packagenamepy.help.help_model import help_function -from packagenamepy.home.home_model import HomeModel -from packagenamepy.home.home_presenter import HomePresenter -from packagenamepy.home.home_view import Home +from hyspecplanningtools.help.help_model import help_function +from hyspecplanningtools.home.home_model import HomeModel +from hyspecplanningtools.home.home_presenter import HomePresenter +from hyspecplanningtools.home.home_view import Home class MainWindow(QWidget): diff --git a/src/packagenamepy/packagename.py b/src/packagenamepy/packagename.py deleted file mode 100644 index 15db777..0000000 --- a/src/packagenamepy/packagename.py +++ /dev/null @@ -1,62 +0,0 @@ -"""Main Qt application""" - -import sys - -from mantid.kernel import Logger -from mantidqt.gui_helper import set_matplotlib_backend -from qtpy.QtWidgets import QApplication, QMainWindow - -# make sure matplotlib is correctly set before we import shiver -set_matplotlib_backend() - -# make sure the algorithms have been loaded so they are available to the AlgorithmManager -import mantid.simpleapi # noqa: F401, E402 pylint: disable=unused-import, wrong-import-position - -from packagenamepy import __version__ # noqa: E402 pylint: disable=wrong-import-position -from packagenamepy.configuration import Configuration # noqa: E402 pylint: disable=wrong-import-position -from packagenamepy.mainwindow import MainWindow # noqa: E402 pylint: disable=wrong-import-position - -logger = Logger("PACKAGENAME") - - -class PackageName(QMainWindow): - """Main Package window""" - - __instance = None - - def __new__(cls): - if PackageName.__instance is None: - PackageName.__instance = QMainWindow.__new__(cls) # pylint: disable=no-value-for-parameter - return PackageName.__instance - - def __init__(self, parent=None): - super().__init__(parent) - logger.information(f"PackageName version: {__version__}") - config = Configuration() - - if not config.is_valid(): - msg = ( - "Error with configuration settings!", - f"Check and update your file: {config.config_file_path}", - "with the latest settings found here:", - f"{config.template_file_path} and start the application again.", - ) - - print(" ".join(msg)) - sys.exit(-1) - self.setWindowTitle(f"PACKAGENAME - {__version__}") - self.main_window = MainWindow(self) - self.setCentralWidget(self.main_window) - - -def gui(): - """Main entry point for Qt application""" - input_flags = sys.argv[1::] - if "--v" in input_flags or "--version" in input_flags: - print(__version__) - sys.exit() - else: - app = QApplication(sys.argv) - window = PackageName() - window.show() - sys.exit(app.exec_()) From 7537830f5b196d0ff37eacf9a725a40a31b0c4fd Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 15:30:49 -0400 Subject: [PATCH 03/23] configuration, version, and meta updates for new repo --- .gitignore | 1 + conda.recipe/meta.yaml | 2 +- src/hyspecplanningtools/__init__.py | 6 ------ src/hyspecplanningtools/_version.py | 1 - src/hyspecplanningtools/configuration_template.ini | 2 +- tests/test_version.py | 2 +- 6 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 src/hyspecplanningtools/_version.py diff --git a/.gitignore b/.gitignore index 2e88523..7235f91 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +_version.py # PyInstaller # Usually these files are written by a python script from a template diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 09e37d7..e9f28b2 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -12,7 +12,7 @@ {% set build_number = 0 %} package: - name: mypackagename + name: hyspecplanningtools version: {{ version_number }} source: diff --git a/src/hyspecplanningtools/__init__.py b/src/hyspecplanningtools/__init__.py index 96e1d74..3776ea8 100644 --- a/src/hyspecplanningtools/__init__.py +++ b/src/hyspecplanningtools/__init__.py @@ -5,9 +5,3 @@ except ImportError: __version__ = "unknown" - -def PackageName(): # noqa N802 - """This is needed for backward compatibility because mantid workbench does "from shiver import Shiver" """ - from .packagenamepy import PackageName as packagename # noqa N813 - - return packagename() diff --git a/src/hyspecplanningtools/_version.py b/src/hyspecplanningtools/_version.py deleted file mode 100644 index 1628770..0000000 --- a/src/hyspecplanningtools/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.1.0.dev1+d202410281915" diff --git a/src/hyspecplanningtools/configuration_template.ini b/src/hyspecplanningtools/configuration_template.ini index c8ea100..2db846a 100644 --- a/src/hyspecplanningtools/configuration_template.ini +++ b/src/hyspecplanningtools/configuration_template.ini @@ -1,2 +1,2 @@ [global.other] -help_url = https://github.com/neutrons/python_project_template/blob/main/README.md +help_url = https://github.com/neutrons/HyspecPlanningTools/blob/next/README.md diff --git a/tests/test_version.py b/tests/test_version.py index 5b09eca..f3fff1a 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,4 +1,4 @@ -from packagenamepy import __version__ +from hyspecplanningtools import __version__ def test_version(): From a4fe3dc9b94032ff167750b9e51ba1bb7336f527 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 16:19:24 -0400 Subject: [PATCH 04/23] notebooks/ removed, github actions updated --- .../{package.yml => hyspecplanningtools.yml} | 4 +-- notebooks/example.ipynb | 27 ------------------- pyproject.toml | 8 +++--- 3 files changed, 6 insertions(+), 33 deletions(-) rename .github/workflows/{package.yml => hyspecplanningtools.yml} (96%) delete mode 100644 notebooks/example.ipynb diff --git a/.github/workflows/package.yml b/.github/workflows/hyspecplanningtools.yml similarity index 96% rename from .github/workflows/package.yml rename to .github/workflows/hyspecplanningtools.yml index f20761e..20b9ad5 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/hyspecplanningtools.yml @@ -31,7 +31,7 @@ jobs: echo "versioningit $(versioningit ../)" # build the package VERSION=$(versioningit ../) conda mambabuild --channel conda-forge --output-folder . . - conda verify noarch/mypackagename*.tar.bz2 + conda verify noarch/hyspecplanningtools*.tar.bz2 - name: upload conda package to anaconda shell: bash -l {0} if: startsWith(github.ref, 'refs/tags/v') @@ -43,7 +43,7 @@ jobs: CONDA_LABEL="main" if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi echo pushing ${{ github.ref }} with label $CONDA_LABEL - anaconda upload --label $CONDA_LABEL conda.recipe/noarch/mypackagename*.tar.bz2 + anaconda upload --label $CONDA_LABEL conda.recipe/noarch/hyspecplanningtools*.tar.bz2 pypi-publish: name: upload release to PyPI diff --git a/notebooks/example.ipynb b/notebooks/example.ipynb deleted file mode 100644 index 7fa8701..0000000 --- a/notebooks/example.ipynb +++ /dev/null @@ -1,27 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Overview\n", - "\n", - "This folder is used to store notebooks that demonstrate how to use the library in an interactive environment like Jupyter." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/pyproject.toml b/pyproject.toml index 256ef68..f68f6c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,13 @@ [project] -name = "examplepyapp" -description = "Example Python repo for neutrons" +name = "hyspecplanningtools" +description = "Polarization tool for neutrons" dynamic = ["version"] requires-python = ">=3.10" dependencies = [ # list all runtime dependencies here ] license = { text = "MIT" } -keywords = ["neutrons", "example", "python"] +keywords = ["neutrons", "polarization", "single crystal", "powder"] readme = "README.md" [project.urls] @@ -42,7 +42,7 @@ file = "src/hyspecplanningtools/_version.py" [tool.setuptools.packages.find] where = ["src"] -exclude = ["tests*", "scripts*", "docs*", "notebooks*"] +exclude = ["tests*", "scripts*", "docs*"] [tool.setuptools.package-data] "*" = ["*.yml","*.yaml","*.ini"] From 90f41a687bf662ac9d0b5cb1d652f490b976cead Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 16:32:25 -0400 Subject: [PATCH 05/23] unittest updated --- .github/workflows/unittest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index cf00654..e1d3b72 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -44,4 +44,4 @@ jobs: # below to build the conda package in your local machine CHANNELS="--channel mantid/label/main --channel conda-forge" VERSION=$(versioningit ../) conda mambabuild $CHANNELS --output-folder . . - conda verify noarch/mypackagename*.tar.bz2 + conda verify noarch/hyspecplanningtools*.tar.bz2 From 535db699cf76d972b258711e292a8fe6508785cb Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 16:48:14 -0400 Subject: [PATCH 06/23] additonal checks added in unittest job --- .github/workflows/unittest.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index e1d3b72..613b4a6 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -8,7 +8,7 @@ on: tags: ['v*'] jobs: - linux: + pytest_conda_tests: runs-on: ubuntu-latest defaults: run: @@ -35,6 +35,11 @@ jobs: github.actor != 'dependabot[bot]' with: token: ${{ secrets.CODECOV_TOKEN }} + - name: build python wheel - pypi + run: | + # test that the python wheel builds + VERSION=$(versioningit .) python -m build --wheel --no-isolation + check-wheel-contents dist/hyspecplanningtools-*.whl - name: build conda package run: | # test that the conda package builds @@ -42,6 +47,6 @@ jobs: echo "versioningit $(versioningit ../)" # conda channels could have been defined in the conda-incubator, but you can copy/paste the lines # below to build the conda package in your local machine - CHANNELS="--channel mantid/label/main --channel conda-forge" + CHANNELS="--channel --channel conda-forge" VERSION=$(versioningit ../) conda mambabuild $CHANNELS --output-folder . . conda verify noarch/hyspecplanningtools*.tar.bz2 From c6d91bbea2749412bd8c0739e3aba0ecc5d02451 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 16:48:51 -0400 Subject: [PATCH 07/23] job renamed in unittest job --- .github/workflows/unittest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 613b4a6..86d7de8 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -8,7 +8,7 @@ on: tags: ['v*'] jobs: - pytest_conda_tests: + pytest_package_tests: runs-on: ubuntu-latest defaults: run: From 71561df414250d14fa86bc13b7d2882171421506 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 16:51:32 -0400 Subject: [PATCH 08/23] check-wheel-contents added for checking the wheels --- environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment.yml b/environment.yml index 2407534..8713e7e 100644 --- a/environment.yml +++ b/environment.yml @@ -15,6 +15,7 @@ dependencies: - libarchive - anaconda-client - boa + - check-wheel-contents - conda-build < 4 # conda-build 24.x has a bug, missing update_index from conda_build.index - conda-verify - python-build From 318341fd1b19943d303e2a952fb9523b8fde23a0 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 16:55:44 -0400 Subject: [PATCH 09/23] typo on unittest fixed --- .github/workflows/unittest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 86d7de8..5ad4042 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -47,6 +47,6 @@ jobs: echo "versioningit $(versioningit ../)" # conda channels could have been defined in the conda-incubator, but you can copy/paste the lines # below to build the conda package in your local machine - CHANNELS="--channel --channel conda-forge" + CHANNELS="--channel conda-forge" VERSION=$(versioningit ../) conda mambabuild $CHANNELS --output-folder . . conda verify noarch/hyspecplanningtools*.tar.bz2 From aeea91d61e1d1d07ad24a26a53c4d38aae157acb Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 17:00:46 -0400 Subject: [PATCH 10/23] action test --- .github/workflows/hyspecplanningtools.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hyspecplanningtools.yml b/.github/workflows/hyspecplanningtools.yml index 20b9ad5..5619fd2 100644 --- a/.github/workflows/hyspecplanningtools.yml +++ b/.github/workflows/hyspecplanningtools.yml @@ -2,6 +2,7 @@ name: conda packaging and deployment on: workflow_dispatch: + pull_request: push: branches: [qa, main] tags: ['v*'] From 2d4e48d499cb262474606e23b59aafd91c0c4aae Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Mon, 28 Oct 2024 17:05:22 -0400 Subject: [PATCH 11/23] update job names --- .github/workflows/hyspecplanningtools.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hyspecplanningtools.yml b/.github/workflows/hyspecplanningtools.yml index 5619fd2..f9e5634 100644 --- a/.github/workflows/hyspecplanningtools.yml +++ b/.github/workflows/hyspecplanningtools.yml @@ -8,7 +8,8 @@ on: tags: ['v*'] jobs: - linux: + anaconda-publish: + name: upload release to Anaconda runs-on: ubuntu-latest defaults: run: From 191070325c1a4e2cffcbd74c6fe40f5c8300704a Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 09:04:22 -0400 Subject: [PATCH 12/23] pull request setting removed --- .github/workflows/hyspecplanningtools.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/hyspecplanningtools.yml b/.github/workflows/hyspecplanningtools.yml index f9e5634..5f1c380 100644 --- a/.github/workflows/hyspecplanningtools.yml +++ b/.github/workflows/hyspecplanningtools.yml @@ -2,7 +2,6 @@ name: conda packaging and deployment on: workflow_dispatch: - pull_request: push: branches: [qa, main] tags: ['v*'] From f346f24c736ffe1f867e28df02aa09a2380f5caa Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 09:19:45 -0400 Subject: [PATCH 13/23] pre-commit errors fixed --- environment.yml | 2 +- src/hyspecplanningtools/__init__.py | 1 - src/hyspecplanningtools/configuration.py | 3 +-- src/hyspecplanningtools/hyspecplanningtools.py | 5 ++--- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/environment.yml b/environment.yml index 8713e7e..fd94568 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: hyspecplanningtools_dev channels: - conda-forge dependencies: - - python>=3.10 + - python>=3.10 - pyqt == 5.* - qtpy - numpy diff --git a/src/hyspecplanningtools/__init__.py b/src/hyspecplanningtools/__init__.py index 3776ea8..5e1b623 100644 --- a/src/hyspecplanningtools/__init__.py +++ b/src/hyspecplanningtools/__init__.py @@ -4,4 +4,3 @@ from ._version import __version__ # noqa: F401 except ImportError: __version__ = "unknown" - diff --git a/src/hyspecplanningtools/configuration.py b/src/hyspecplanningtools/configuration.py index 3052bf3..3533a93 100644 --- a/src/hyspecplanningtools/configuration.py +++ b/src/hyspecplanningtools/configuration.py @@ -3,13 +3,12 @@ Will fall back to a default """ +import logging import os import shutil from configparser import ConfigParser from pathlib import Path -import logging - logger = logging.getLogger("hyspecplanningtools") # configuration settings file path diff --git a/src/hyspecplanningtools/hyspecplanningtools.py b/src/hyspecplanningtools/hyspecplanningtools.py index 2b7d296..fdd7444 100644 --- a/src/hyspecplanningtools/hyspecplanningtools.py +++ b/src/hyspecplanningtools/hyspecplanningtools.py @@ -1,15 +1,14 @@ """Main Qt application""" -import sys import logging +import sys from qtpy.QtWidgets import QApplication, QMainWindow -from hyspecplanningtools import __version__ +from hyspecplanningtools import __version__ from hyspecplanningtools.configuration import Configuration from hyspecplanningtools.mainwindow import MainWindow - logger = logging.getLogger("hyspecplanningtools") From ea77e5ae749657028297d7906b9849c72c2eac4f Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 11:30:47 -0400 Subject: [PATCH 14/23] coverage and badges --- README.md | 155 ++---------------------------------------------------- 1 file changed, 4 insertions(+), 151 deletions(-) diff --git a/README.md b/README.md index 4c51529..14a2c80 100644 --- a/README.md +++ b/README.md @@ -1,154 +1,7 @@ -python_project_template -======================= -This repository is a template repository for Python projects under neutrons. -After you create a new repository using this repo as template, please follow the following steps to adjust it for the new project. +HyspecPlanningTools +===================== -Codebase Adjustments --------------------- -1. Adjust the branch protection rules for the new repo. By default, we should protect the `main` (stable), `qa` (release candidate), and `next` (development) branches. - - 1.1 Go to the `Settings` tab of the new repo. - - 1.2 Click on `Branches` on the left side. - - 1.3 Click on `Add rule` button. - - 1.4 Follow the instructions from Github. - - -2. Change the License if MIT license is not suitable for you project. For more information about licenses, please -refer to [Choose an open source license](https://choosealicense.com/). - - -3. Update the environment dependency file `environment.yml`, which contain both runtime and development dependencies. -For more information about conda environment file, please refer to [Conda environment file](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-file-manually). - - 3.1 Specify environment 'name' field to match package name - - 3.2 We strongly recommended using a single `environment.yml` file to manage all the dependencies, including the runtime and development dependencies. - - 3.3 Please add comments to the `environment.yml` file to explain the dependencies. - - 3.4 Please prune the dependencies to the minimum when possible, we would like the solver to figure out the dependency tree for us. - - -4. Adjust pre-commit configuration file, `.pre-commit-config.yaml` to enable/disable the hooks you need. For more information about pre-commit, please refer to [pre-commit](https://pre-commit.com/). - - -5. Having code coverage, `codecov.yaml` is **strongly recommended**, please refer to [Code coverage](https://coverage.readthedocs.io/en/coverage-5.5/) for more information. - - -6. Adjust the demo Github action yaml files for CI/CD. For more information about Github action, please refer to [Github action](https://docs.github.com/en/actions). - - 6.1 Specify package name at: .github/workflows/package.yml#L34 - - 6.2 Specify package name at: .github/workflows/package.yml#L46 - - -7. Adjust the conda recipe, `conda-recipe/meta.yaml` to provide the meta information for the conda package. For more information about conda recipe, please refer to [Conda build](https://docs.conda.io/projects/conda-build/en/latest/). - - 7.1 Specify package name at: conda.recipe/meta.yaml#L15 - - 7.2 Update license family, if necessary: conda.recipe/meta.yaml#L42 - - -8. Adjust `pyproject.toml` to match your project. For more information about `pyproject.toml`, -please refer to [pyproject.toml](https://www.python.org/dev/peps/pep-0518/). - - 8.1 Specify package name at: pyproject.toml#L2 - - 8.2 Specify package description at: pyproject.toml#L3 - - 8.3 Specify package name at: pyproject.toml#L39 - - 8.4 Specify any terminal entry points (terminal commands) at: pyproject.toml#48. - -In the example, invoking `packagename-cli` in a terminal is equivalent to running the python script `from packagenamepy.packagename.import main; main()` - - 8.5 Projects will use a single `pyproject.toml` file to manage all the project metadata, including the project name, version, author, license, etc. - - 8.6 Python has moved away from `setup.cfg`/`setup.py`, and we would like to follow the trend for our new projects. - - -10. Specify package name at src/packagenamepy - - -11. Specify package name at: src/packagenamepy/packagename.py - -12. If a GUI isn't used, delete the MVP structure at src/packagenamepy: - 11.1: mainwindow.py - 11.2: home/ - 11.3: help/ - - -11. Clear the content of this file and add your own README.md as the project README file. -We recommend putting badges of the project status at the top of the README file. -For more information about badges, please refer to [shields.io](https://shields.io/). - -Repository Adjustments ----------------------- - -### Add an access token to anaconda - -Here we assume your intent is to upload the conda package to the [anaconda.org/neutrons](https://anaconda.org/neutrons) organization. -An administrator of `anaconda.org/neutrons` must create an access token for your repository in the [access settings](https://anaconda.org/neutrons/settings/access). - -After created, the token must be stored in a `repository secret`: -1. Navigate to the main page of the repository on GitHub.com. -2. Click on the "Settings" tab. -3. In the left sidebar, navigate to the "Security" section and select "Secrets and variables" followed by "Actions". -4. Click on the "New repository secret" button. -5. Enter `ANACONDA_TOKEN` for the secret name -6. Paste the Anaconda access token -7. Click on the "Add secret" button -8. Test the setup by creating a release candidate tag, -which will result in a package built and uploaded to https://anaconda.org/neutrons/mypackagename - -### Add an access token to codecov - -Follow the instructions in the [Confluence page](https://ornl-neutrons.atlassian.net/wiki/spaces/NDPD/pages/103546883/Coverage+reports) -to create the access token. - -Packaging building instructions -------------------------------- - -The default package publishing service is anaconda. -However, we also support PyPI publishing as well. - -### Instruction for publish to PyPI - -1. Make sure you have the correct access to the project on PyPI. -2. Make sure `git status` returns a clean state. -3. At the root of the repo, use `python -m build` to generate the wheel. -4. Check the wheel with `twine check dist/*`, everything should pass before we move to next step. -5. When doing manual upload test, make sure to use testpypi instead of pypi. -6. Use `twine upload --repository testpypi dist/*` to upload to testpypi, you will need to specify the testpipy url in your `~/.pypirc`, i.e. - -`````` -[distutils] -index-servers = pypi, testpypi - -[testpypi] - repository = https://test.pypi.org/legacy/ - username = __token__ - password = YOUR_TESTPYPI_TOKEN - -`````` - -7. Test the package on testpypi with `pip install --index-url https://test.pypi.org/simple/ mypackagename`. -8. If everything is good, use the Github workflow, `package.yml` to trigger the publishing to PyPI. - -### Instruction for publish to Anaconda - -Publishing to Anaconda is handled via workflow, `package.yml`. - -Development environment setup ------------------------------ - -### Build development environment - -1. By default, we recommend providing a single `environment.yml` that covers all necessary packages for development. -2. The runtime dependency should be in `meta.yaml` for anaconda packaging, and `pyproject.toml` for PyPI publishing. -3. When performing editable install for your feature branch, make sure to use `pip install --no-deps -e .` to ensure that `pip` does not install additional packages from `pyproject.toml` into development environment by accident. +[![CI](https://github.com/neutrons/HyspecPlanningTools/actions/workflows/unittest.yml/badge.svg?branch=next)](https://github.com/neutrons/HyspecPlanningTools/actions/workflows/unittest.yml) +[![codecov](https://codecov.io/gh/neutrons/HyspecPlanningTools/graph/badge.svg?token=GAQE3SS0HJ)](https://codecov.io/gh/neutrons/HyspecPlanningTools) From f9bd812ccea50de0f45e1d0d5ae8b56417059037 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 11:58:38 -0400 Subject: [PATCH 15/23] twine check added on github action --- .github/workflows/unittest.yml | 2 +- environment.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 5ad4042..6d9c2c4 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -39,7 +39,7 @@ jobs: run: | # test that the python wheel builds VERSION=$(versioningit .) python -m build --wheel --no-isolation - check-wheel-contents dist/hyspecplanningtools-*.whl + twine check dist/hyspecplanningtools-*.whl - name: build conda package run: | # test that the conda package builds diff --git a/environment.yml b/environment.yml index fd94568..a4360f9 100644 --- a/environment.yml +++ b/environment.yml @@ -15,7 +15,6 @@ dependencies: - libarchive - anaconda-client - boa - - check-wheel-contents - conda-build < 4 # conda-build 24.x has a bug, missing update_index from conda_build.index - conda-verify - python-build From 41cbb0aac4039ddab5df82f293ea920a6c278bbe Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 14:28:28 -0400 Subject: [PATCH 16/23] prototype script added, excluded from pre-commit --- .pre-commit-config.yaml | 2 + scripts/README.md | 3 + scripts/myscripts.py | 2 - scripts/polarization.py | 93 ++++++++++++++++++++++++++++++ scripts/show_polarization_plots.py | 22 +++++++ 5 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 scripts/README.md delete mode 100644 scripts/myscripts.py create mode 100644 scripts/polarization.py create mode 100644 scripts/show_polarization_plots.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 469e00f..57a7c36 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,5 @@ +exclude: "scripts/.*|.*\\.mat$" + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..c843091 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,3 @@ +The `polarization.py` contains a prototype script +To run: `python show_polarization_plots.py` +It shows two plots. diff --git a/scripts/myscripts.py b/scripts/myscripts.py deleted file mode 100644 index fce7406..0000000 --- a/scripts/myscripts.py +++ /dev/null @@ -1,2 +0,0 @@ -"""This is a script that use the package as a module.""" -#!/usr/bin/env python diff --git a/scripts/polarization.py b/scripts/polarization.py new file mode 100644 index 0000000..a3d65c1 --- /dev/null +++ b/scripts/polarization.py @@ -0,0 +1,93 @@ +import matplotlib.pyplot as plt +import numpy as np +from scipy.constants import e, hbar, m_n + + +class model_polarization(object): + def __init__(self): + self.S2 = 30.0 + self.Ei = 20.0 + self.Q = None + self.DeltaE = None + self.Emin = -self.Ei + self.B = None + + def Bmatrix(self, a, b, c, alpha, beta, gamma): + ca = np.cos(np.radians(alpha)) + sa = np.sin(np.radians(alpha)) + cb = np.cos(np.radians(beta)) + sb = np.sin(np.radians(beta)) + cg = np.cos(np.radians(gamma)) + sg = np.sin(np.radians(gamma)) + vabg = np.sqrt(1 - ca**2 - cb**2 - cg**2 + 2 * ca * cb * cg) + astar = sa / (a * vabg) + bstar = sb / (b * vabg) + cstar = sg / (c * vabg) + cas = (cb * cg - ca) / (sb * sg) + cbs = (cg * ca - cb) / (sg * sa) + cgs = (ca * cb - cg) / (sa * sb) + self.B = np.array( + [ + [astar, bstar * cgs, cstar * cbs], + [0, bstar * np.sqrt(1 - cgs**2), -cstar * np.sqrt(1 - cbs**2) * ca], + [0, 0, 1.0 / c], + ] + ) + + def modQ_from_HKL(self, h, k, l): + if self.B: + self.Q = 2 * np.pi * np.linalg.norm(self.B.dot([h, k, l])) + + def set_energy(self, newEi, newDeltaE=None): + self.Ei = newEi + self.DeltaE = newDeltaE + if newDeltaE is not None and newDeltaE < -self.Ei: + self.Emin = newDeltaE + else: + self.Emin = -self.Ei + self.update() + + def set_S2(self, newS2): + self.S2 = newS2 + + def q_at_angle(self, angle): + SE2K = np.sqrt(2e-3 * e * m_n) * 1e-10 / hbar + dE = np.linspace(self.Emin, self.Ei * 0.99, 200) + ki = np.sqrt(self.Ei) * SE2K + kf = np.sqrt(self.Ei - dE) * SE2K + return np.sqrt(ki**2 + kf**2 - 2 * ki * kf * np.cos(np.radians(angle))), dE + + def q_min_max(self): + max_angle = abs(self.S2) + 30.0 + min_angle = np.max([0, abs(self.S2) - 30.0]) + return self.q_at_angle(min_angle), self.q_at_angle(max_angle) + + def update(self): + return self.q_min_max(), self.DeltaE, self.Q + + +class plot_polarization(object): + model = model_polarization() + + def __init__(self): + self.fig, self.ax = plt.subplots() + self.qmin_line = self.ax.plot([0, 0], [0, 0])[0] + self.qmax_line = self.ax.plot([0, 0], [0, 0])[0] + self.qline = self.ax.axvline(x=0) + self.eline = self.ax.axhline(y=0) + self.ax.set_xlabel(r"$|Q| (\AA^{-1})$") + self.ax.set_ylabel("DeltaE (meV)") + self.update_figure() + self.fig.show() + + def update_figure(self): + (qmin_line_data, qmax_line_data), ecursor, qcursor = self.model.update() + self.qmin_line.set_data(qmin_line_data) + self.qmax_line.set_data(qmax_line_data) + if ecursor is not None: + self.eline.set_data([0, 1], [ecursor, ecursor]) + if qcursor is not None: + self.qline.set_data([qcursor, qcursor], [0, 1]) + self.ax.relim() + self.ax.autoscale() + self.fig.canvas.draw() diff --git a/scripts/show_polarization_plots.py b/scripts/show_polarization_plots.py new file mode 100644 index 0000000..785c1b9 --- /dev/null +++ b/scripts/show_polarization_plots.py @@ -0,0 +1,22 @@ +"""This is a script that use the package as a module.""" + +#!/usr/bin/env python +import matplotlib.pyplot as plt +from polarization import plot_polarization + +# show figure +p1 = plot_polarization() +input("Press Enter to continue...") + +p2 = plot_polarization() +# clear the plot +plt.close(p2.fig) +p2.model.set_energy(40, 10) +p2.model.set_S2(-55) +p2.model.Q = 3.4 +p2.update_figure() + + +# show updated figure +p = plot_polarization() +input("Press Enter to exit...") From 433a1adcf38cae4049dd4405d6dc92311a92fad5 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 14:47:11 -0400 Subject: [PATCH 17/23] run pytest after package installed in editable mode in github actions, version should exist --- .github/workflows/unittest.yml | 7 ++++--- tests/test_version.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 6d9c2c4..d32b3d3 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -21,10 +21,11 @@ jobs: channels: conda-forge,defaults use-mamba: true environment-file: environment.yml - activate-environment: test - - name: install additional dependencies + activate-environment: hyspecplanningtools_dev + - name: install in editable mode run: | - echo "installing additional dependencies if cannot be installed from conda" + echo "installing in editable mode" + pythom -m pip install -e . - name: run unit tests run: | echo "running unit tests" diff --git a/tests/test_version.py b/tests/test_version.py index f3fff1a..d5ddbda 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -2,4 +2,4 @@ def test_version(): - assert __version__ == "unknown" + assert __version__ != "unknown" From 6df09b12c36a4ce3855367346802b4d0836c521a Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 14:51:04 -0400 Subject: [PATCH 18/23] typo on github actions, and removed unused steps, updates --- .github/workflows/hyspecplanningtools.yml | 6 ++---- .github/workflows/unittest.yml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/hyspecplanningtools.yml b/.github/workflows/hyspecplanningtools.yml index 5f1c380..723a1a3 100644 --- a/.github/workflows/hyspecplanningtools.yml +++ b/.github/workflows/hyspecplanningtools.yml @@ -2,6 +2,7 @@ name: conda packaging and deployment on: workflow_dispatch: + pull_request: push: branches: [qa, main] tags: ['v*'] @@ -21,10 +22,7 @@ jobs: channels: conda-forge,defaults use-mamba: true environment-file: environment.yml - activate-environment: test - - name: install additional dependencies - run: | - echo "installing additional dependencies from environment_development.yml" + activate-environment: hyspecplanningtools_dev - name: build conda package run: | # set up environment diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index d32b3d3..8e9bec4 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -25,7 +25,7 @@ jobs: - name: install in editable mode run: | echo "installing in editable mode" - pythom -m pip install -e . + python -m pip install -e . - name: run unit tests run: | echo "running unit tests" From 48266f7690166225c044bd115b7c12517e42ed51 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 14:54:32 -0400 Subject: [PATCH 19/23] environment name updated on actions --- .github/workflows/hyspecplanningtools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hyspecplanningtools.yml b/.github/workflows/hyspecplanningtools.yml index 723a1a3..b5dbc30 100644 --- a/.github/workflows/hyspecplanningtools.yml +++ b/.github/workflows/hyspecplanningtools.yml @@ -61,7 +61,7 @@ jobs: channels: conda-forge,defaults use-mamba: true environment-file: environment.yml - activate-environment: test + activate-environment: hyspecplanningtools_dev - name: build pypi package run: | # build the package From b1041ab310d66d9bc5e3b19218c21c95f88fe476 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 15:08:27 -0400 Subject: [PATCH 20/23] pyproject updated to point only to gui, readme update with development installation instructions --- README.md | 8 ++++++++ pyproject.toml | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 14a2c80..87646d3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,14 @@ HyspecPlanningTools ===================== +To install the application in editable mode + +`pip install -e .` + +To start the tool + +`hyspecplanningtools` + [![CI](https://github.com/neutrons/HyspecPlanningTools/actions/workflows/unittest.yml/badge.svg?branch=next)](https://github.com/neutrons/HyspecPlanningTools/actions/workflows/unittest.yml) [![codecov](https://codecov.io/gh/neutrons/HyspecPlanningTools/graph/badge.svg?token=GAQE3SS0HJ)](https://codecov.io/gh/neutrons/HyspecPlanningTools) diff --git a/pyproject.toml b/pyproject.toml index f68f6c6..a52f42f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,9 +47,6 @@ exclude = ["tests*", "scripts*", "docs*"] [tool.setuptools.package-data] "*" = ["*.yml","*.yaml","*.ini"] -[project.scripts] -hyspecplanningtools-cli = "hyspecplanningtools.hyspecplanningtools:main" - [project.gui-scripts] hyspecplanningtools = "hyspecplanningtools.hyspecplanningtools:gui" From b1052b82be3e63ddcce28d1e97664cd8d710e810 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 15:19:32 -0400 Subject: [PATCH 21/23] action restored --- .github/workflows/hyspecplanningtools.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/hyspecplanningtools.yml b/.github/workflows/hyspecplanningtools.yml index b5dbc30..139bb13 100644 --- a/.github/workflows/hyspecplanningtools.yml +++ b/.github/workflows/hyspecplanningtools.yml @@ -2,7 +2,6 @@ name: conda packaging and deployment on: workflow_dispatch: - pull_request: push: branches: [qa, main] tags: ['v*'] From aa1f424e92e69969a1df55445946a0825708d6e9 Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 15:29:28 -0400 Subject: [PATCH 22/23] conda environment instructions added --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87646d3..c19b8e0 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,19 @@ HyspecPlanningTools ===================== -To install the application in editable mode +Create the development conda environment + +`conda env create` + +Activate the environment + +`conda activate hyspecplanningtools_dev` + +Install the application in editable mode `pip install -e .` -To start the tool +Start the tool `hyspecplanningtools` From 9bcaba7674a2c6560a46b158def14d770d862a1c Mon Sep 17 00:00:00 2001 From: "Patrou, Maria" Date: Tue, 29 Oct 2024 15:38:35 -0400 Subject: [PATCH 23/23] readme instruction updates --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c19b8e0..263401f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ HyspecPlanningTools ===================== +Polarization tool for Single Crystal and Powder + +## Installation Process + Create the development conda environment `conda env create`