Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
bd31104
Refl1d fix (#302)
rozyczko Mar 23, 2026
de04b49
Improved limits for certain parameters (#304)
rozyczko Apr 13, 2026
303d6aa
Mighell transform (#303)
rozyczko Apr 27, 2026
b883a60
version bump. dependency fix for release.
rozyczko Apr 30, 2026
bd263d0
modified release version
rozyczko Apr 30, 2026
f760773
updated docs
rozyczko Apr 30, 2026
8e55266
include plopp as a doc dependency
rozyczko Apr 30, 2026
b16ec14
Preparations for the release (#350) (#351)
rozyczko May 6, 2026
d773e7f
Apply templates (#353)
rozyczko May 12, 2026
74e9a5b
prettify the summary (#356)
rozyczko May 22, 2026
7e73364
refactor printout formatter (#358)
rozyczko May 22, 2026
c95d2e0
make PDF links clickable (#359)
rozyczko May 22, 2026
5642d8c
Move to EasyList (#360)
rozyczko May 28, 2026
7324189
Bayesian analysis (#352)
rozyczko Jun 5, 2026
bfae144
HTML Summary now shows plots with plotly (#363)
rozyczko Jun 5, 2026
a472411
Pointwise update (#362)
rozyczko Jun 5, 2026
5e14e7f
381 apitest hygiene (#384)
rozyczko Jul 24, 2026
90fed4f
fixes for summary printout #375 (#385)
rozyczko Jul 27, 2026
01c07d5
Core fixes (#383)
rozyczko Jul 30, 2026
576d45b
reparented easyscience, updated CHANGELOG
rozyczko Jul 31, 2026
85f7091
Merge branch 'master' into develop
rozyczko Jul 31, 2026
eb381d9
codecov related fixes (#391)
rozyczko Jul 31, 2026
299127d
Codecov fixes 2 (#392)
rozyczko Jul 31, 2026
f96fefd
Polarized channels (#393)
rozyczko Aug 27, 2026
ba07dde
dont show 0.0 for parameter errors where no fitting was done (#397)
rozyczko Aug 27, 2026
d674b2b
removed vestiges of BA (#394)
rozyczko Aug 28, 2026
c869e63
Improved constraints + doc migration (#400)
rozyczko Sep 1, 2026
8b13521
Orso improvements (#402)
rozyczko Sep 2, 2026
35c0aa1
Enable SLD dependence on material data (#403)
rozyczko Sep 7, 2026
eeb5957
Improvements to the state tracking #401 (#405)
rozyczko Sep 9, 2026
4d4160f
minor material editor fix (#408)
rozyczko Sep 11, 2026
10f01c7
fix default elements (#410)
rozyczko Sep 14, 2026
dd3cb93
378 remove datastore (#409)
rozyczko Sep 14, 2026
53be08b
Added exception when file exists and overwrite=false (#411)
rozyczko Sep 14, 2026
ad7d255
fix the multi-column load #376 (#413)
rozyczko Sep 15, 2026
198faae
preparations for the release
rozyczko Sep 18, 2026
30bd53b
Merge branch 'master' into develop
rozyczko Sep 18, 2026
cb495ff
pixi update
rozyczko Sep 18, 2026
b126b02
updated EasyScience dep
rozyczko Sep 18, 2026
e7e3693
pre-release doc fixes
rozyczko Sep 18, 2026
c8bc2a2
correct units for scattering lengths #377 (#419)
rozyczko Sep 23, 2026
d5693c4
reparent example files properly (#420)
rozyczko Oct 2, 2026
c2dbd0b
minor fixes required for the updated GUI (#422)
rozyczko Oct 7, 2026
433bb4f
281 volume fraction (#421)
rozyczko Oct 7, 2026
db7c787
variable resolution fitting (#424)
rozyczko Oct 7, 2026
64b4f45
426 fix wrong curve (#428)
rozyczko Oct 8, 2026
2febb08
added fit configuration owner #427 (#429)
rozyczko Oct 9, 2026
94cf799
425 multiple contrasts (#432)
rozyczko Oct 12, 2026
205b5e3
added a convergence integration test. (#436)
rozyczko Oct 12, 2026
a86554a
Variable resolution fitting fixes from #425 p.3 (#437)
rozyczko Oct 12, 2026
66adaf5
updated README.md (#438)
rozyczko Oct 14, 2026
2920376
implemented fixes to the magnetism feature. #425, point 3. (#439)
rozyczko Oct 15, 2026
df09974
Merge branch 'master' into develop
rozyczko Oct 19, 2026
1ea5b20
update versioning
rozyczko Oct 19, 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
313 changes: 313 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

114 changes: 0 additions & 114 deletions CONTRIBUTING.rst

This file was deleted.

38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,41 @@
</picture>
</p>

**EasyReflectometry** is a software for performing reflectometry
calculations based on a layer model and refining its parameters against
reflectometry data.
**EasyReflectometry** is a Python library for simulating reflectometry
profiles from layered sample models and refining their parameters
against experimental data.

It supports multiple contrasts and simultaneous fitting, polarised
reflectometry channels, Bayesian (MCMC) analysis, ORSO data and model
import/export, and a choice of calculation engines (refnx or refl1d).

<!-- HOME REPOSITORY SECTION -->

**EasyReflectometry** is developed as a Python library.
**EasyReflectometry** is built on the
[EasyScience framework](https://easyscience.org) and maintained by the
[European Spallation Source (ESS)](https://ess.eu).

## Installation

**EasyReflectometry** requires Python 3.11–3.13 and is available on
PyPI:

```bash
pip install easyreflectometry
```

The `dev` extra is only needed if you want to contribute to the library
or build the documentation. It adds the tooling for testing (pytest),
linting and formatting (ruff, pre-commit), building the docs (mkdocs)
and running the tutorial notebooks. To install it from PyPI:

```bash
pip install 'easyreflectometry[dev]'
```

See the
[Installation & Setup](https://easyscience.github.io/reflectometry-lib/latest/installation-and-setup)
guide for the recommended Pixi-based setup.

License:
[BSD 3-Clause](https://github.com/easyscience/reflectometry-lib/blob/master/LICENSE)
Expand All @@ -27,7 +55,7 @@ License:
- 📖
[Documentation](https://easyscience.github.io/reflectometry-lib/latest)
- 🚀
[Getting Started](https://easyscience.github.io/reflectometry-lib/latest/introduction)
[Getting Started](https://easyscience.github.io/reflectometry-lib/latest/installation-and-setup)
- 🧪
[Tutorials](https://easyscience.github.io/reflectometry-lib/latest/tutorials)
- 💬
Expand Down
75 changes: 75 additions & 0 deletions docs/docs/api-reference/contrasts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Contrasts

A contrast is one structure measured under another SLD condition: the
same film in D2O and in H2O, or a monolayer with deuterated and
hydrogenated tails. Each contrast is an ordinary `Model`, with its own
scale, background and resolution; what the contrasts have in common is
shared in one of two ways:

- **by identity**: an assembly or material is one object used by several
models, so it has one set of parameters;
- **by equality**: a parameter of one model follows the corresponding
parameter of another, where the objects must differ (a hydrated layer
whose solvent differs between contrasts).

The `Project` offers two routes to that state. **Adding a contrast**
derives a new model from a reference with `derive_contrast`: assemblies
the substitutions do not touch are shared, touched ones are copied with
every parameter tied to the reference's except those of the replacement.

```python
from easyreflectometry.contrasts import ReplaceFormula
from easyreflectometry.contrasts import ReplaceMaterial

h2o_index = project.add_contrast(0, 'Film in H2O', [ReplaceMaterial(d2o, h2o)])
h_tails = project.add_contrast(0, 'h-tails', [ReplaceFormula(tail_layer, 'C32H64')])
project.parameter_models(film_layer.thickness) # [0, 1, 2]: one parameter of three models
```

**Linking contrasts** ties two models that exist already. Parameters
correspond by their path within the model, so the models need the same
layout: the same assemblies and layers, with materials of the same kind
(a `MaterialDensity` and a plain `Material` do not correspond);
`plan_link` raises `LayoutMismatch` otherwise. The plan changes nothing:
each `LinkRow` says what linking would do with one pair of parameters
(`'tie'`, `'skip'`, `'already_tied'`, `'conflict'`), and with the
reason. Scale and background always stay per contrast. A material's
chemistry (`CHEMISTRY`: SLD, density, scattering lengths) is
`'undecided'` until `materials='tie'` or `materials='skip'` is given,
since contrasts usually differ in it.

```python
plan = project.plan_link(follower_index, reference_index, materials='skip')
[(row.path, row.action, row.reason) for row in plan.rows]
record = project.apply_link(plan) # ties the 'tie' rows, all or none
project.unlink(record) # restores each follower's value and bounds from before the link
```

`apply_link` refuses a plan with undecided rows, or one the project has
outdated since it was made. `Project.detach` frees a shared parameter in
one model, which then gets its own copy of the assembly. The derivation
of each contrast, the links and the sharing are saved with the project.
See the
[contrasts tutorial](../tutorials/advancedfitting/contrasts.ipynb) for a
worked example.

<!-- prettier-ignore-start -->
::: easyreflectometry.contrasts
options:
members:
- CHEMISTRY
- ReplaceMaterial
- ReplaceFormula
- derive_contrast
- substitution_candidates
- UnsupportedSubstitution
- plan_link
- LinkPlan
- LinkRow
- LinkRecord
- LayoutMismatch
- follows
- tie_corresponding
- snapshot
- restore
<!-- prettier-ignore-end -->
9 changes: 9 additions & 0 deletions docs/docs/api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ parameter free and are enforced as penalties on the BUMPS fit problem.
- [Constraints](constraints.md)
- [Inequality Constraints](inequality_constraints.md)

## Contrasts

One structure measured under several SLD conditions: deriving a contrast
from a reference model, and linking the corresponding parameters of
models built separately.

- [Contrasts](contrasts.md)

## Bayesian Analysis

Posterior analysis of a DREAM sampling run: convergence diagnostics,
Expand Down Expand Up @@ -108,3 +116,4 @@ Summaries of a project and its fit results, and the plotting helpers.

- [Summary](summary.md)
- [Plotting](plot.md)
- [Volume Fraction Profile](volume_fraction.md)
1 change: 1 addition & 0 deletions docs/docs/api-reference/volume_fraction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: easyreflectometry.sample.volume_fraction
4 changes: 2 additions & 2 deletions docs/docs/installation-and-setup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ can be installed using `pip`. To do so, use the following command:
pip install easyreflectometry
```

To install a specific version of EasyReflectometry, e.g., 1.8.0:
To install a specific version of EasyReflectometry, e.g., 1.9.0:

```txt
pip install 'easyreflectometry==1.8.0'
pip install 'easyreflectometry==1.9.0'
```

To upgrade to the latest version:
Expand Down
Loading
Loading