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
194 changes: 118 additions & 76 deletions docs/architecture/architecture.md

Large diffs are not rendered by default.

22 changes: 16 additions & 6 deletions docs/architecture/issues_closed.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,19 @@ to an incompatible data class and silently discarding loaded data.

Added `SEQUENTIAL = 'sequential'` to `FitModeEnum`. `fit_sequential()`
now sets `fit_mode.mode = 'sequential'` internally so the mode is
persisted in CIF. Added `show_supported_fit_mode_types()` (filters by
experiment count: ≤1 → only `single`; >1 → all three) and
`show_current_fit_mode_type()` on `Analysis`. If `fit()` is called while
mode is `'sequential'`, it logs an error directing the user to
`fit_sequential()`. Promoted `fit_mode` from a pure single-type category
to one with show methods.
persisted in CIF. Added `show_fit_mode_types()` (filters by experiment
count: ≤1 → only `single`; >1 → all three) and `show_fit_mode_types()`
on `Analysis`. If `fit()` is called while mode is `'sequential'`, it
logs an error directing the user to `fit_sequential()`. Promoted
`fit_mode` from a pure single-type category to one with show methods.

---

## Persist Per-Experiment Calculator Selection

Calculator selection now lives in the experiment-side `calculation`
category and is persisted in experiment CIF via
`_calculation.calculator_type`. Loading restores the explicit backend
selection before dependent experiment categories are populated, so saved
projects keep the exact active calculator configuration instead of
falling back to auto-resolution.
32 changes: 6 additions & 26 deletions docs/architecture/issues_open.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ needed.

**Type:** Fragility

`joint_fit_experiments` is created once when `fit_mode` becomes
`joint_fit_experiments` is created once when `fit.mode` becomes
`'joint'`. If experiments are added, removed, or renamed afterwards, the
weight collection is stale. Joint fitting can fail with missing keys or
run with incorrect weights.
Expand Down Expand Up @@ -180,25 +180,6 @@ minimiser.

---

## 16. 🟡 Persist Per-Experiment `calculator_type`

**Type:** Completeness

The current architecture moved calculator selection to the experiment
level via `calculator_type`, but this selection is not written to CIF
during `save()` / `show_as_cif()`. Reloading or exporting a project
therefore loses explicit calculator choices and falls back to
auto-resolution.

**Fix:** serialise `calculator_type` as part of the experiment or
analysis state, and make sure `load()` restores it. The saved project
should represent the exact active calculator configuration, not just a
re-derivable default.

**Depends on:** nothing.

---

## 17. 🟢 Use PDF-Specific CIF Names for Total Scattering

**Type:** Naming
Expand Down Expand Up @@ -1191,9 +1172,9 @@ check. Options:

**Type:** API completeness

`show_supported_calculator_types()` exists per-experiment, but there is
no project/analysis-level method to list all available calculator
engines. Users exploring the API have no single entry point to see what
`show_calculator_types()` exists per-experiment, but there is no
project/analysis-level method to list all available calculator engines.
Users exploring the API have no single entry point to see what
calculators are installed.

**Depends on:** nothing.
Expand All @@ -1206,8 +1187,8 @@ calculators are installed.

The switchable-category naming convention prescribes `<category>_type`
(getter/setter) and `show_supported_<category>_types()`. But some names
deviate: e.g. `show_supported_minimizers()` instead of
`show_supported_minimizer_types()`, and `current_minimizer` instead of
deviate: e.g. `show_minimizer_types()` instead of
`show_supported_minimizer_types()`, and `minimizer_type` instead of
`minimizer_type`. Audit and align all switchable-category APIs.

