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
24 changes: 13 additions & 11 deletions docs/dev/adrs/accepted/background-auto-estimate.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,9 @@ one-line summary (§1). Empirical calibration was carried out in Phase 2:

- The Stage-2 tolerance multiplier (`c · σ`, `c = 2`) and the width
percentile (~75th) are first-cut constants; they were validated — not
exhaustively swept — against the representative CWL (`ed-2`) and TOF
(`ed-13`) datasets plus the analytic unit cases, and produce sensible
exhaustively swept — against the representative CWL
(`refine-lbco-hrpt-from-data`) and TOF (`fitting-exercise-si-lbco`)
datasets plus the analytic unit cases, and produce sensible
backgrounds there. Re-tuning stays possible if a future dataset needs
it.
- The single Stage-1 method (`arpls`) holds for both validated beam
Expand Down Expand Up @@ -485,15 +486,16 @@ line-segment points are a real-world reference: stripping them and
re-running `auto_estimate()` should reproduce a comparable background
curve. **Phase 2 outcome:** the functional regression validates two
representative datasets — CWL
[`ed-2.py`](../../../../docs/docs/tutorials/ed-2.py) and TOF
[`ed-13.py`](../../../../docs/docs/tutorials/ed-13.py) — comparing the
estimated curve against the hand-placed reference to within a fraction
of the measured signal scale; the single `arpls` default and the
first-cut constants hold for both. Sloping and curved backgrounds are
covered against exact analytic ground truth by the unit tests, not the
corpus. A broader per-tutorial sweep (e.g. `ed-17`, `ed-16`) was not
needed and stays available if a future dataset misbehaves. These checks
run at the functional / unit level.
[`refine-lbco-hrpt-from-data.py`](../../../../docs/docs/tutorials/refine-lbco-hrpt-from-data.py)
and TOF
[`fitting-exercise-si-lbco.py`](../../../../docs/docs/tutorials/fitting-exercise-si-lbco.py)
— comparing the estimated curve against the hand-placed reference to
within a fraction of the measured signal scale; the single `arpls`
default and the first-cut constants hold for both. Sloping and curved
backgrounds are covered against exact analytic ground truth by the unit
tests, not the corpus. A broader per-tutorial sweep (e.g. `ed-17`,
`ed-16`) was not needed and stays available if a future dataset
misbehaves. These checks run at the functional / unit level.

The estimator module mirrors into
`tests/unit/easydiffraction/datablocks/experiment/categories/background/`
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/adrs/accepted/project-summary-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ Summary, Software, Refinement, Structures (one subsection per phase),
Experiments (one subsection per experiment). Tables use `booktabs`
(`\toprule`/`\midrule`/`\bottomrule`) and `float`'s `[H]` placement;
math uses inline LaTeX (`$Fd\bar{3}m$`, `\AA`, `$\deg$`). Reference
example at [`tmp/latex/example.tex`](../../../../tmp/latex/example.tex).
example at `tmp/latex/example.tex`.

The `iucrjournals.cls` choice has two practical advantages over a bare
`article`:
Expand Down
18 changes: 9 additions & 9 deletions docs/dev/adrs/accepted/switchable-category-owned-selectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ single-purpose blocks aligned with the new `_<cat>.type` rule.

`_minimizer.optimizer_name` and `_minimizer.method_name` are also
**dropped**. Inspecting
[`src/easydiffraction/analysis/minimizers/lmfit_leastsq.py`](../../../src/easydiffraction/analysis/minimizers/lmfit_leastsq.py)
[`src/easydiffraction/analysis/minimizers/lmfit_leastsq.py`](../../../../src/easydiffraction/analysis/minimizers/lmfit_leastsq.py)
(and the matching `bumps_lm.py`, `dfols.py`, …) shows that `name`
defaults to the enum tag itself and `method` to a per-engine
module-level constant. The public API never overrides them at
Expand Down Expand Up @@ -370,7 +370,7 @@ class PeakBase(CategoryItem, SwitchableCategoryBase):
Categories that want to show aliases alongside canonical tags (peak)
override `show_supported()` to add a third column; the per-category
override pattern is the same as the existing
[`base.show_peak_profile_types()`](../../../src/easydiffraction/datablocks/experiment/item/base.py)
[`base.show_peak_profile_types()`](../../../../src/easydiffraction/datablocks/experiment/item/base.py)
implementation, just moved onto the category.

`type` is backed by a **real `StringDescriptor`** named `_type` that
Expand All @@ -382,12 +382,12 @@ the staleness checks.

