Skip to content

Release 1.9.0 - #441

Closed
rozyczko wants to merge 54 commits into
masterfrom
develop
Closed

rozyczko wants to merge 54 commits into
masterfrom
develop

Conversation

@rozyczko

Copy link
Copy Markdown
Member

This pull request introduces EasyReflectometry version 1.9.0, which is a major release with new features, behavioral changes, and fixes across multiple areas of the library. The most significant changes include support for multiple contrasts, improved project persistence (including correct object sharing and experiment/model mapping), enhanced handling of experiment/model relationships and fitting, per-dataset resolution functions, and new features for volume fraction profiles and magnetism. There are also important fixes for units, documentation, and installation instructions.

Support for multiple contrasts and improved model relationships:

  • Added easyreflectometry.contrasts for managing multiple contrasts, including new APIs for building, linking, and managing contrasts and their parameters. Shared assemblies and materials are now handled by identity or equality, and constraints are saved with the project.
  • Project persistence now ensures objects used in multiple places are saved and restored as shared objects, preventing duplication and ensuring edits propagate as expected. Experiments and models are now mapped by both index and name, with improved error reporting and compatibility handling for older file formats.

Fitting and experiment/model management:

  • Experiments and models are now managed more robustly: removing a model does not automatically remove experiments, and new APIs allow explicit management of experiment-model relationships. The fit summary now reports parameters and fit quality for all models.
  • Fitting now respects the include_in_fit flag per experiment, and fit results are recorded independently of the current model. Bayesian sampling and pooled statistics are improved for multi-dataset fits.

Resolution functions and data handling:

  • Resolution functions now follow the model and dataset, not the calculator, allowing per-dataset resolution in simultaneous fits and polarized experiments. Datasets store their measured resolution, and project files are updated accordingly. APIs for merging datasets, accessing model curves, and Bayesian analysis now support explicit resolution handling.

