Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ jobs:
working-directory: easyscience
run: pixi run python -m pytest ../tests/unit/ --color=yes -v

- name: Run functional tests to verify the installation
working-directory: easyscience
run: pixi run python -m pytest ../tests/functional/ --color=yes -v

- name: Run integration tests to verify the installation
working-directory: easyscience
run: pixi run python -m pytest ../tests/integration/ --color=yes -n auto
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,6 @@ jobs:
pixi run --environment $env unit-tests
done

- name: Run functional tests
shell: bash
run: |
set -euo pipefail

for py_ver in $PY_VERSIONS; do
echo
echo "🔹🔸🔹🔸🔹 Python: $py_ver 🔹🔸🔹🔸🔹"

env="py-$(echo $py_ver | tr -d .)-env" # Converts 3.XX -> py-3XX-env

echo "Running tests in environment: $env"
pixi run --environment $env functional-tests
done

- name: Run integration tests ${{ needs.env-prepare.outputs.pytest-marks }}
shell: bash
run: |
Expand Down Expand Up @@ -258,25 +243,6 @@ jobs:
cd ..
done

- name: Run functional tests
shell: bash
run: |
set -euo pipefail

for py_ver in $PY_VERSIONS; do
echo
echo "🔹🔸🔹🔸🔹 Python: $py_ver 🔹🔸🔹🔸🔹"

echo "Entering pixi project directory easyscience_py$py_ver"
cd easyscience_py$py_ver

echo "Running tests"
pixi run python -m pytest ../tests/functional/ --color=yes -v

echo "Exiting pixi project directory"
cd ..
done

- name: Run integration tests ${{ needs.env-prepare.outputs.pytest-marks }}
shell: bash
run: |
Expand Down
2 changes: 0 additions & 2 deletions docs/docs/api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ available in EasyScience.
persisting EasyScience objects (serializers and components).
- [job](job.md) – Job and experiment abstractions for running and
organizing analyses.
- [models](models.md) – Predefined model implementations (e.g.
polynomial models) used in fitting workflows.
- [utils](utils.md) – Miscellaneous utility functions and helpers (class
tools, decorators, type helpers).
- [variable](variable.md) – Descriptor types and variable abstractions
Expand Down
1 change: 0 additions & 1 deletion docs/docs/api-reference/models.md

This file was deleted.

