Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
12ee356
initial commit
rozyczko Aug 6, 2026
f783dc7
weird linting
rozyczko Aug 6, 2026
2ee4d8d
updated comments, type hinting and such
rozyczko Aug 7, 2026
cf920f4
removed all legacy junk
rozyczko Aug 9, 2026
3e59810
minor CR comments addressed
rozyczko Aug 10, 2026
59d0eb8
minor text fixes and simplifications
rozyczko Sep 1, 2026
7519f4f
fixed two minor issues in the LMFit wrapper. #301 and #302
rozyczko Sep 2, 2026
d364c7e
more unit tests so Codecov doesn't complain
rozyczko Sep 2, 2026
fff7998
CR comments addressed
rozyczko Sep 2, 2026
693e11c
Merge pull request #303 from easyscience/assign-none-if-no-covariance
rozyczko Sep 3, 2026
fd8879b
Replaced CollectionBase with EasyList #304
rozyczko Sep 4, 2026
39f308c
DescriptorBase now is a ModelBase class
rozyczko Sep 4, 2026
fda0d28
updated handling of unique_names
rozyczko Sep 4, 2026
c02814f
updated docstrings and some docs
rozyczko Sep 4, 2026
ac5966a
code review comments. part 1
rozyczko Sep 8, 2026
85f0bb3
removed optional Parameters list passed to the minimizers. Part of the
rozyczko Sep 8, 2026
6aadc07
docstring lint
rozyczko Sep 8, 2026
d3a1d0d
More fixes for the PR review. Not ready yet
rozyczko Sep 10, 2026
82a1b01
PR review issues addressed #3
rozyczko Sep 11, 2026
4c3a8b4
PR issues addressed
rozyczko Sep 11, 2026
2e9d9c2
PR review fixes
rozyczko Sep 11, 2026
08b08e9
Merge branch 'easylist-on-multifitter' into modelbase-on-descriptor
rozyczko Sep 11, 2026
03f86be
fix the behaviour when parameters are passed
rozyczko Sep 14, 2026
f646049
list -> sequence
rozyczko Sep 15, 2026
5f8bd2f
Make Sampler completely Fitter-agnostic
rozyczko Sep 17, 2026
71e3327
CR review fixes
rozyczko Sep 22, 2026
922b2a3
Addressed #307: Fix EasyList to accept a list of parameters
rozyczko Sep 22, 2026
eb73c97
Merge pull request #306 from easyscience/modelbase-on-descriptor
rozyczko Sep 22, 2026
6a7fa25
Merge pull request #305 from easyscience/easylist-on-multifitter
rozyczko Sep 22, 2026
1214080
Merge branch 'sampler-engine-structure-280' into 280-more-refactoring
rozyczko Sep 22, 2026
22513ad
Merge pull request #310 from easyscience/280-more-refactoring
rozyczko Sep 22, 2026
1c7ede4
Merge pull request #287 from easyscience/sampler-engine-structure-280
rozyczko Sep 24, 2026
b63c8d3
initial commit
rozyczko Sep 24, 2026
3d9bc5d
more fixes after internal CR
rozyczko Sep 25, 2026
1008789
ruff now changed?
rozyczko Sep 25, 2026
31ff48d
Merge remote-tracking branch 'origin/release-3.0' into 308-remove-name
rozyczko Sep 25, 2026
38a8131
minor text fixes
rozyczko Sep 25, 2026
076b0bb
removed vestiges of ObjBase and such
rozyczko Sep 27, 2026
8c3aa51
minor fixes for calculator binding, new coefficient container and
rozyczko Sep 28, 2026
49f143b
more changes, PR review, removal of Hugger
rozyczko Sep 28, 2026
2ffde0c
removed Polynomial
rozyczko Sep 28, 2026
d270196
commented out functional tests (Polynomial only)
rozyczko Sep 28, 2026
1be0e78
removed legacy exclude from pyproject.toml
rozyczko Sep 28, 2026
9c00901
update unit tests for Codecov
rozyczko Sep 28, 2026
94f8293
clean up the code a tad
rozyczko Sep 30, 2026
be8c0c9
PR review issues addressed
rozyczko Oct 4, 2026
c38c0ea
simplify the new code, as per https://github.com/easyscience/core/pul…
rozyczko Oct 5, 2026
0f1fb8b
extensive CR fixes
rozyczko Oct 5, 2026
0b71d25
Remove _REDIRECT; serializer relies on _arg_spec only
rozyczko Oct 5, 2026
e5bbff6
Merge pull request #319 from easyscience/157-remove-redirect-rebased
rozyczko Oct 5, 2026
f071d05
merged 308-remove-name
rozyczko Oct 6, 2026
970f169
Merge remote-tracking branch 'origin/308-remove-name' into 292-remove…
rozyczko Oct 6, 2026
363b9f2
Merge pull request #314 from easyscience/292-remove-objbase
rozyczko Oct 8, 2026
55de2db
moved serializer_base from io/ to base_classes/
rozyczko Oct 8, 2026
e620f0a
Merge pull request #313 from easyscience/308-remove-name
rozyczko Oct 8, 2026
bdc119f
removed unused descriptor_any_type #318
rozyczko Oct 9, 2026
ba5cd25
Update Parameter repr to show dependent parameters (#330)
damskii9992 Oct 13, 2026
c951c31
Merge pull request #326 from easyscience/318-remove-descriptor
rozyczko Oct 15, 2026
79a9deb
Removed interface factory
rozyczko Oct 16, 2026
70e69a0
PR review issues addressed
rozyczko Oct 16, 2026
adaed61
more PR review comments
rozyczko Oct 16, 2026
1001c80
removed type_dict #207
rozyczko Oct 17, 2026
7473033
improved wording
rozyczko Oct 21, 2026
2f507ab
updated text
rozyczko Oct 22, 2026
aaf23a7
ruff
rozyczko Oct 22, 2026
d819cf0
removed the migration info in external-calculators.md
rozyczko Oct 22, 2026
801d28d
removed useless tests, as per CR
rozyczko Oct 22, 2026
51868a9
Merge pull request #333 from easyscience/294-remove-if
rozyczko Oct 22, 2026
bcd5f77
moved away from Map to ObjectRegistry, as per PR comments
rozyczko Oct 22, 2026
45a26fe
added comment lost in conversion
rozyczko Oct 22, 2026
0355413
removed vestiges of undo/redo
rozyczko Oct 22, 2026
54d38f6
ruff
rozyczko Oct 22, 2026
5803f98
fix test
rozyczko Oct 22, 2026
1ae2081
Merge pull request #338 from easyscience/207-remove-typedict
rozyczko Oct 23, 2026
9d613d2
removed Legacy directory. Moved NewBase to EasyBase
rozyczko Oct 23, 2026
28413ed
ruff
rozyczko Oct 23, 2026
7687761
Merge branch 'release-3.0' into removed_undo
rozyczko Oct 23, 2026
80d914e
removed unnecessary test
rozyczko Oct 23, 2026
b534eba
Merge pull request #342 from easyscience/removed_undo
rozyczko Oct 23, 2026
9fc6a61
minor text fixes
rozyczko Oct 23, 2026
e611680
remove original unique_name on rename
rozyczko Oct 23, 2026
774bbed
PR review issues fixed
rozyczko Oct 23, 2026
7200b07
PR review comments added
rozyczko Oct 23, 2026
e1530e3
Merge pull request #343 from easyscience/new-base-rename
rozyczko Oct 23, 2026
b02eecd
Merge pull request #344 from easyscience/drop-old-name-on-rename
rozyczko Oct 23, 2026
56d682a
removed get_free_parameters #334
rozyczko Oct 27, 2026
d95f071
removed strings in minimizer indexing mechanism #347
rozyczko Oct 27, 2026
4164e3f
fix: convert __all__ elements to string literals (PLE0604) (#350)
markbujehein Oct 28, 2026
2740308
replaced AvailableMinimizers with Minimizers and updated __init__ files
rozyczko Oct 28, 2026
09c3606
Merge branch 'release-3.0' into 347-enum-minimizers
rozyczko Oct 28, 2026
a9f84c3
Merge pull request #346 from easyscience/334-remove-alias
rozyczko Oct 28, 2026
1c476b2
CR comments addressed
rozyczko Oct 29, 2026
9feb730
Merge pull request #348 from easyscience/347-enum-minimizers
rozyczko Oct 30, 2026
b92302b
Merge remote-tracking branch 'origin/develop' into release-3.0
rozyczko Oct 30, 2026
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
17 changes: 7 additions & 10 deletions docs/docs/api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ This section contains the reference detailing the functions and modules
available in EasyScience.

- [base_classes](base_classes.md) – Core abstract and helper base
classes used to build EasyScience objects (e.g. `ObjBase`,
`ModelBase`).
- [fitting](fitting.md) – Fitting utilities and interfaces, including
`Fitter` and available minimizers.
classes used to build EasyScience objects (e.g. `EasyBase`,
`ModelBase`, `EasyList`, `SerializerBase`).
- [fitting](fitting.md) – Fitting and sampling, including `Fitter`,
`Sampler` and the available minimizers.
- [global_object](global_object.md) – Global singleton providing shared
services (logger, map, undo/redo stack, script manager).
- [io](io.md) – Serialization and deserialization framework for
persisting EasyScience objects (serializers and components).
services (logger and object registry).
- [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
(e.g. `DescriptorNumber`, `Parameter`, `DescriptorArray`).
(e.g. `DescriptorNumber`, `Parameter`, `DescriptorArray`). All of them
are `EasyBase` objects, serialized with `to_dict`/`from_dict`.
1 change: 0 additions & 1 deletion docs/docs/api-reference/io.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/docs/api-reference/models.md

This file was deleted.

82 changes: 36 additions & 46 deletions docs/docs/tutorials/fitting-bayesian.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"\n",
"where $\\theta$ are the model parameters, $d$ is the observed data, $p(d \\mid \\theta)$ is the likelihood, and $p(\\theta)$ is the prior. In `easyscience`, the `min`/`max` bounds of a `Parameter` are interpreted as a **uniform prior**, and a Gaussian likelihood is constructed from the data and supplied weights.\n",
"\n",
"`easyscience` exposes a Bayesian Markov-chain Monte Carlo (MCMC) sampler through the `Sampler` class. Under the hood this uses BUMPS' DREAM sampler, so the underlying minimizer must be switched to BUMPS.\n",
"`easyscience` exposes a Bayesian Markov-chain Monte Carlo (MCMC) sampler through the `Sampler` class.\n",
"\n",
"```{note}\n",
"This tutorial focuses on Bayesian analysis with a simple QENS model for illustration. For dedicated QENS fitting with more sophisticated models, consider using [`EasyDynamics`](https://github.com/easyscience/easydynamics).\n",
Expand Down Expand Up @@ -138,12 +138,12 @@
},
{
"cell_type": "markdown",
"id": "9",
"id": "7",
"metadata": {},
"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*.\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 @@ -156,21 +156,24 @@
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
"from easyscience import EasyList\n",
"from easyscience import Parameter\n",
"\n",
"area = Parameter(name='area', value=10, fixed=False, min=1, max=100)\n",
"gamma = Parameter(name='gamma', value=8e-3, fixed=False, min=1e-4, max=1e-2)\n",
"omega_0 = Parameter(name='omega_0', value=1e-3, fixed=False, min=0, max=2e-3)\n",
"sigma = Parameter(name='sigma', value=1e-3, fixed=False, min=1e-5, max=1e-1)"
"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 = EasyList(area, gamma, omega_0, sigma)"
]
},
{
"cell_type": "markdown",
"id": "77ce3f63",
"id": "9",
"metadata": {},
"source": [
"## The model\n",
Expand All @@ -193,7 +196,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "36a0c4f4",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -217,9 +220,7 @@
"source": [
"## Maximum-likelihood fit (optional, but recommended)\n",
"\n",
"Perform a quick maximum-likelihood fit. This is **not** a prerequisite for sampling: `Sampler`\n",
"needs a *configured* `Fitter`, not a *fitted* one, and you can sample straight from the initial\n",
"parameter values.\n",
"Perform a quick maximum-likelihood fit.\n",
"\n",
"It is worth doing anyway, for two reasons:\n",
"\n",
Expand All @@ -239,9 +240,6 @@
"outputs": [],
"source": [
"from easyscience import Fitter\n",
"from easyscience import ObjBase\n",
"\n",
"parameter_container = ObjBase(name='params', A=area, gamma=gamma, omega_0=omega_0, sigma=sigma)\n",
"\n",
"mle_fitter = Fitter(parameter_container, intensity_model)\n",
"mle_result = mle_fitter.fit(x=omega, y=intensity_obs, weights=1 / intensity_error)\n",
Expand All @@ -261,7 +259,7 @@
"\n",
"We now draw samples from the posterior distribution $p(\\theta \\mid d)$ using the BUMPS DREAM (DiffeRential Evolution Adaptive Metropolis) algorithm. DREAM is an ensemble MCMC method that runs multiple chains in parallel and automatically tunes the proposal distribution.\n",
"\n",
"DREAM only works with the BUMPS minimizer. We reuse the ``mle_fitter`` created above — any configured `Fitter` would do, and it does not have to have been fitted — switch it to BUMPS, and create a `Sampler` instance bound to the fitter and data. Calling `sampler.sample()` returns a `SamplingResults` object with the following attributes:\n",
"Create a `Sampler` from the same `parameter_container` and `intensity_model` we gave the `Fitter`, bound to the data. Calling `sampler.sample()` returns a `SamplingResults` object with the following attributes:\n",
"\n",
"- `draws`: a `(n_samples, n_parameters)` array of posterior samples: each **row** is one complete draw from the joint posterior (one value for every parameter simultaneously), and each **column** holds all sampled values for a single parameter. Note this is a *trimmed* view of the chain rather than the raw buffer, so `n_samples` is smaller than `samples / thin` — see the note under [Extend the chain](#extend-the-chain-and-check-convergence);\n",
"- `param_names`: the unique names of the parameters, in the same column order as `draws`;\n",
Expand All @@ -274,7 +272,9 @@
"- `burn` (500): the number of initial *burn-in* generations to discard — the sampler needs time to find the typical set of the posterior, and early samples are not representative. Note this counts generations, not raw samples, so `burn=500` discards `500 × n_chains` raw samples;\n",
"- `thin` (2): the *thinning* interval — only every second generation is kept, which reduces autocorrelation between consecutive draws;\n",
"\n",
"First, we switch to the BUMPS minimizer:"
"```{note}\n",
"If you already have a `Fitter`, `Sampler.from_fitter(mle_fitter, omega, intensity_obs, weights=1 / intensity_error)` builds the same sampler from the model bound to it. The fitter is neither needed afterwards nor modified.\n",
"```"
]
},
{
Expand All @@ -283,22 +283,12 @@
"id": "14",
"metadata": {},
"outputs": [],
"source": [
"from easyscience import AvailableMinimizers\n",
"\n",
"mle_fitter.switch_minimizer(AvailableMinimizers.Bumps)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5a219fcd",
"metadata": {},
"outputs": [],
"source": [
"from easyscience.fitting import Sampler\n",
"\n",
"sampler = Sampler(mle_fitter, omega, intensity_obs, weights=1 / intensity_error)\n",
"sampler = Sampler(\n",
" parameter_container, intensity_model, omega, intensity_obs, weights=1 / intensity_error\n",
")\n",
"results = sampler.sample(samples=10000, burn=500, thin=2)\n",
"\n",
"print(f'Drew {results.draws.shape[0]} samples for {results.draws.shape[1]} parameters.')\n",
Expand All @@ -307,7 +297,7 @@
},
{
"cell_type": "markdown",
"id": "8766b170",
"id": "15",
"metadata": {},
"source": [
"## Convergence diagnostics\n",
Expand All @@ -323,7 +313,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3c49ab6f",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -359,7 +349,7 @@
},
{
"cell_type": "markdown",
"id": "15",
"id": "17",
"metadata": {},
"source": [
"## Posterior summaries\n",
Expand All @@ -377,15 +367,15 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ce3e38a8",
"id": "18",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"id": "19",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -407,7 +397,7 @@
},
{
"cell_type": "markdown",
"id": "17",
"id": "20",
"metadata": {},
"source": [
"## Visualise the joint posterior\n",
Expand All @@ -418,7 +408,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "18",
"id": "21",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -452,7 +442,7 @@
},
{
"cell_type": "markdown",
"id": "19",
"id": "22",
"metadata": {},
"source": [
"## Posterior-predictive band\n",
Expand All @@ -463,7 +453,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "20",
"id": "23",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -499,7 +489,7 @@
},
{
"cell_type": "markdown",
"id": "03339658",
"id": "24",
"metadata": {},
"source": [
"## Extend the chain and check convergence\n",
Expand Down Expand Up @@ -543,7 +533,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "293b140b",
"id": "25",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -573,7 +563,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9ec4302c",
"id": "26",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -614,7 +604,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b0f30be6",
"id": "27",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -641,7 +631,7 @@
},
{
"cell_type": "markdown",
"id": "50b7213a",
"id": "28",
"metadata": {},
"source": [
"### What is Gelman-Rubin R-hat?\n",
Expand Down Expand Up @@ -675,7 +665,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3449e0a7",
"id": "29",
"metadata": {},
"outputs": [],
"source": [
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/tutorials/fitting-qens.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@
"source": [
"from easyscience import Parameter\n",
"\n",
"A = Parameter(name='A', value=10, fixed=False, min=0.01, max=100)\n",
"gamma = Parameter(name='gamma', value=8e-3, fixed=False, min=1e-4, max=10e-3)\n",
"omega_0 = Parameter(name='omega_0', value=0.001, fixed=False, min=0, max=0.002)\n",
"sigma = Parameter(name='sigma', value=0.001, fixed=False, min=1e-5, max=0.1)"
"A = Parameter(display_name='A', value=10, fixed=False, min=0.01, max=100)\n",
"gamma = Parameter(display_name='gamma', value=8e-3, fixed=False, min=1e-4, max=10e-3)\n",
"omega_0 = Parameter(display_name='omega_0', value=0.001, fixed=False, min=0, max=0.002)\n",
"sigma = Parameter(display_name='sigma', value=0.001, fixed=False, min=1e-5, max=0.1)"
]
},
{
Expand Down 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
Loading
Loading