Magnetism and material improvements:

  • Added support for magnetic SLDs, guide field angle, and applied field in models, with new MaterialMagnetic and related APIs. Magnetism handling is now consistent across import/export and fitting, with clear conventions documented.
  • Fixed the unit metadata for MaterialDensity parameters: SLDs now report the correct unit (1/angstrom^2), and scattering lengths are in angstrom, addressing dimensional correctness (issue Unit metadata is gamed: 1e-23 fudge factor leaves SLD parameter with unit 'kmol/m^5' #377).

rozyczko and others added 30 commits March 23, 2026 11:18
* assure refl1d actually runs from the GUI

* don't fail on codecov upload
* initial implementation

* set `disable` status on relevant sub/super-phase parameters

* fixed tests

* fixes after CR

* fixed tests
* initial implementation of the mighell algorithm for data with zero variances

* don't fail on codecov upload

* fixed chi2 reporting, added MD file with description

* unit test update

* added docs about Mighell

* updated easyscience branch, deleted script

* chi -> chi2

* use develop for core
* backmerge after 1.6.0 release
* initial commit up to and including `pixi run check` step

* fixes

* updates to pyproject.toml

* remade __init__.py

* minor fix

* a few more fixes

* Apply templates with docstrings fixes

* Add missing favicon and update SVG assets

* moved docs for mkdocs

* make "pixi run mkdocs build" and "pixi run nonpy-format-check" work
together

* try using absolute paths for the wheel

* minor fixes

* refactor md file headers for docs

* minor CR changes

* linting

* code review fixes

* CR fixes

* proper globbing

* remove __version__

---------

Co-authored-by: Andrew Sazonov <andrew.sazonov@icloud.com>
* initial commit

* PR review

* more tests
* initial commit with examples

* ruff format

* refactor core modifications to live in reflectometry lib only

* modified the notebook a bit

* refactored MCMC sampling to easyscience module

* added pass-through for cancellation and total number of calculations

* silly typo

* yet another linting

* moved the notebook to the correct location and fixed the formatting

* added more initial arguments to sample. Added unit tests

* prettify charts. Updated notebook

* fixed issue with the notebook

* move file fetch to reflectometry/data

* PR review fixes

* be careful with small chains

* ruff

* try to use explicit dtype for Ubuntu

* another attempt at fixing failing test

* better corner and distribution plots

* updates to the Bayesian API after changes to core

* use bayesian_extend

* minor fixes

* fix failing test

* test against develop, so we can merge the PR

* use mcmc_sample

* fixed tests

* minor notebook fix
* initial commit with examples

* ruff format

* refactor core modifications to live in reflectometry lib only

* modified the notebook a bit

* refactored MCMC sampling to easyscience module

* added pass-through for cancellation and total number of calculations

* silly typo

* yet another linting

* moved the notebook to the correct location and fixed the formatting

* added more initial arguments to sample. Added unit tests

* prettify charts. Updated notebook

* fixed issue with the notebook

* move file fetch to reflectometry/data

* PR review fixes

* be careful with small chains

* ruff

* try to use explicit dtype for Ubuntu

* another attempt at fixing failing test

* better corner and distribution plots

* updated poitwise logic/notebook
* addressing #381

* minor docstring update
* moved to Sampler class from Core

* reparent branch

* fixed issue #367 (#382)

* fixed issue #367

* disable automatic parallelization for windows

* Changes after code review

* added test

* arviz fix

* try to fix prettier issues

* updated notebook

* linting

* fixing #370 (#388)

* reparent to develop

* Core fixes pointwise (#387)

* fixed pointwise treatment on file load

* more tests
* try to fix failing test

* another attempt
* initial version

* added magnetic SLD profile

* added magnetic parameters

* code review comments addressed

* code review fixes for Phase 2, added notebook

* PR code review comments

* fixed polarized file load issue

* enable magnetic layers

* new LayerMagnetism component

* ruff

* ruff on notebooks

* bind calculator to model for performance

* attempt at fixing package testing

* package tests only on master

* don't run ruff twice

* code review fixes

* added polarized fitting example/notebook

* fixed default sample generation

* improved wording in the magnetic fitting notebook

* move the most expensive test to integration
* initial version

* added magnetic SLD profile

* added magnetic parameters

* ruff

* code review comments addressed

* code review fixes for Phase 2, added notebook

* ruff

* PR code review comments

* fixed polarized file load issue

* enable magnetic layers

* new LayerMagnetism component

* ruff

* ruff on notebooks

* bind calculator to model for performance

* attempt at fixing package testing

* package tests only on master

* don't run ruff twice

* code review fixes

* added polarized fitting example/notebook

* fixed default sample generation

* improved wording in the magnetic fitting notebook

* move the most expensive test to integration

* Improved constraints (#395)

* improved handling of constraints

* ruff

* wording

* additional cell in a notebook to showcase the new way of doing
constraints

* fixed notebook

* initial checkin

* .bounds -> min, max

* updates so the code is self-contained and doesn't depend on changes to
core

* Code review comments addressed

* Updated docs (#398)

* move everything to MKDocs
minor updates/fixes after code review

* ruff fix for notebook

* Fix broken conflict resolutions from develop merge

The merge of develop (2042778) left two files with damaged conflict
resolutions: magnetism.ipynb gained a corrupt hybrid cell (invalid
notebook JSON, duplicate cell id) and project.py gained a duplicated
copy of the spin-asymmetry method block with an orphaned method body.
Both files are restored to the branch-side version, which already
contained everything develop had for them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* code review issues addressed

* removed explicit EasyCore constraints factory reliance

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* initial commit

* code review fixes

* more unit tests for orso functionality
* enable SLD dependence on material data

* extending methods for use in ERA

* code review issues addressed

* ruff

* make molecular weight a descriptor
* Improvements to the state tracking #401

* PR issues addressed

* minor ruff NOQA

* reparent to develop of core and fixed the functionality
rozyczko and others added 24 commits September 11, 2026 11:05
* Removed DataStore

* ruff on CHANGELOG

* ruff
* fix the multi-column load #376
Resolved entirely in favour of develop ('ours' strategy). Master's only
unique content is the legacy Sphinx docs tree and the bornagain calculator,
both deliberately removed on develop; every feature from master (Mighell
transform, release prep) is already present here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* correct units for scattering lengths #377

* improved help and tests
* minor fixes required for the updated GUI

* PR review fixes #1

* PR review fixes
* Added volume fraction profile calculation and display. #281

* fixed CHANGELOG
* variable resolution fitting, initial commit

* PR review fixes
* fixed unique_name reuse for uncollected models #426

* added missing test
* added fit configuration owner #427

* PR review fixes
* Multiple contrasts implementation improved. #425 issue #2

* PR review fixes

* another round of reviews

* added docs and notebook for multiple contrasts

* added multiple contrast docs and notebook

* fixed docs
* Variable resolution fitting fixes from #425 p.3

* code review fixes
* updated README.md

* slight modifications of README
* implemented fixes to the magnetism feature. #425, point 3.

* code review fixes
Back-merge of the v1.8.0 squash commit (identical tree to e7e3693) so that
develop can be merged into master without conflicts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rozyczko rozyczko added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] high Should be prioritized soon enhancement labels Oct 19, 2026
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.52294% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.69%. Comparing base (831fb03) to head (1ea5b20).

Files with missing lines Patch % Lines
src/easyreflectometry/project.py 95.74% 25 Missing ⚠️
...eflectometry/sample/assemblies/surfactant_layer.py 14.28% 6 Missing ⚠️
...try/sample/elements/materials/material_magnetic.py 91.07% 5 Missing ⚠️
src/easyreflectometry/sample/paths.py 90.69% 4 Missing ⚠️
src/easyreflectometry/sample/volume_fraction.py 97.96% 4 Missing ⚠️
src/easyreflectometry/sample/references.py 97.72% 3 Missing ⚠️
src/easyreflectometry/fit_settings.py 98.85% 2 Missing ⚠️
src/easyreflectometry/fitting.py 99.27% 2 Missing ⚠️
src/easyreflectometry/calculators/factory.py 92.85% 1 Missing ⚠️
...rc/easyreflectometry/calculators/refl1d/wrapper.py 95.45% 1 Missing ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #441      +/-   ##
==========================================
+ Coverage   94.57%   95.69%   +1.11%     
==========================================
  Files          54       60       +6     
  Lines        5515     7294    +1779     
==========================================
+ Hits         5216     6980    +1764     
- Misses        299      314      +15     
Flag Coverage Δ
integration 38.93% <32.98%> (+0.60%) ⬆️
unittests 95.69% <97.52%> (+1.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/easyreflectometry/analysis/bayesian.py 97.07% <100.00%> (+0.02%) ⬆️
...c/easyreflectometry/calculators/calculator_base.py 100.00% <100.00%> (ø)
...easyreflectometry/calculators/refl1d/calculator.py 100.00% <ø> (ø)
src/easyreflectometry/calculators/refnx/wrapper.py 100.00% <100.00%> (ø)
src/easyreflectometry/calculators/wrapper_base.py 100.00% <100.00%> (ø)
src/easyreflectometry/contrasts.py 100.00% <100.00%> (ø)
src/easyreflectometry/data/__init__.py 100.00% <100.00%> (ø)
src/easyreflectometry/data/data_store.py 100.00% <100.00%> (ø)
src/easyreflectometry/data/measurement.py 96.29% <100.00%> (+1.79%) ⬆️
src/easyreflectometry/data/polarized.py 95.31% <100.00%> (+0.03%) ⬆️
... and 26 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rozyczko rozyczko closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement [priority] high Should be prioritized soon [scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant