From 4f299a41d0d54f3a8d895e724468849e2ff6c6db Mon Sep 17 00:00:00 2001 From: Maria Patrou <3339090+mpatrou@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:30:04 -0400 Subject: [PATCH] Openssf updates (#107) * github actions information added for developers in readme * readme restructure * readme restructure v2 * readme spaces * readme changes * readme spaces fixed * readthedocs configurations updated * install the project step added in readthedocs * remove src from modules in report_doc * doc requirements removed * mock qt in conf file * add xvfb-run for sphinx build * xvfb-run added in makedfile * xvfb-run removed * qtpy added in mockimports * matplotlib banckedn added * matplotlib backend import mock * matplotlib pyploy import mock * matplotlib backend import mock * mantid functions are mocked * installation info added * readthedocs link added * docs usage installation * conf copyright year update and unnecessary imports * url for conda package * url for conda package fixed --- .readthedocs.yaml | 5 ++++ README.md | 34 +++++++++++++++++++++--- docs/source/conf.py | 24 ++++++++++++++++- docs/source/repo_doc.rst | 56 ++++++++++++++++++++-------------------- docs/source/usage.rst | 5 ++-- 5 files changed, 90 insertions(+), 34 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index ced27b26..f57410c5 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,6 +5,11 @@ build: tools: python: "mambaforge-4.10" +python: + install: + - method: pip + path: . + sphinx: builder: html configuration: docs/source/conf.py diff --git a/README.md b/README.md index fcfd111b..ac4f518b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Shiver +Tool (desktop application) for allowing the examination of Time of Flight (ToF) inelastic neutron data, from single crystal, direct geometry experiments. + +## Installation + Create and activate conda environment for shiver development ```bash @@ -27,7 +31,11 @@ s=Shiver() s.show() ``` -For Developers +## For Contibutors + +**Testing** + +--- To run all tests for shiver ```bash @@ -47,10 +55,23 @@ To set the pre-commit hook before each git commit pre-commit install ``` +**Automated Jobs** + +--- + +The repository runs automated tests on branches during Pull-Requests and on the main ones: next, main and qa. The jobs are described in .github/workflows/actions.yml: + * `Tests`. It includes pytest, pre-commit and code coverage tools + + * `Conda build`. A new conda package is built and uploaded to Anaconda, depending upon git tags and authorized branches. + + * `Trigger deploy`. Given that the two above jobs were successful, deployment is triggered. + + +**Documentation Updates** + --- -**NOTE** -When adding new views, presenters and methods. Please navigate to docs/source/repo_doc.rst. Add the new feature under the appropriate section following the given template: +When adding new views, presenters and methods, please navigate to docs/source/repo_doc.rst. Add the new feature under the appropriate section following the given template: ```bash .. automodule:: path.to.new.module @@ -63,6 +84,13 @@ Once complete, rebuild the documentation: make clean make html + +--- + +## Code Documentation + +https://shiver.readthedocs.io/en/latest/ + --- [![CI](https://github.com/neutrons/Shiver/actions/workflows/actions.yml/badge.svg?branch=next)](https://github.com/neutrons/Shiver/actions/workflows/actions.yml) diff --git a/docs/source/conf.py b/docs/source/conf.py index de9b65d5..1138aa9e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,6 +6,8 @@ import sys import versioningit +# import matplotlib +# matplotlib.use("Agg") sys.path.insert(0, os.path.abspath("../../")) @@ -18,7 +20,7 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = "SHIVER" # pylint: disable=C0103 -copyright = "2022, ORNL" # pylint: disable=W0622, C0103 +copyright = "2023, ORNL" # pylint: disable=W0622, C0103 author = "ORNL" # pylint: disable=C0103 version = versioningit.get_version("../../") release = ".".join(version.split(".")[:-1]) # pylint: disable=C0103 @@ -34,6 +36,26 @@ "sphinx.ext.intersphinx", ] +autodoc_mock_imports = [ + "mantid", + "mantid.kernel", + "mantid.utils", + "mantid.utils.logging", + "mantid.simpleapi", + "mantid.geometry", + "mantidqt.widgets", + "mantidqt.widgets.algorithmprogress", + "qtpy", + "qtpy.uic", + "qtpy.QtWidgets", + "mantidqt", + "mantid.plots", + "mantid.plots.plotfunctions", + "mantid.plots.datafunctions", + "mantid.plots.utility", +] + + intersphinx_mapping = { "python": ("https://docs.python.org/3/", None), "sphinx": ("https://www.sphinx-doc.org/en/master/", None), diff --git a/docs/source/repo_doc.rst b/docs/source/repo_doc.rst index 73a4ec95..6a92a7cc 100644 --- a/docs/source/repo_doc.rst +++ b/docs/source/repo_doc.rst @@ -3,95 +3,95 @@ Repository Documentation Shiver ------ -.. automodule:: src.shiver.shiver +.. automodule:: shiver.shiver :members: Models ------ -.. automodule:: src.shiver.models.sample +.. automodule:: shiver.models.sample :members: -.. automodule:: src.shiver.models.help +.. automodule:: shiver.models.help :members: -.. automodule:: src.shiver.models.generate +.. automodule:: shiver.models.generate :members: -.. automodule:: src.shiver.models.convert_dgs_to_single_mde +.. automodule:: shiver.models.convert_dgs_to_single_mde :members: -.. automodule:: src.shiver.models.makeslice +.. automodule:: shiver.models.makeslice :members: -.. automodule:: src.shiver.models.generate_dgs_mde +.. automodule:: shiver.models.generate_dgs_mde :members: -.. automodule:: src.shiver.models.corrections +.. automodule:: shiver.models.corrections :members: -.. automodule:: src.shiver.models.utils +.. automodule:: shiver.models.utils :members: -.. automodule:: src.shiver.models.histogram +.. automodule:: shiver.models.histogram :members: Presenters ---------- -.. automodule:: src.shiver.presenters.sample +.. automodule:: shiver.presenters.sample :members: -.. automodule:: src.shiver.presenters.generate +.. automodule:: shiver.presenters.generate :members: -.. automodule:: src.shiver.presenters.histogram +.. automodule:: shiver.presenters.histogram :members: Views ----- -.. automodule:: src.shiver.views.histogram_parameters +.. automodule:: shiver.views.histogram_parameters :members: -.. automodule:: src.shiver.views.sample +.. automodule:: shiver.views.sample :members: -.. automodule:: src.shiver.views.invalid_styles +.. automodule:: shiver.views.invalid_styles :members: -.. automodule:: src.shiver.views.oncat +.. automodule:: shiver.views.oncat :members: -.. automodule:: src.shiver.views.generate +.. automodule:: shiver.views.generate :members: -.. automodule:: src.shiver.views.advanced_options +.. automodule:: shiver.views.advanced_options :members: -.. automodule:: src.shiver.views.data +.. automodule:: shiver.views.data :members: -.. automodule:: src.shiver.views.loading_buttons +.. automodule:: shiver.views.loading_buttons :members: -.. automodule:: src.shiver.views.workspace_tables +.. automodule:: shiver.views.workspace_tables :members: -.. automodule:: src.shiver.views.plots +.. automodule:: shiver.views.plots :members: -.. automodule:: src.shiver.views.mainwindow +.. automodule:: shiver.views.mainwindow :members: -.. automodule:: src.shiver.views.reduction_parameters +.. automodule:: shiver.views.reduction_parameters :members: -.. automodule:: src.shiver.views.corrections +.. automodule:: shiver.views.corrections :members: -.. automodule:: src.shiver.views.polarized_options +.. automodule:: shiver.views.polarized_options :members: -.. automodule:: src.shiver.views.histogram +.. automodule:: shiver.views.histogram :members: diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 9add1aea..14cb530d 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -6,8 +6,9 @@ Usage Installation ------------ - -Under Construction! +- Available as part of Mantid Workbench +- From source code with `pip` and conda environment configuration +- As a conda package: `Shiver `_ Application Information -----------------------