6 changes: 3 additions & 3 deletions docs/docs/tutorials/fitting-bayesian.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"source": [
"## Defining parameters with priors\n",
"\n",
"Create four `Parameter` objects, for the area $A$, $\\gamma$, $\\omega_0$ and $\\sigma$. The `min` and `max` arguments define a **uniform prior** on each parameter — the sampler will only consider values inside this range and will treat every value inside the range as equally plausible *a priori*. The parameters are then collected in an `ObjBase` container: this is the model object that both `Fitter` and `Sampler` take, so it is defined here, before the optional fit.\n",
"Create four `Parameter` objects, for the area $A$, $\\gamma$, $\\omega_0$ and $\\sigma$. The `min` and `max` arguments define a **uniform prior** on each parameter — the sampler will only consider values inside this range and will treat every value inside the range as equally plausible *a priori*. The parameters are then collected in an `EasyList` container: this is the model object that both `Fitter` and `Sampler` take, so it is defined here, before the optional fit.\n",
"\n",
"| Parameter | Initial Value | Min | Max |\n",
"| --- | --- | --- | --- |\n",
Expand All @@ -160,15 +160,15 @@
"metadata": {},
"outputs": [],
"source": [
"from easyscience import ObjBase\n",
"from easyscience import EasyList\n",
"from easyscience import Parameter\n",
"\n",
"area = Parameter(display_name='area', value=10, fixed=False, min=1, max=100)\n",
"gamma = Parameter(display_name='gamma', value=8e-3, fixed=False, min=1e-4, max=1e-2)\n",
"omega_0 = Parameter(display_name='omega_0', value=1e-3, fixed=False, min=0, max=2e-3)\n",
"sigma = Parameter(display_name='sigma', value=1e-3, fixed=False, min=1e-5, max=1e-1)\n",
"\n",
"parameter_container = ObjBase(name='params', A=area, gamma=gamma, omega_0=omega_0, sigma=sigma)"
"parameter_container = EasyList(area, gamma, omega_0, sigma)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/tutorials/fitting-qens.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@
"metadata": {},
"outputs": [],
"source": [
"from easyscience import EasyList\n",
"from easyscience import Fitter\n",
"from easyscience import ObjBase\n",
"\n",
"params = ObjBase(name='params', A=A, gamma=gamma, omega_0=omega_0, sigma=sigma)\n",
"params = EasyList(A, gamma, omega_0, sigma)\n",
"f = Fitter(params, intensity)\n",
"\n",
"res = f.fit(x=q, y=i, weights=1 / di)"
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/tutorials/fitting-sans.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@
"metadata": {},
"outputs": [],
"source": [
"from easyscience import EasyList\n",
"from easyscience import Fitter\n",
"from easyscience import ObjBase\n",
"\n",
"params = ObjBase(name='params', delta_rho=delta_rho, r=r, bkg=bkg)\n",
"params = EasyList(delta_rho, r, bkg)\n",
"f = Fitter(params, sphere)\n",
"\n",
"res = f.fit(x=q, y=i, weights=1 / di)"
Expand Down
40 changes: 16 additions & 24 deletions docs/docs/tutorials/progress-callback.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
"import numpy as np\n",
"\n",
"from easyscience import AvailableMinimizers\n",
"from easyscience import EasyList\n",
"from easyscience import Fitter\n",
"from easyscience import ObjBase\n",
"from easyscience import ModelBase\n",
"from easyscience import Parameter"
]
},
Expand Down Expand Up @@ -82,32 +83,23 @@
},
"outputs": [],
"source": [
"class MultiPeak(ObjBase):\n",
" a0: Parameter\n",
" a1: Parameter\n",
" a2: Parameter\n",
" A1: Parameter\n",
" mu1: Parameter\n",
" sigma1: Parameter\n",
" A2: Parameter\n",
" mu2: Parameter\n",
" sigma2: Parameter\n",
" A3: Parameter\n",
" mu3: Parameter\n",
" sigma3: Parameter\n",
"\n",
"class MultiPeak(ModelBase):\n",
" def __init__(self, **values):\n",
" params = {name: Parameter(value, display_name=name) for name, value in values.items()}\n",
" super().__init__('multipeak', **params)\n",
" super().__init__(display_name='multipeak')\n",
" self._parameters = EasyList(\n",
" *(Parameter(value, display_name=name) for name, value in values.items())\n",
" )\n",
"\n",
" @property\n",
" def parameters(self) -> EasyList:\n",
" return self._parameters\n",
"\n",
" def __call__(self, x):\n",
" bg = self.a0.value + self.a1.value * x + self.a2.value * x**2\n",
" p = {par.display_name: par.value for par in self.parameters}\n",
" bg = p['a0'] + p['a1'] * x + p['a2'] * x**2\n",
" peaks = 0.0\n",
" for A, mu, sigma in (\n",
" (self.A1.value, self.mu1.value, self.sigma1.value),\n",
" (self.A2.value, self.mu2.value, self.sigma2.value),\n",
" (self.A3.value, self.mu3.value, self.sigma3.value),\n",
" ):\n",
" for i in (1, 2, 3):\n",
" A, mu, sigma = p[f'A{i}'], p[f'mu{i}'], p[f'sigma{i}']\n",
" peaks = peaks + A * np.exp(-0.5 * ((x - mu) / sigma) ** 2)\n",
" return bg + peaks"
]
Expand Down Expand Up @@ -205,7 +197,7 @@
" mu3=3.0,\n",
" sigma3=1.2,\n",
" )\n",
" for p in model.get_parameters():\n",
" for p in model.get_all_parameters():\n",
" p.fixed = False\n",
" return model"
]
Expand Down
4 changes: 0 additions & 4 deletions docs/docs/user-guide/controlling-log-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ individual subsystems:
```
easyscience # root — controls everything
├── easyscience.base_classes # EasyList runtime warnings
├── easyscience.legacy # ObjBase / CollectionBase deprecations
├── easyscience.deprecated # @deprecated decorator messages
├── easyscience.fitting # import-availability warnings
│ ├── easyscience.fitting.bumps # Bumps fitting runtime messages
Expand All @@ -56,9 +55,6 @@ logging.getLogger('easyscience.fitting').setLevel(logging.ERROR)

# Suppress only Bumps runtime messages
logging.getLogger('easyscience.fitting.bumps').setLevel(logging.ERROR)

# Suppress only legacy deprecation notices
logging.getLogger('easyscience.legacy').setLevel(logging.ERROR)
```

