Skip to content

Commit

Permalink
documentation moved to docs/src
Browse files Browse the repository at this point in the history
  • Loading branch information
andped10 committed May 6, 2024
1 parent fd5c13e commit b517c24
Show file tree
Hide file tree
Showing 58 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions EasyReflectometry/calculators/refl1d/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from refl1d import model
from refl1d import names

from EasyReflectometry.experiment.resolution_functions import is_constant_resolution_function
from EasyReflectometry.experiment.resolution_functions import is_percentage_fhwm_resolution_function

from ..wrapper_base import WrapperBase

Expand Down Expand Up @@ -148,7 +148,7 @@ def calculate(self, q_array: np.ndarray, model_name: str) -> np.ndarray:
sample = _build_sample(self.storage, model_name)
dq_array = self._resolution_function(q_array)

if is_constant_resolution_function(self._resolution_function):
if is_percentage_fhwm_resolution_function(self._resolution_function):
# Get percentage of Q and change from sigma to FWHM
dq_array = dq_array * q_array / 100 / (2 * np.sqrt(2 * np.log(2)))

Expand Down
4 changes: 2 additions & 2 deletions EasyReflectometry/calculators/refnx/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np
from refnx import reflect

from EasyReflectometry.experiment.resolution_functions import is_constant_resolution_function
from EasyReflectometry.experiment.resolution_functions import is_percentage_fhwm_resolution_function

from ..wrapper_base import WrapperBase

Expand Down Expand Up @@ -131,7 +131,7 @@ def calculate(self, q_array: np.ndarray, model_name: str) -> np.ndarray:
)

dq_vector = self._resolution_function(q_array)
if is_constant_resolution_function(self._resolution_function):
if is_percentage_fhwm_resolution_function(self._resolution_function):
# FWHM Percentage resolution is constant given as
# For a constant resolution percentage refnx supports to pass a scalar value rather than a vector
dq_vector = dq_vector[0]
Expand Down
4 changes: 2 additions & 2 deletions EasyReflectometry/experiment/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from easyscience.Objects.ObjectClasses import BaseObj
from easyscience.Objects.ObjectClasses import Parameter

from EasyReflectometry.experiment.resolution_functions import is_constant_resolution_function
from EasyReflectometry.experiment.resolution_functions import is_percentage_fhwm_resolution_function
from EasyReflectometry.parameter_utils import get_as_parameter
from EasyReflectometry.sample import BaseAssembly
from EasyReflectometry.sample import Layer
Expand Down Expand Up @@ -175,7 +175,7 @@ def uid(self) -> int:
@property
def _dict_repr(self) -> dict[str, dict[str, str]]:
"""A simplified dict representation."""
if is_constant_resolution_function(self._resolution_function):
if is_percentage_fhwm_resolution_function(self._resolution_function):
resolution_value = self._resolution_function([0])[0]
resolution = f'{resolution_value} %'
else:
Expand Down
2 changes: 1 addition & 1 deletion EasyReflectometry/experiment/resolution_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ def _linear(q: np.array) -> np.array:
return _linear


def is_constant_resolution_function(resolution_function: Callable[[np.array], np.array]) -> bool:
def is_percentage_fhwm_resolution_function(resolution_function: Callable[[np.array], np.array]) -> bool:
"""Check if the resolution function is a constant."""
return 'constant' in resolution_function.__name__
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = EasyReflectometry
SOURCEDIR = .
SOURCEDIR = ./src
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set SOURCEDIR=./src
set BUILDDIR=_build
set SPHINXPROJ=orsopy

Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/conf.py → docs/src/conf.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import toml
from pathlib import Path

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