For `CategoryItem` substrates (minimizer, peak, extinction, calculator,
chart, table, fitting_mode) the generic CIF emit/read path
[`io/cif/serialize.py:170`](../../../src/easydiffraction/io/cif/serialize.py)
[`io/cif/serialize.py:170`](../../../../src/easydiffraction/io/cif/serialize.py)
picks the descriptor up by name automatically — no custom hook is
needed. For the `CategoryCollection` substrate (background only),
[`category.py:230`](../../../src/easydiffraction/core/category.py)'s
[`category.py:230`](../../../../src/easydiffraction/core/category.py)'s
`parameters` returns only loop-item parameters and
[`io/cif/serialize.py:244`](../../../src/easydiffraction/io/cif/serialize.py)
[`io/cif/serialize.py:244`](../../../../src/easydiffraction/io/cif/serialize.py)
writes only the loop, so a collection-level `_type` descriptor needs a
small additional path: the writer emits the scalar tag above the loop,
and the reader peeks the scalar before iterating items. This is a
Expand Down Expand Up @@ -451,8 +451,8 @@ class ExperimentBase:
```

The existing owner-level `show_<cat>_types()` methods
([`bragg_pd.show_background_types()`](../../../src/easydiffraction/datablocks/experiment/item/bragg_pd.py),
[`base.show_peak_profile_types()`](../../../src/easydiffraction/datablocks/experiment/item/base.py),
([`bragg_pd.show_background_types()`](../../../../src/easydiffraction/datablocks/experiment/item/bragg_pd.py),
[`base.show_peak_profile_types()`](../../../../src/easydiffraction/datablocks/experiment/item/base.py),
`Calculation.show_calculator_types()`,
`Analysis.show_supported_minimizer_types()`, …) are **deleted**. The
mixin's `show_supported()` reproduces the same `['*', tag, description]`
Expand Down Expand Up @@ -722,7 +722,7 @@ Notes on the in-scope rows:
renamed `calculator_type` → `type`, and the CIF block changes from
`_calculation.*` to `_calculator.*`. The setter delegation pattern is
already in place today
([`calculation/default.py:61`](../../../src/easydiffraction/datablocks/experiment/categories/calculation/default.py)),
([`calculator/default.py:61`](../../../../src/easydiffraction/datablocks/experiment/categories/calculator/default.py)),
so no mechanism change is required.
- Rows 6 and 7 involve §8a's `Rendering` → `Chart` + `Table` split
(Python category restructure, CIF block split).
Expand Down Expand Up @@ -958,7 +958,7 @@ Three things change in this block:
- `_peak.profile_type` becomes `_peak.type`; the existing
`_peak.broad_gauss_*` and `_peak.broad_lorentz_*` parameter tags are
unchanged (the names come from
[`src/easydiffraction/datablocks/experiment/categories/peak/cwl_mixins.py`](../../../src/easydiffraction/datablocks/experiment/categories/peak/cwl_mixins.py)).
[`src/easydiffraction/datablocks/experiment/categories/peak/cwl_mixins.py`](../../../../src/easydiffraction/datablocks/experiment/categories/peak/cwl_mixins.py)).
The CIF value is the **canonical tag** (`cwl-pseudo-voigt` here, since
the example experiment is constant-wavelength); the writable Python
setter `experiment.peak.type` accepts the alias `'pseudo-voigt'` too
Expand Down
8 changes: 4 additions & 4 deletions docs/dev/adrs/suggestions/cif-numeric-precision.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Core model.

> This ADR follows [`AGENTS.md`](../../../../AGENTS.md). It is the
> data-side counterpart to
> [`plotting-docs-performance.md`](plotting-docs-performance.md), which
> handles **display** precision (downcasting plot arrays to float32).
> This ADR concerns the precision of numbers we **store and serialize**
> in CIF, which is a separate decision because CIF is a data
> [`plotting-docs-performance.md`](../accepted/plotting-docs-performance.md),
> which handles **display** precision (downcasting plot arrays to
> float32). This ADR concerns the precision of numbers we **store and
> serialize** in CIF, which is a separate decision because CIF is a data
> source-of-truth, not a throwaway view.

## Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ that do not inherit the guarded object hierarchy: `project.display`,
Introduced `render_object_help()` so these helpers share the same
property and method table style as `GuardedBase.help()`. Documented the
convention in
[`help-discoverability.md`](../adrs/accepted/help-discoverability.md).
[`help-discoverability.md`](../../adrs/accepted/help-discoverability.md).
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 76. Consistent `_type` Suffix in Switchable-Category API Names

Closed by
[`switchable-category-owned-selectors.md`](../adrs/accepted/switchable-category-owned-selectors.md).
[`switchable-category-owned-selectors.md`](../../adrs/accepted/switchable-category-owned-selectors.md).
The public suffix is dropped: owners expose categories, categories
expose a uniform `type` property plus `show_supported()`, and CIF uses
one `_<cat>.type` selector tag per category.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 72. Warn on All Switchable-Category Type Changes

Closed by
[`switchable-category-owned-selectors.md`](../adrs/accepted/switchable-category-owned-selectors.md).
[`switchable-category-owned-selectors.md`](../../adrs/accepted/switchable-category-owned-selectors.md).
Type-change warnings now run through owner `_swap_<name>` hooks, so
every category-owned selector assignment has a uniform owner-mediated
place to warn about values that will be discarded.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

**TODOs:**

- [logging.py](src/easydiffraction/utils/logging.py#L430)
- [logging.py](../../../../src/easydiffraction/utils/logging.py#L430)

**Depends on:** nothing.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ non-supporting backends raise a clear `NotImplementedError`.

**TODOs / locations:**

- [base.py](src/easydiffraction/analysis/calculators/base.py#L49)
- [cryspy.py](src/easydiffraction/analysis/calculators/cryspy.py#L127)
- [crysfml.py](src/easydiffraction/analysis/calculators/crysfml.py#L112)
- [pdffit.py](src/easydiffraction/analysis/calculators/pdffit.py#L70)
- [bragg_sc.py](src/easydiffraction/datablocks/experiment/categories/refln/bragg_sc.py#L400)
- [base.py](../../../../src/easydiffraction/analysis/calculators/base.py#L49)
- [cryspy.py](../../../../src/easydiffraction/analysis/calculators/cryspy.py#L127)
- [crysfml.py](../../../../src/easydiffraction/analysis/calculators/crysfml.py#L112)
- [pdffit.py](../../../../src/easydiffraction/analysis/calculators/pdffit.py#L70)
- [bragg_sc.py](../../../../src/easydiffraction/datablocks/experiment/categories/refln/bragg_sc.py#L400)

**Depends on:** related to issue 63 (the sibling `calculate_pattern`
signature question).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ non-positive values at the boundary.

**TODOs / locations:**

- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L648)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L673)
- [total_pd.py](src/easydiffraction/datablocks/experiment/categories/data/total_pd.py#L324)
- [bragg_sc.py](src/easydiffraction/datablocks/experiment/categories/refln/bragg_sc.py#L466)
- [fitting.py](src/easydiffraction/analysis/fitting.py#L449)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L648)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L673)
- [total_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/total_pd.py#L324)
- [bragg_sc.py](../../../../src/easydiffraction/datablocks/experiment/categories/refln/bragg_sc.py#L466)
- [fitting.py](../../../../src/easydiffraction/analysis/fitting.py#L449)

**Depends on:** supersedes the narrower issue 27 (Bragg PD zero
uncertainty). Related to issue 15 (joint-fit weights).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ code is the concrete pre-ADR behaviour it would correct.

**TODOs / locations:**

- [base.py](src/easydiffraction/datablocks/experiment/item/base.py#L687)
- [base.py](../../../../src/easydiffraction/datablocks/experiment/item/base.py#L687)
— `_replace_peak_profile` `strict=False` path
- [base.py](src/easydiffraction/datablocks/experiment/item/base.py#L350)
- [base.py](../../../../src/easydiffraction/datablocks/experiment/item/base.py#L350)
— `_swap_calculator`
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L206)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L206)
— background swap

**Depends on:** the Edi persistence ADR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ non-numeric rows in the existing mirror.

**TODOs / locations:**

- [verification.py](src/easydiffraction/analysis/verification.py) (tests
in `tests/unit/easydiffraction/analysis/test_verification.py`)
- [verification.py](../../../../src/easydiffraction/analysis/verification.py)
(tests in `tests/unit/easydiffraction/analysis/test_verification.py`)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ step.

**TODOs:**

- [parse.py](src/easydiffraction/io/cif/parse.py#L29)
- [parse.py](../../../../src/easydiffraction/io/cif/parse.py#L29)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ under a debug level.

**TODOs:**

- [pdffit.py](src/easydiffraction/analysis/calculators/pdffit.py#L34)
- [pdffit.py](src/easydiffraction/analysis/calculators/pdffit.py#L37)
- [crysfml.py](src/easydiffraction/analysis/calculators/crysfml.py#L19)
- [crysfml.py](src/easydiffraction/analysis/calculators/crysfml.py#L23)
- [cryspy.py](src/easydiffraction/analysis/calculators/cryspy.py#L25)
- [cryspy.py](src/easydiffraction/analysis/calculators/cryspy.py#L28)
- [pdffit.py](../../../../src/easydiffraction/analysis/calculators/pdffit.py#L34)
- [pdffit.py](../../../../src/easydiffraction/analysis/calculators/pdffit.py#L37)
- [crysfml.py](../../../../src/easydiffraction/analysis/calculators/crysfml.py#L19)
- [crysfml.py](../../../../src/easydiffraction/analysis/calculators/crysfml.py#L23)
- [cryspy.py](../../../../src/easydiffraction/analysis/calculators/cryspy.py#L25)
- [cryspy.py](../../../../src/easydiffraction/analysis/calculators/cryspy.py#L28)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ categories.

**TODOs:**

- [default.py](src/easydiffraction/datablocks/experiment/categories/excluded_regions/default.py#L33)
- [default.py](../../../../src/easydiffraction/datablocks/experiment/categories/excluded_regions/default.py#L33)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public API to "unset" a project path.

**TODOs / locations:**

- [\_\_main\_\_.py](src/easydiffraction/__main__.py#L266)
- [\_\_main\_\_.py](../../../../src/easydiffraction/__main__.py#L266)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ whether the same pattern can be reused for other enums.

**TODOs:**

- [enums.py](src/easydiffraction/datablocks/experiment/item/enums.py#L153)
- [enums.py](src/easydiffraction/datablocks/experiment/item/enums.py#L157)
- [enums.py](src/easydiffraction/datablocks/experiment/item/enums.py#L158)
- [enums.py](../../../../src/easydiffraction/datablocks/experiment/item/enums.py#L153)
- [enums.py](../../../../src/easydiffraction/datablocks/experiment/item/enums.py#L157)
- [enums.py](../../../../src/easydiffraction/datablocks/experiment/item/enums.py#L158)

**Depends on:** related to issue 9.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ generation.

**TODOs:**

- [default.py](src/easydiffraction/datablocks/structure/categories/space_group/default.py#L52)
- [default.py](../../../../src/easydiffraction/datablocks/structure/categories/space_group/default.py#L52)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ single crystal and a `TODO: Check this mapping!` marker.

**TODOs:**

- [cryspy.py](src/easydiffraction/analysis/calculators/cryspy.py#L506)
- [cryspy.py](../../../../src/easydiffraction/analysis/calculators/cryspy.py#L506)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ a TODO questioning whether this path is exercised.

**TODOs:**

- [variable.py](src/easydiffraction/core/variable.py#L154)
- [variable.py](../../../../src/easydiffraction/core/variable.py#L154)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

**TODOs:**

- [bragg_pd.py](src/easydiffraction/datablocks/experiment/item/bragg_pd.py#L112)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/item/bragg_pd.py#L112)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

**TODOs:**

- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L482)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L304)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L482)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L304)

**Depends on:** nothing.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

**TODOs:**

- [default.py](src/easydiffraction/datablocks/structure/categories/cell/default.py#L146)
- [default.py](../../../../src/easydiffraction/datablocks/structure/categories/cell/default.py#L146)

**Depends on:** related to issue 11.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ dtype is needed and align with `DataTypes`.

**TODOs:**

- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L415)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L423)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L431)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L456)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L466)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L474)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L543)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L556)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L624)
- [bragg_pd.py](src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L637)
- [total_pd.py](src/easydiffraction/datablocks/experiment/categories/data/total_pd.py#L370)
- [total_pd.py](src/easydiffraction/datablocks/experiment/categories/data/total_pd.py#L378)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L415)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L423)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L431)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L456)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L466)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L474)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L543)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L556)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L624)
- [bragg_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/bragg_pd.py#L637)
- [total_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/total_pd.py#L370)
- [total_pd.py](../../../../src/easydiffraction/datablocks/experiment/categories/data/total_pd.py#L378)

**Depends on:** nothing.
10 changes: 5 additions & 5 deletions docs/dev/issues/open/low_clean-up-cif-deserialisation-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ stripping, find a better way to set `_item_type` on

**TODOs:**

- [serialize.py](src/easydiffraction/io/cif/serialize.py#L454)
- [serialize.py](src/easydiffraction/io/cif/serialize.py#L562)
- [serialize.py](src/easydiffraction/io/cif/serialize.py#L617)
- [serialize.py](src/easydiffraction/io/cif/serialize.py#L619)
- [serialize.py](src/easydiffraction/io/cif/serialize.py#L656)
- [serialize.py](../../../../src/easydiffraction/io/cif/serialize.py#L454)
- [serialize.py](../../../../src/easydiffraction/io/cif/serialize.py#L562)
- [serialize.py](../../../../src/easydiffraction/io/cif/serialize.py#L617)
- [serialize.py](../../../../src/easydiffraction/io/cif/serialize.py#L619)
- [serialize.py](../../../../src/easydiffraction/io/cif/serialize.py#L656)

**Depends on:** nothing.
Loading
Loading