Skip to content

Commit 07f462d

Browse files
authored
Merge pull request #160 from EasyScience/develop
* 148 transfer to common project template (#155) * moving files and import adjustments * docs update * code cleaning * reintroducing EasyReflectometry at certain places * doc get version from package * 145 update easycore to easyscience (#156) * readme with logo * readme badges * readme * readme * readme * readme * readme * changes to doc * template * pyproject * update pyproject * copier answers * easyCore to easyscience * readme * docs update * release drafter back to original * updates from template
2 parents c162226 + 2d76795 commit 07f462d

File tree

115 files changed

+516
-552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+516
-552
lines changed
File renamed without changes.

.copier-answers.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: 8bdcedc
3+
_src_path: gh:/EasyScience/EasyProjectTemplate
4+
description: A reflectometry python package built on the EasyScience framework.
5+
max_python: '3.12'
6+
min_python: '3.9'
7+
orgname: EasyScience
8+
packagename: easyreflectometry
9+
prettyname: Easy Reflectometry Library
10+
projectname: easyreflectometry
11+
year: 2024

.github/workflows/documentation-build.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# This workflow will
2-
# - build developer documentation
3-
# - push documentation to gh-pages branch of the same repository
1+
# This pipeline
2+
# - builds developer documentation
3+
# - pushes documentation to gh-pages branch of the same repository
44
#
55
# Deployment is handled by pages-build-deployment bot
6+
#
7+
# For more information see: https://docs.github.com/en/pages/getting-started-with-github-pages
68

7-
name: Build Documentation and Push to gh-pages Branch
9+
name: Build Documentation and Push to gh-pages Branch
810

911
# Controls when the workflow will run
1012
on:
@@ -26,6 +28,9 @@ jobs:
2628
uses: actions/checkout@master
2729
with:
2830
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
31+
- name: Upgrade pip
32+
run: |
33+
python -m pip install --upgrade pip
2934
- name: Set up Python
3035
uses: actions/setup-python@v5
3136
with:
@@ -34,7 +39,6 @@ jobs:
3439
run: |
3540
sudo apt install pandoc
3641
pip install . '.[dev,docs]'
37-
3842
- name: Build and Commit
3943
uses: sphinx-notes/pages@master
4044
with:
@@ -44,4 +48,4 @@ jobs:
4448
uses: ad-m/github-push-action@master
4549
continue-on-error: true
4650
with:
47-
branch: gh-pages
51+
branch: gh-pages

.github/workflows/ossar-analysis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# This workflow integrates a collection of open source static analysis tools
2-
# with GitHub code scanning. For documentation, or to provide feedback, visit
3-
# https://github.com/github/ossar-action
2+
# with GitHub code scanning.
3+
#
4+
# For more information see: https://github.com/github/ossar-action
5+
6+
47
name: OSSAR
58

69
on:
@@ -38,7 +41,7 @@ jobs:
3841

3942
# Run open source static analysis tools
4043
- name: Run OSSAR
41-
uses: github/ossar-action@v1
44+
uses: github/ossar-action@v2.0.0
4245
id: ossar
4346

4447
# Upload results to the Security tab

.github/workflows/python-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ jobs:
4343
with:
4444
python-version: ${{ matrix.python-version }}
4545

46+
- name: Upgrade pip
47+
run: |
48+
python -m pip install --upgrade pip
49+
4650
- name: Install dependencies
4751
run: pip install -e '.[dev]'
4852

.github/workflows/python-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
66

7+
78
name: Publish Python Package
89

910
# Controls when the workflow will run

.github/workflows/release-drafter-verify-pr-labels.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# This workflow will
22
# - verify that a PR has a known label before it can be merged.
33
#
4-
# A label is needed for the release-drafter workflow to generate the notes.
4+
# A PR is enforced to have one of the labels listed in the valid-labels input.
5+
#
6+
# For more information see: https://github.com/marketplace/actions/release-drafter
7+
58

69
name: Verify PR labels
710
on:

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ build
3636
*.dmg
3737

3838
# Docs
39-
docs/_build
39+
docs/_build
4040

4141
# VSCode
4242
.vscode
@@ -47,4 +47,3 @@ docs/_build
4747
*.zip
4848
.ci/
4949
.idea/
50-

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Before you submit a pull request, check that it meets these guidelines:
101101
1. The pull request should include tests.
102102
2. If the pull request adds functionality, the docs should be updated. Put
103103
your new functionality into a function with a docstring, and add the
104-
feature to the list in README.rst.
104+
feature to the list in README.md.
105105
3. The pull request should work for Python 3.9, 3.10, and 3.11, and for PyPy. Check
106106
https://travis-ci.com/easyScience/EasyReflectometryLib/pull_requests
107107
and make sure that the tests pass for all supported Python versions.

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2021-2022, European Spallation Source
3+
Copyright (c) 2024, Easyscience contributors (https://github.com/EasyScience)
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without
@@ -26,4 +26,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2626
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2727
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2828
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
![Logo](https://github.com/easyScience/EasyReflectometryLib/raw/master/docs/src/_static/logo.png)
2+
[![CI badge](https://github.com/easyScience/EasyReflectometryLib/actions/workflows/python-ci.yml/badge.svg)](https://github.com/easyScience/easyReflectometryLib/actions/workflows/python-ci.yml)
3+
[![PyPI badge](http://img.shields.io/pypi/v/EasyReflectometryLib.svg)](https://pypi.python.org/pypi/EasyReflectometryLib)
4+
[![Coverage badge](https://codecov.io/gh/easyScience/EasyReflectometryLib/branch/master/graph/badge.svg?token=LcnB8AMGkw)](https://codecov.io/gh/easyScience/EasyReflectometryLib)
5+
[![Quality badge](https://www.codefactor.io/repository/github/easyscience/easyreflectometrylib/badge)](https://www.codefactor.io/repository/github/easyscience/easyreflectometrylib)
6+
[![Docs badge](https://img.shields.io/badge/docs-built-blue)](http://docs.easyreflectometry.org)
7+
8+
# About
9+
10+
A reflectometry python package and an application.
11+
12+
This repo and documentation is for the `easyreflectometry` Python package that is built on the `easyscience` [framework](https://easyscience.software).
13+
To get more information about the application visit [`easyreflectometry.org`](https://easyreflectometry.org)
14+
15+
# Installation
16+
17+
```sh
18+
python -m pip install easyreflectometry
19+
```

README.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.assemblies.gradient_layer
1+
.. automodule:: easyreflectometry.sample.assemblies.gradient_layer
22
:members:
33
:undoc-members:
44
:show-inheritance:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.assemblies.multilayer
1+
.. automodule:: easyreflectometry.sample.assemblies.multilayer
22
:members:
33
:undoc-members:
44
:show-inheritance:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.assemblies.repeating_multilayer
1+
.. automodule:: easyreflectometry.sample.assemblies.repeating_multilayer
22
:members:
33
:undoc-members:
44
:show-inheritance:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.assemblies.surfactant_layer
1+
.. automodule:: easyreflectometry.sample.assemblies.surfactant_layer
22
:members:
33
:undoc-members:
44
:show-inheritance:

docs/src/api/data.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.data
1+
.. automodule:: easyreflectometry.data
22
:members:
33
:undoc-members:
44
:show-inheritance:

docs/src/api/elements/layer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.elements.layers.layer
1+
.. automodule:: easyreflectometry.sample.elements.layers.layer
22
:members:
33
:undoc-members:
44
:show-inheritance:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.elements.layers.layer_area_per_molecule
1+
.. automodule:: easyreflectometry.sample.elements.layers.layer_area_per_molecule
22
:members:
33
:undoc-members:
44
:show-inheritance:

docs/src/api/elements/material.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.elements.materials.material
1+
.. automodule:: easyreflectometry.sample.elements.materials.material
22
:members:
33
:undoc-members:
44
:show-inheritance:

docs/src/api/elements/material_density.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.elements.materials.material_density
1+
.. automodule:: easyreflectometry.sample.elements.materials.material_density
22
:members:
33
:undoc-members:
44
:show-inheritance:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.elements.materials.material_mixture
1+
.. automodule:: easyreflectometry.sample.elements.materials.material_mixture
22
:members:
33
:undoc-members:
44
:show-inheritance:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.sample.elements.materials.material_solvated
1+
.. automodule:: easyreflectometry.sample.elements.materials.material_solvated
22
:members:
33
:undoc-members:
44
:show-inheritance:

docs/src/api/model.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. automodule:: EasyReflectometry.experiment.model
1+
.. automodule:: easyreflectometry.experiment.model
22
:members:
33
:undoc-members:
44
:show-inheritance:

docs/src/api/sample.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
.. automodule:: EasyReflectometry.sample.sample
2+
.. automodule:: easyreflectometry.sample.sample
33
:members:
44
:undoc-members:
55
:show-inheritance:

docs/src/calculators.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Calculators & Optimisation
22
==========================
33

4-
:py:mod:`EasyReflectometry` is built on the :py:mod:`easyScience` framework which facilities the use of a range of different reflectometry calculation engines and optimiser solutions.
5-
Currently, :py:mod:`EasyReflectometry` can offer two different calculation engines, namely:
4+
:py:mod:`easyreflectometry` is built on the :py:mod:`easyscience` framework which facilities the use of a range of different reflectometry calculation engines and optimiser solutions.
5+
Currently, :py:mod:`easyreflectometry` can offer two different calculation engines, namely:
66

77
* `refnx`_
88
* `Refl1D`_

docs/src/conf.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import toml
2424
from pathlib import Path
2525

26+
import easyreflectometry
27+
2628
sys.path.insert(0, os.path.abspath('../src'))
2729

2830
main_root = Path(__file__).parents[2]
@@ -50,7 +52,8 @@
5052
'sphinx.ext.imgmath',
5153
'sphinx.ext.mathjax',
5254
'sphinx_autodoc_typehints',
53-
'nbsphinx'
55+
'nbsphinx',
56+
'myst_parser'
5457
]
5558

5659
# Add any paths that contain templates here, relative to this directory.
@@ -74,10 +77,10 @@
7477
# for |version| and |release|, also used in various other places throughout
7578
# the built documents.
7679
#
80+
# TODO: This should be updated to use the version from the package when that is working.
7781
# The short X.Y version.
78-
version = project_info['project']['version']
7982
# The full version, including alpha/beta/rc tags.
80-
version = project_info['project']['version']
83+
version = easyreflectometry.__version__
8184

8285
# The language for content autogenerated by Sphinx. Refer to documentation
8386
# for a list of supported languages.

docs/src/experiment/experiment.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
Experiment
22
==========
33

4-
The main component of an experiment in :py:mod:`EasyReflectometry` is the `Model`.
5-
This is a description of the `sample` and the environment in which the experiment is performed.
6-
The `Model` is used to calculate the reflectivity of the `Sample` at a given set of angles (Q-points).
7-
The `resolution_functions` are used to quantify the experimental uncertainties in wavelength and angle, allowing the `Model`` to accurately describe the data.
4+
The main component of an experiment in :py:mod:`easyreflectometry` is the :py:class:`Model`.
5+
This is a description of the :py:class:`Sample` and the environment in which the experiment is performed.
6+
The :py:class:`Model` is used to calculate the reflectivity of the :py:class:`Sample` at a given set of angles (Q-points).
7+
The :py:func:`resolution_functions` are used to quantify the experimental uncertainties in wavelength and angle, allowing the :py:class:`Model` to accurately describe the data.
88

99
:py:class:`Model`
1010
-----------------
1111

12-
A `Model` instance contains a `Sample` and variables describing experimental settings.
13-
To be able to compute reflectivities it is also necessary to have a `Calculator` (interface).
12+
A :py:class:`Model` instance contains a :py:class:`Sample` and variables describing experimental settings.
13+
To be able to compute reflectivities it is also necessary to have a :py:class:`Calculator` (interface).
1414

1515
.. code-block:: python
1616
17-
from EasyReflectometry.calculators import CalculatorFactory
18-
from EasyReflectometry.experiment import Model
19-
from EasyReflectometry.sample import Sample
17+
from easyreflectometry.calculators import CalculatorFactory
18+
from easyreflectometry.experiment import Model
19+
from easyreflectometry.sample import Sample
2020
2121
default_sample = Sample()
2222
m = Model(
@@ -28,13 +28,13 @@ To be able to compute reflectivities it is also necessary to have a `Calculator`
2828
interface = CalculatorFactory()
2929
model.interface = interface
3030
31-
This will create a :py:class:`Model` instance with the `default_sample` and the environment variables `scale` factor set to 1.0 and a `background` of 1e-6.
32-
Following the `interface` is set to the default calculator that is `Refnx`.
31+
This will create a :py:class:`Model` instance with the :py:attr:`default_sample` and the environment variables :py:attr:`scale` factor set to 1.0 and a :py:attr:`background` of 1e-6.
32+
Following the :py:attr:`interface` is set to the default calculator that is :py:class:`Refnx`.
3333

3434

3535
:py:mod:`resolution_functions`
3636
------------------------------
37-
A resolution function enables the `EasyReflectometry` model to incorporate the experimental uncertainties in wavelength and incident angle into the model.
37+
A resolution function enables the :py:mod:`easyreflectometry` model to incorporate the experimental uncertainties in wavelength and incident angle into the model.
3838
In its essence the resolution function controls the smearing to apply when determing the reflectivtiy at a given Q-point.
3939
For a given Q-point the smearing to apply is given as a weighted average of the neighboring Q-point, which weigths are by a normal distribution.
4040
This normal distribution is then defined by a Q-point dependent Full Width at the Half Maximum (FWHM) that is given by the resolution function.
@@ -45,8 +45,8 @@ By this is understood that the applied smearing in an Q-point has a FWHM that is
4545

4646
.. code-block:: python
4747
48-
from EasyReflectometry.experiment import Model
49-
from EasyReflectometry.experiment import percentage_fhwm_resolution_function
48+
from easyreflectometry.experiment import Model
49+
from easyreflectometry.experiment import percentage_fhwm_resolution_function
5050
5151
resolution_function = percentage_fhwm_resolution_function(1.1)
5252
@@ -64,8 +64,8 @@ and thereby enable a determination of the reflectivity at an arbitrary point wit
6464

6565
.. code-block:: python
6666
67-
from EasyReflectometry.experiment import Model
68-
from EasyReflectometry.experiment import linear_spline_resolution_function
67+
from easyreflectometry.experiment import Model
68+
from easyreflectometry.experiment import linear_spline_resolution_function
6969
7070
m = Model()
7171

docs/src/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.. include:: ../../README.rst
1+
.. include:: ../../README.md
2+
:parser: myst_parser.sphinx_
23

34
.. toctree::
45
:hidden:

0 commit comments

Comments
 (0)