main_root = Path(__file__).parents[1]
main_root = Path(__file__).parents[2]
sys.path.append(str(main_root))
project_info = toml.load(os.path.join(main_root, 'pyproject.toml'))

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"from EasyReflectometry.sample import MaterialSolvated\n",
"from EasyReflectometry.sample import Multilayer\n",
"from EasyReflectometry.experiment import Model\n",
"from EasyReflectometry.experiment import constant_resolution_function\n",
"from EasyReflectometry.experiment import percentage_fhwm_resolution_function\n",
"from EasyReflectometry.calculators import CalculatorFactory\n",
"from EasyReflectometry.fitting import Fitter\n",
"from EasyReflectometry.plot import plot"
Expand Down Expand Up @@ -182,7 +182,7 @@
"\n",
"subphase = Layer(material=d2o, thickness=0, roughness=3, name='D2O Subphase')\n",
"\n",
"resolution_function = constant_resolution_function(0.02)\n",
"resolution_function = percentage_fhwm_resolution_function(0.02)\n",
"sample = Sample(superphase, solvated_film_layer, subphase, name='Film Structure')\n",
"model = Model(\n",
" sample=sample,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"from EasyReflectometry.sample import Layer\n",
"from EasyReflectometry.sample import Sample\n",
"from EasyReflectometry.experiment import Model\n",
"from EasyReflectometry.experiment import constant_resolution_function\n",
"from EasyReflectometry.experiment import percentage_fhwm_resolution_function\n",
"from EasyReflectometry.fitting import Fitter\n",
"from EasyReflectometry.plot import plot\n",
"\n"
Expand Down Expand Up @@ -317,7 +317,7 @@
"metadata": {},
"outputs": [],
"source": [
"resolution_function = constant_resolution_function(5)\n",
"resolution_function = percentage_fhwm_resolution_function(5)\n",
"sample = Sample(air_layer, dspc, d2o_layer)\n",
"model = Model(\n",
" sample=sample,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"from EasyReflectometry.sample import LayerAreaPerMolecule\n",
"from EasyReflectometry.sample import Sample\n",
"from EasyReflectometry.experiment import Model\n",
"from EasyReflectometry.experiment import constant_resolution_function\n",
"from EasyReflectometry.experiment import percentage_fhwm_resolution_function\n",
"from EasyReflectometry.calculators import CalculatorFactory\n",
"from EasyReflectometry.fitting import Fitter\n",
"print(f'EasyReflectometry: {EasyReflectometry.__version__}')\n",
Expand Down Expand Up @@ -405,7 +405,7 @@
"metadata": {},
"outputs": [],
"source": [
"resolution_function = constant_resolution_function(5)\n",
"resolution_function = percentage_fhwm_resolution_function(5)\n",
"\n",
"d13d2o_sample = Sample(air_layer, d13d2o, d2o_layer)\n",
"d70d2o_sample = Sample(air_layer, d70d2o, d2o_layer)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"from EasyReflectometry.sample import Material\n",
"from EasyReflectometry.sample import RepeatingMultilayer\n",
"from EasyReflectometry.experiment import Model\n",
"from EasyReflectometry.experiment import constant_resolution_function\n",
"from EasyReflectometry.experiment import percentage_fhwm_resolution_function\n",
"from EasyReflectometry.calculators import CalculatorFactory\n",
"from EasyReflectometry.fitting import Fitter\n",
"from EasyReflectometry.plot import plot"
Expand Down Expand Up @@ -191,7 +191,7 @@
"metadata": {},
"outputs": [],
"source": [
"resolution_function = constant_resolution_function(0)\n",
"resolution_function = percentage_fhwm_resolution_function(0)\n",
"sample = Sample(superphase, rep_multilayer, subphase, name='Multilayer Structure')\n",
"model = Model(\n",
" sample=sample,\n",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"from EasyReflectometry.sample import Material\n",
"from EasyReflectometry.sample import Multilayer\n",
"from EasyReflectometry.experiment import Model\n",
"from EasyReflectometry.experiment import constant_resolution_function\n",
"from EasyReflectometry.experiment import percentage_fhwm_resolution_function\n",
"from EasyReflectometry.calculators import CalculatorFactory\n",
"from EasyReflectometry.fitting import Fitter\n",
"from EasyReflectometry.plot import plot"
Expand Down Expand Up @@ -297,7 +297,7 @@
"metadata": {},
"outputs": [],
"source": [
"resolution_function = constant_resolution_function(0.02)\n",
"resolution_function = percentage_fhwm_resolution_function(0.02)\n",
"model = Model(\n",
" sample=sample,\n",
" scale=1,\n",
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit b517c24

Please sign in to comment.