**Depends on:** nothing.
Expand Down Expand Up @@ -1446,7 +1427,6 @@ operation is possible (e.g. in automated pipelines or tests).
| 13 | Suppress redundant dirty-flag sets | 🟢 Low | Performance |
| 14 | Finer-grained change tracking | 🟢 Low | Performance |
| 15 | Validate joint-fit weights | 🟡 Med | Correctness |
| 16 | Persist per-experiment `calculator_type` | 🟡 Med | Completeness |
| 17 | Use PDF-specific CIF names | 🟢 Low | Naming |
| 18 | Move CIF v2→v1 conversion out of calculator | 🟢 Low | Maintainability |
| 19 | Debug-mode logging for calculator imports | 🟢 Low | Diagnostics |
Expand Down
25 changes: 20 additions & 5 deletions docs/architecture/package-structure-full.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
│ │ │ │ └── 🏷️ class Constraints
│ │ │ └── 📄 factory.py
│ │ │ └── 🏷️ class ConstraintsFactory
│ │ ├── 📁 fit_mode
│ │ ├── 📁 fit
│ │ │ ├── 📄 __init__.py
│ │ │ ├── 📄 default.py
│ │ │ │ └── 🏷️ class Fit
│ │ │ ├── 📄 enums.py
│ │ │ │ └── 🏷️ class FitModeEnum
│ │ │ ├── 📄 factory.py
│ │ │ │ └── 🏷️ class FitModeFactory
│ │ │ └── 📄 fit_mode.py
│ │ │ └── 🏷️ class FitMode
│ │ │ └── 📄 factory.py
│ │ │ └── 🏷️ class FitFactory
│ │ ├── 📁 joint_fit_experiments
│ │ │ ├── 📄 __init__.py
│ │ │ ├── 📄 default.py
Expand Down Expand Up @@ -152,6 +152,12 @@
│ │ │ │ └── 📄 line_segment.py
│ │ │ │ ├── 🏷️ class LineSegment
│ │ │ │ └── 🏷️ class LineSegmentBackground
│ │ │ ├── 📁 calculation
│ │ │ │ ├── 📄 __init__.py
│ │ │ │ ├── 📄 default.py
│ │ │ │ │ └── 🏷️ class Calculation
│ │ │ │ └── 📄 factory.py
│ │ │ │ └── 🏷️ class CalculationFactory
│ │ │ ├── 📁 data
│ │ │ │ ├── 📄 __init__.py
│ │ │ │ ├── 📄 bragg_pd.py
Expand Down Expand Up @@ -238,6 +244,7 @@
│ │ │ │ ├── 📄 factory.py
│ │ │ │ │ └── 🏷️ class PeakFactory
│ │ │ │ ├── 📄 tof.py
│ │ │ │ │ ├── 🏷️ class TofPseudoVoigt
│ │ │ │ │ ├── 🏷️ class TofJorgensen
│ │ │ │ │ ├── 🏷️ class TofJorgensenVonDreele
│ │ │ │ │ └── 🏷️ class TofDoubleJorgensenVonDreele
Expand Down Expand Up @@ -360,6 +367,14 @@
│ ├── 📄 __init__.py
│ └── 📄 ascii.py
├── 📁 project
│ ├── 📁 categories
│ │ ├── 📁 display
│ │ │ ├── 📄 __init__.py
│ │ │ ├── 📄 default.py
│ │ │ │ └── 🏷️ class Display
│ │ │ └── 📄 factory.py
│ │ │ └── 🏷️ class DisplayFactory
│ │ └── 📄 __init__.py
│ ├── 📄 __init__.py
│ ├── 📄 project.py
│ │ └── 🏷️ class Project
Expand Down
16 changes: 13 additions & 3 deletions docs/architecture/package-structure-short.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
│ │ │ ├── 📄 __init__.py
│ │ │ ├── 📄 default.py
│ │ │ └── 📄 factory.py
│ │ ├── 📁 fit_mode
│ │ ├── 📁 fit
│ │ │ ├── 📄 __init__.py
│ │ │ ├── 📄 default.py
│ │ │ ├── 📄 enums.py
│ │ │ ├── 📄 factory.py
│ │ │ └── 📄 fit_mode.py
│ │ │ └── 📄 factory.py
│ │ ├── 📁 joint_fit_experiments
│ │ │ ├── 📄 __init__.py
│ │ │ ├── 📄 default.py
Expand Down Expand Up @@ -78,6 +78,10 @@
│ │ │ │ ├── 📄 enums.py
│ │ │ │ ├── 📄 factory.py
│ │ │ │ └── 📄 line_segment.py
│ │ │ ├── 📁 calculation
│ │ │ │ ├── 📄 __init__.py
│ │ │ │ ├── 📄 default.py
│ │ │ │ └── 📄 factory.py
│ │ │ ├── 📁 data
│ │ │ │ ├── 📄 __init__.py
│ │ │ │ ├── 📄 bragg_pd.py
Expand Down Expand Up @@ -187,6 +191,12 @@
│ ├── 📄 __init__.py
│ └── 📄 ascii.py
├── 📁 project
│ ├── 📁 categories
│ │ ├── 📁 display
│ │ │ ├── 📄 __init__.py
│ │ │ ├── 📄 default.py
│ │ │ └── 📄 factory.py
│ │ └── 📄 __init__.py
│ ├── 📄 __init__.py
│ ├── 📄 project.py
│ └── 📄 project_info.py
Expand Down
Loading
Loading