## Environment Variable
Expand Down
1 change: 0 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,5 @@ nav:
- global_object: api-reference/global_object.md
- io: api-reference/io.md
- job: api-reference/job.md
- models: api-reference/models.md
- utils: api-reference/utils.md
- variable: api-reference/variable.md
4 changes: 2 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ user = { features = ['py-max', 'user'] }
##################

unit-tests = 'python -m pytest tests/unit/ --color=yes -v'
functional-tests = 'python -m pytest tests/functional/ --color=yes -v'
# functional-tests = 'python -m pytest tests/functional/ --color=yes -v'
integration-tests = 'python -m pytest tests/integration/ --color=yes -n auto -v'
notebook-tests = 'python -m pytest --nbmake docs/docs/tutorials/ --nbmake-timeout=1200 --color=yes -n auto -v'

Expand Down Expand Up @@ -149,7 +149,7 @@ raw-metrics-json = 'radon raw -s -j src/'
#############

unit-tests-coverage = 'pixi run unit-tests --cov=src/easyscience --cov-report=term-missing'
functional-tests-coverage = 'pixi run functional-tests --cov=src/easyscience --cov-report=term-missing'
# functional-tests-coverage = 'pixi run functional-tests --cov=src/easyscience --cov-report=term-missing'
integration-tests-coverage = 'pixi run integration-tests --cov=src/easyscience --cov-report=term-missing'
docstring-coverage = 'interrogate -c pyproject.toml src/easyscience'

Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ default-tag = 'v999.0.0'
[tool.interrogate]
fail-under = 45 # Minimum docstring coverage percentage to pass
verbose = 1
exclude = ['src/easyscience/legacy']

#######################################
# Configuration for coverage/pytest-cov
Expand Down Expand Up @@ -178,7 +177,7 @@ testpaths = ['tests']
# https://docs.astral.sh/ruff/rules/

[tool.ruff]
exclude = ['tests', 'legacy', 'src/easyscience/legacy']
exclude = ['tests']
indent-width = 4
line-length = 99 # See also `max-line-length` in [tool.ruff.lint.pycodestyle]
preview = true # Enable new rules that are not yet stable, like DOC
Expand Down Expand Up @@ -285,7 +284,6 @@ max-positional-args = 6
# the parameter declarations in the code (in function's signature).

[tool.pydoclint]
exclude = 'src/easyscience/legacy'
style = 'numpy'
check-style-mismatch = true
check-arg-defaults = true
Expand All @@ -299,7 +297,6 @@ allow-init-docstring = true
# https://github.com/jsh9/format-docstring

[tool.format_docstring]
exclude = 'src/easyscience/legacy'
docstring_style = 'numpy'
line_length = 72
fix_rst_backticks = true
Expand Down
8 changes: 4 additions & 4 deletions src/easyscience/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
global_object.stack.enabled = False


from .base_classes import ObjBase # noqa: E402
from .base_classes import EasyList # noqa: E402
from .base_classes import ModelBase # noqa: E402
from .fitting import AvailableMinimizers # noqa: E402
from .fitting import Fitter # noqa: E402
from .legacy import CollectionBase # noqa: E402
from .variable import DescriptorNumber # noqa: E402
from .variable import Parameter # noqa: E402

Expand All @@ -23,8 +23,8 @@
__all__ = [
__version__,
global_object,
ObjBase,
CollectionBase,
ModelBase,
EasyList,
AvailableMinimizers,
Fitter,
DescriptorNumber,
Expand Down
5 changes: 1 addition & 4 deletions src/easyscience/base_classes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# SPDX-FileCopyrightText: 2025 EasyScience contributors <https://github.com/easyscience>
# SPDX-License-Identifier: BSD-3-Clause

from ..legacy.collection_base import CollectionBase
from ..legacy.obj_base import ObjBase
from .based_base import BasedBase
from .easy_list import EasyList
from .model_base import ModelBase
from .new_base import NewBase

__all__ = [BasedBase, CollectionBase, ObjBase, ModelBase, NewBase, EasyList]
__all__ = [ModelBase, NewBase, EasyList]
Loading
Loading