Skip to content

Commit

Permalink
Openssf updates (#107)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mpatrou authored Sep 26, 2023
1 parent fcbff7d commit 4f299a4
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 34 deletions.
5 changes: 5 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ build:
tools:
python: "mambaforge-4.10"

python:
install:
- method: pip
path: .

sphinx:
builder: html
configuration: docs/source/conf.py
Expand Down
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -27,7 +31,11 @@ s=Shiver()
s.show()
```

For Developers
## For Contibutors

**Testing**

---

To run all tests for shiver
```bash
Expand All @@ -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
Expand All @@ -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)
Expand Down
24 changes: 23 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import sys
import versioningit

# import matplotlib
# matplotlib.use("Agg")

sys.path.insert(0, os.path.abspath("../../"))

Expand All @@ -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
Expand All @@ -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),
Expand Down
56 changes: 28 additions & 28 deletions docs/source/repo_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
5 changes: 3 additions & 2 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://anaconda.org/neutrons/shiver>`_

Application Information
-----------------------
Expand Down

0 comments on commit 4f299a4

Please sign in to comment.