Skip to content

Commit c0ae81f

Browse files
Save projects in the new Edi format with simpler data downloads (#203)
* Restructure issue tracker into per-issue files with index Split open.md/closed.md into one Markdown file per issue under issues/open/ (named <priority>_<title>.md) and issues/closed/ (<title>.md). Re-tier priorities across the five [priority] labels, generate issues/index.md (open ordered by priority + closed tables), move per-issue rationale into the issue files, and repoint references that pointed at the removed open.md/closed.md. * Close nine issues resolved or invalidated in current code Re-verified all open issues against the codebase and moved nine to closed/: #3 (joint-fit weight rebuild via _prepare_joint_fit), #16 (serial benchmarks), #24 (CrysFML default fallbacks removed), #43 (summary module relocated), #56 (terminal-derived ASCII width), #58 (project_info_to_cif moved), #84 (None serialised as CIF '?'), #105 (fit-result reset helper now has a caller), and #137 (re-verified as a false positive — fit() already auto-saves). Regenerated index.md. * Mark recently shipped features done in the roadmap Add the anisotropic beta-tensor ADP row and flip Uiso/Bani/Uani to done (shipped via beta-tensor support), add one-call automatic background estimation, and mark the basic March-Dollase preferred-orientation model implemented in the library. * Add edstar-project-persistence ADR suggestion * Add edstar-project-persistence implementation plan * Accept EdSTAR project persistence ADR * Add explicit persistence names to handlers * Add EdSTAR persistence inventory audit * Save and load EdSTAR project files * Rename project info facade to metadata * Persist software provenance as role rows * Rename structure row identities to id * Rename experiment structure link categories * Rename experiment EdSTAR fields * Rename analysis parameter reference fields * Document EdSTAR parameter keys * Keep report CIF separate from EdSTAR persistence * Reach EdSTAR Phase 1 review gate * Write remaining EdSTAR tags * Validate current EdSTAR background tags * Use project metadata in tutorial * Align parameter docs with EdSTAR keys * Remove stale CIF parameter pages * Refresh workflow EdSTAR examples * Simplify legacy timestamp restore * Update EdSTAR Phase 1 status * Remove dead EdSTAR ADP helpers * Rename space-group coordinate-system parameter * Record coordinate-system rename decision * Keep EdSTAR ADP serialization type-neutral Give the isotropic and anisotropic ADP CIF handlers a stable project_name (_atom_site.adp_iso, _atom_site_aniso.adp_NN) so EdSTAR persistence uses the type-neutral tag for every row regardless of the atom's adp_type. Without it, a structure mixing Biso/Uiso (or Bani/Uani) atoms reordered per-row CIF names and crashed serialization with a false "CIF tag mismatch in loop column" error, so such projects could not be saved. Derive the report ADP column label from the owning atom's adp_type instead of the reordered CIF name, so the strict B/U report label is correct for the type-neutral default direction too. * Test EdSTAR project persistence Update the unit suite for the EdSTAR persistence renames: type-neutral ADP tags, project metadata (info -> metadata), .edstar persistence files and schema marker, role-keyed analysis software, renamed structure/experiment/analysis fields, and the linked_structure(s) and metadata module moves. Mirror the moved source modules with renamed test files and add coverage for the new EdSTAR serializer behaviour. * Test EdSTAR serializer schema markers * Fix EdSTAR verification lint findings Resolve pydoclint/ruff findings surfaced by pixi run check on the EdSTAR code: add explicit utf-8 encoding to EdSTAR read_text calls, keep the new docstrings within the 72-char doc-line limit, drop the delegated-only Raises section on edstar_body_from_text (DOC502), and escape the literal dots in pytest match= patterns (RUF043). * Apply EdSTAR verification formatting Apply pixi run fix formatting to the branch: rewrap docstrings and Markdown authored during Phase 1, normalise EdSTAR source modules, and regenerate docs/dev/package-structure/full.md and short.md to reflect the renamed and added modules. * Translate EdSTAR CIF tags for cryspy and pdffit backends The cryspy and pdffit calculators feed structure.as_cif to their external engines, but EdSTAR persistence renamed the CIF tags those engines require (_atom_site.label -> .id, _space_group.name_H-M_alt -> .name_h_m, IT_coordinate_system_code -> coord_system_code, and the type-neutral _atom_site.adp_iso). Without the legacy spellings cryspy fails to build a crystal block (KeyError: 'crystal_<name>') and diffpy returns no structure, breaking all cryspy and pdffit fitting. Map the renamed tags back to the legacy IUCr spellings each engine recognizes when generating the engine CIF, choosing the active B/U displacement tag from the atom's adp_type. Add unit coverage for both translation helpers. * Migrate integration tests to EdSTAR API Update the integration suite for the EdSTAR renames: atom-site/aniso label -> id, experiment type -> experiment_type, linked_crystal/ linked_phases -> linked_structure(s) with structure_id, background x/y -> position/intensity, space-group coord_system_code, role-keyed analysis.software, project.info -> metadata, .edstar persistence files, and the type-neutral ADP CIF tags. * Migrate verification pages to EdSTAR API Update the verification scripts and regenerated notebooks for the atom-site row-identity rename (label -> id); the linked-structure and other EdSTAR field renames were already applied. Verification pages now build structures with the current public API. * Load tutorial projects from bundled fixtures Temporarily point the load/resume tutorials (ed-18, ed-23, ed-24, ed-26) at new-format EdSTAR project directories bundled under docs/docs/tutorials/projects/ instead of downloading the old beta archives, which predate the EdSTAR persistence format. ed-26 re-saves to a working directory before resuming so the bundled copy stays read-only. Revert to download_data once the regenerated archives are published to the EasyDiffraction data repository. * Keep bundled tutorial projects read-only on run Re-home ed-18 to a working directory before fitting, and copy ed-23's scan project (with its data files and results.csv) to a writable working directory before resuming, so running the tutorials no longer writes back into the bundled docs/docs/tutorials/projects/ fixtures. * Adjust table cell line height and padding for improved readability * Group parameter reference pages by owner block * Align parameter reference descriptions with source metadata * Point tutorials at published project archives * Link displayed parameters to reference docs * Refactor parameter tables for improved readability and consistency across documentation * Split parameter-name display into uid, edstar, and cif Replace project.display.parameters.cif_uids() with three focused views: uid() shows the constraint unique identifier (the former behaviour), edstar() shows the EdSTAR persistence tag, and cif() shows the report CIF tag. EdSTAR is a distinct format from CIF, so the three naming surfaces are now shown separately with their own column titles. * Normalize mixed B/U ADPs for the pdffit backend The pdffit conversion previously chose a single B/U family for the whole structure and relabeled tags without converting values, so a structure mixing Biso/Uiso (or Bani/Uani) atoms fed diffpy the minority family's values under the wrong convention. Normalize every B-family ADP value to U (value / 8π²) before writing the U tags, and restore the live structure afterwards. Add coverage for the mixed isotropic case. * Guard parameter docs route map against drift The owner-grouped parameter-reference routing (parameters/<owner>/ <category>) is already resolved via _PARAMETER_DOCS_BLOCKS. Drop the redundant 'excluded_regions' block entry (the plural category code is already remapped to the singular 'excluded_region' page), and add a test asserting the block map mirrors the docs tree exactly so runtime parameter URLs cannot drift from the reference pages again. * Finish parameter-display rename in remaining tests Update the coverage and project-display tests that still called the removed parameter_cif_uids()/cif_uids() to the split uid()/edstar()/ cif() surface, including the delegate-name expectations and the constraint-table paragraph text. * Wrap long ADR documentation-url example line * Reflow pdffit ADP-normalization docstring * Regenerate package structure for EdSTAR verification * Mark Phase 1 review and Phase 2 verification complete * Rename EdSTAR persistence format to EasyDiff Rename the EasyDiffraction project persistence format and its on-disk identity from "EdSTAR" to "EasyDiff": the io.easydiff module, the section_to_easydiff/easydiff_body_from_text helpers, the `_easydiff.schema_*` markers, the `.easydiff` section-file extension, and the save/load/zip-detection/diagnostics paths. STAR is a generic syntax layer, so the application format is named for EasyDiffraction rather than for STAR, and strict report CIF stays separate. * Rename EdSTAR to EasyDiff in tests Update the unit/integration tests for the EasyDiff rename: io.easydiff serializer test module, `.easydiff` extensions and `_easydiff.*` schema markers, and the easydiff()/parameter_easydiff_tags display surface. * Rename EdSTAR to EasyDiff in documentation Update ADRs, the implementation plan, user-guide prose, CLI and quick-reference pages, and the regenerated package-structure docs to describe the project persistence format as EasyDiff (`.easydiff` section files) rather than EdSTAR, and shorten the custom report-CIF label to `easydiffCIF`. The `edstar-project-persistence` ADR/plan slug is kept as the stable feature identifier. * Convert bundled tutorial project fixtures to EasyDiff Rename the bundled ed-18/23/24/26 project section files from `.edstar` to `.easydiff` with the updated `_easydiff.*` schema markers. These serve as the source for the published project archives the load tutorials download. * Point load tutorials at published EasyDiff archives Bump the pinned data-index ref/hash to the data-repo commit that adds the EasyDiff-format project archives, and repoint the load/resume tutorials (ed-18/23/24/26) at the new dataset ids 44-47 so they download projects the current library can open. * Fix stale ADR links in open issues Point the two open-issue references at the accepted ADR location (../../adrs/accepted/edstar-project-persistence.md) instead of the pre-promotion suggestions path, which also resolved with the wrong relative depth from docs/dev/issues/open/. * Mark Phase 2 review complete * Accept data-source-pinning and resource-naming ADRs * Pin downloadable data by a packaged commit ref * Switch downloadable resources to slug ids * Detect project archives by namespace, not kind field * Pin data to reorganized slug-layout snapshot * Rename tutorials to slug ids and update data calls * Update integration tests and docs to slug data ids * Update unit tests for slug download API * Fix lint and formatting for slug download API * Validate cached project ZIP before extraction * Update user docs to slug download API * Order tutorial listings by learning order * Fix lint and formatting for review fixes * Rename easydiff persistence format to edifa * Rename easydiff to edifa in tests * Rename easydiff to edifa in documentation * Pin data to .edifa snapshot * Apply formatting after edifa rename * Switch dataset names to dash-prefixed categories * Pin data to dash-prefixed index snapshot * Update tests for dash-prefixed dataset names * Update tutorials and docs for dash-prefixed dataset names * Update naming ADRs for dash-prefixed dataset names * Apply formatting after dash-prefix rename * Stack tutorial listing into one cell with full version * Read tutorial baseline projects from .edifa files * Point tutorial index links at slug notebooks * Format review-fix files * Save tutorial projects under slug-derived names * Clean slug-named tutorial outputs, keep proj- archives * Update saved-project test fixtures to project.edifa * Update functional tests for atom-site id rename * Update user docs to atom-site and alias id API * Move NCAF WISH tutorial to Multiple Data Blocks * Fix tutorial-baseline reader tags and refresh baseline * Cover sequential tutorials excluded from scalar baseline * Add benchmark results for various tutorials * Rename block display method to show_as_text * Update docs and tutorials to show_as_text * Drop redundant exp_ prefix from TOF peak parameters * Default correlation matrix to 5 parameters * Tighten line spacing of rendered Rich tables * Add clean page titles so header icons render * Fix experiment-type tags on extra peak keys * Tag linked_structure for single-crystal experiments * Complete code and edifaCIF rows for extra peak keys * Rename edi persistence format and simplify schema marker * Rename edi format in tests and tools * Rename edi format and alias across documentation * Switch import alias to edi in tests * Add edi pronunciation note and finalize docs * Switch CLI module import alias to edi * Pin downloadable data to edi-format snapshot * Update saved-marker assertion to version-only edi * Re-pin data to edi experiment snapshot * Reject legacy .edifa section files on project load * Drop schema_name from project layout doc sample * Fix tutorial-output task comment to analysis.edi * Cover legacy project.edifa rejection on load * Remove unreleased .edifa legacy load handling * Complete code and coreCIF rows for instrument calib keys * Complete code and CIF source rows for all parameters * Replace CifHandler with TagSpec edi_names/cif_names * Document TagSpec model and broad_ export names * Drop unreleased exp_ read aliases from TOF peak keys * Update handler inventory tool to TagSpec schema * Add TagSpec read-name contract tests * Point ADR doc-URL refs at TagSpec.edi_name * Fix TOF rise/decay doc anchors to canonical edi names * Increase maximum width of content area for better readability * Unify table row spacing across notebook and docs site Move the table cell spacing into shared TABLE_CELL_* constants in the tabler base module so the pandas (<table>) and Rich (<pre>) backends apply the same compact values inline, and the JupyterLab notebook and the built docs site render the same way. Collapse the Rich _to_html transform to a single replace that merges the spacing into Rich's own <pre> style attribute, preserving the emitted font-family instead of dropping it via a duplicate attribute. Add one scoped site rule so MkDocs-Material honours the inline spacing on rendered HTML output tables, which its default table typography (line-height 2.35 on .md-typeset cells) otherwise inflates. Markdown prose tables and code-input cells are left unchanged. * Add tutorial format flags and cap listing table width Cap the `list-tutorials` table at 100 columns: it shrinks to fit narrower terminals and stops widening past 100 on very wide ones. Let `download-tutorial` choose the file format with composable flags: no flag downloads the notebook (.ipynb), `--py` the plain-Python script, and passing both downloads both. The Python API gains a `file_format` argument validated against a new TutorialFormat enum. The notebook is published nested (tutorials/<name>/<name>.ipynb) while the script is a flat static copy (tutorials/<name>.py), so the script URL is derived from the notebook URL accordingly. * Fix list-table width test breaking pytest reporting The width test replaced the global shutil.get_terminal_size with a no-argument lambda, so pytest's own get_terminal_size(fallback=...) call during progress reporting raised TypeError and aborted the run with an INTERNALERROR. Extract a _list_table_width() helper and test it directly with a signature-compatible stub, so the cap logic is verified without disturbing pytest's terminal-size lookups. * Reformat absorption parameter page to the new template Port the merged absorption page to the project's current parameter-page format: front-matter title, material-icon headings with stable anchors, and per-parameter Access/Source tables (code / Edi / coreCIF), matching the sibling extinction page.
1 parent 6ed1c61 commit c0ae81f

599 files changed

Lines changed: 31808 additions & 9810 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/dev/adrs/accepted/analysis-cif-fit-state.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Persist these common categories for any saved fit projection:
6161
`_fit_parameter` stores analysis-owned per-parameter fit controls and
6262
pre-fit scalar snapshots:
6363

64-
- `param_unique_name`
64+
- `parameter_unique_name`
6565
- `fit_min`
6666
- `fit_max`
6767
- `start_value`
@@ -70,7 +70,7 @@ pre-fit scalar snapshots:
7070
When any row has uncertainty-derived bounds, `_fit_parameter` also
7171
stores the provenance field:
7272

73-
- `fit_bounds_uncertainty_multiplier`
73+
- `bounds_uncertainty_multiplier`
7474

7575
For Bayesian fit projections, `_fit_parameter` also stores per-parameter
7676
posterior summaries:

‎docs/dev/adrs/accepted/category-owner-sections.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ Accepted and implemented.
88

99
2026-05-17
1010

11+
## Amendment
12+
13+
[`edstar-project-persistence.md`](edstar-project-persistence.md) updates
14+
the default project file format from CIF files to Edi files. This ADR's
15+
ownership split still applies: real structure/experiment datablocks
16+
remain distinct from singleton category-owner sections.
17+
1118
## Context
1219

1320
The library has two different kinds of objects that expose CIF-like
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# ADR: Data Download Source Pinning
2+
3+
**Status:** Accepted **Date:** 2026-06-14
4+
5+
> This ADR follows [`AGENTS.md`](../../../../AGENTS.md). No deliberate
6+
> exception to those instructions is taken.
7+
8+
## Group
9+
10+
Documentation.
11+
12+
> Placed with the documentation/tutorial-infrastructure decisions
13+
> (notebook generation, versioned docs) because the downloaded payload
14+
> is primarily example, tutorial, and project-archive data. The
15+
> mechanism is reused by the public `download_data()` API.
16+
17+
> Sibling of [`resource-naming.md`](resource-naming.md): this ADR pins
18+
> _which snapshot_ of the data repository to fetch and decides
19+
> replace-in-place under stable identifiers; that ADR decides what those
20+
> identifiers _are_ (the dash-prefixed `<category>-<slug>` scheme that
21+
> replaces the integer ids).
22+
23+
## Context
24+
25+
EasyDiffraction does not ship its example/tutorial datasets inside the
26+
wheel — they are large (measured patterns, project archives) — so the
27+
library downloads them on demand from the `easyscience/diffraction`
28+
repository via `pooch`. The library therefore has to record **which
29+
snapshot of that repository to fetch**.
30+
31+
Today `src/easydiffraction/utils/utils.py` records this with **two**
32+
hand-edited constants:
33+
34+
- `_DATA_INDEX_REF` — a full commit SHA, used to build the raw
35+
`raw.githubusercontent.com/easyscience/diffraction/<ref>/data/...`
36+
URLs (`_build_data_url`).
37+
- `_DATA_INDEX_HASH` — a `sha256:` checksum of `data/index.json`, passed
38+
to `pooch.retrieve` as `known_hash` (`_fetch_data_index`).
39+
40+
Each downloadable archive additionally carries its own content checksum
41+
inside `index.json` — stored today in the existing **`hash`** field as a
42+
`sha256:...` string (`record.get('hash')`, passed to `pooch` as
43+
`known_hash`) — so per-archive integrity is already data-driven and is
44+
**not** part of this decision. Throughout this ADR, "the dataset
45+
`sha256`" means the value of that existing `hash` field; this ADR does
46+
**not** rename the data-index schema or introduce a new `sha256` key, so
47+
no data-repository migration follows from it.
48+
49+
Problems with the current arrangement:
50+
51+
- **Two coupled values.** Every data change requires editing both the
52+
commit and the index checksum, in source, plus a release.
53+
- **Opaque and in code.** The pin is a bare SHA embedded in logic.
54+
- **Cache staleness coupling.** `_fetch_data_index` caches the index
55+
under the fixed filename `data-index.json`. The checksum is what makes
56+
`pooch` notice the index changed and re-download it; without it, a
57+
changed commit would silently reuse the stale cached index.
58+
59+
Constraints established for this decision:
60+
61+
- The data repository is **multi-purpose** (data, project metadata, and
62+
later umbrella site content), so it must not be tagged or
63+
directory-versioned for data reasons alone.
64+
- **No new repositories** (the project already has `diffraction`,
65+
`diffraction-lib`, `diffraction-app`) and **no git submodules**.
66+
- The data is **not small** — it stays a runtime download, not a
67+
packaged or submodule-checked-out payload.
68+
- Which data a build uses should **track the library version** and be
69+
**reproducible** for any released version.
70+
- There must be a way to **test new or updated data during
71+
development**.
72+
73+
## Decision
74+
75+
1. **Pin by a single git commit.** The data source is identified by one
76+
value: a full commit SHA of `easyscience/diffraction`. A full SHA is
77+
content-addressed, so it fixes the exact bytes of `index.json` and
78+
every archive at that snapshot, over HTTPS. This is purpose-neutral:
79+
it pins "the repository as it was at this commit" regardless of why
80+
the repository changed.
81+
82+
2. **Store the commit in a packaged, non-code file.** The commit lives
83+
in `src/easydiffraction/_data_index_ref.txt` (one line: the SHA),
84+
read at runtime via `importlib.resources`. It is edited by hand, like
85+
the current constant, but it is data rather than logic, and because
86+
it sits under the package directory it is included in the wheel and
87+
readable for both source checkouts and installed users.
88+
89+
`pyproject.toml` is explicitly **not** used to hold this value:
90+
`pyproject.toml` is a build-time file that is not shipped in the
91+
wheel, and custom `[tool.*]` tables are not exposed through
92+
`importlib.metadata`, so an installed package could not read it at
93+
runtime.
94+
95+
3. **Drop `_DATA_INDEX_HASH`.** With the commit pinning the index bytes
96+
and per-archive checksums verifying downloads, the separate index
97+
checksum is redundant. `pooch.retrieve` for the index uses
98+
`known_hash=None`.
99+
100+
4. **Derive the cached index filename from the commit.** The index is
101+
cached as `data-index-<commit>.json` instead of `data-index.json`.
102+
Changing the commit therefore changes the cache filename, so the new
103+
index is downloaded fresh; old indices remain cached under their own
104+
names (harmless, and useful offline). This replaces the checksum as
105+
the cache-busting mechanism while keeping a single source of truth.
106+
107+
5. **Update data by replacing files in place.** Datasets keep stable
108+
paths/identifiers (their form — the dash-prefixed `<category>-<slug>`
109+
scheme — is fixed by the sibling
110+
[`resource-naming.md`](resource-naming.md)); updating a dataset
111+
overwrites the existing file and refreshes its `sha256` in
112+
`index.json`. Git history records the replacement and the pinned
113+
commit selects the snapshot. No new dataset ids are minted for what
114+
is conceptually the same dataset.
115+
116+
6. **Version tracking and reproducibility come from the release.** The
117+
committed `_data_index_ref.txt` is part of the library source, so it
118+
is frozen into every release artifact. A released library version
119+
therefore always resolves to the same data snapshot, and the data a
120+
build uses tracks the library version without any cross-repository
121+
tagging.
122+
123+
7. **Invalidate local payloads by content, including extractions.**
124+
Because datasets are replaced in place under stable identifiers
125+
(Decision 5), the local cache must not return stale bytes after a ref
126+
bump. Both the downloaded archive/file **and** any project ZIP
127+
extraction directory are keyed by that dataset's `sha256` from the
128+
index — the value of the existing `hash` field per the §Context note,
129+
not a renamed schema key (for example the cached filename and the
130+
extraction directory carry a short content hash). A dataset whose
131+
bytes changed therefore resolves to a new local path and is
132+
re-fetched/re-extracted, while unchanged datasets are reused — so
133+
only what actually changed is re-downloaded, and an existing stale
134+
file or extracted directory is never served. Equivalently, an
135+
existing payload may be verified against the current index `sha256`
136+
before reuse; either way the rule covers extraction directories, not
137+
only direct downloads. (The index itself is keyed by the commit per
138+
Decision 4, so it always refreshes on a ref bump.)
139+
140+
8. **Validate the pinned ref before use.** On read, the contents of
141+
`_data_index_ref.txt` are stripped of surrounding whitespace and must
142+
be a full 40-character hexadecimal commit SHA. Any other value —
143+
empty, a branch name, a short SHA, or path-like text — raises a clear
144+
error before any URL or cache filename is built. This turns the "must
145+
be a full commit SHA" requirement into an enforced contract, so a
146+
malformed edit fails fast instead of silently breaking
147+
reproducibility or the cache-busting invariant.
148+
149+
## Consequences
150+
151+
- The data pin is a **single, non-code value** that is edited the same
152+
way as today (paste a commit), minus the checksum.
153+
- Integrity is preserved: full-commit content addressing over HTTPS for
154+
the index, plus per-archive `sha256` for every download.
155+
- Cache invalidation is automatic and tied to the one value: the index
156+
by commit, and each archive/extraction by its `sha256` (Decisions 4
157+
and 7). A ref bump re-fetches only the datasets whose bytes changed,
158+
and never returns a stale file or extracted project directory.
159+
- Reproducibility is preserved per released version, including repeated
160+
use on a machine that already has older local copies; the data pin is
161+
agnostic to non-data changes in the multi-purpose repository.
162+
- The pinned value **must be a full commit SHA**, not a branch name: the
163+
cache-busting filename trick only works for immutable refs (a moving
164+
branch keeps the same `index.json` content address in its name). This
165+
is enforced at read time (Decision 8), so a bad edit fails fast.
166+
- Retaining content-keyed local copies of superseded datasets uses some
167+
extra disk in the cache; this is accepted (and prunable) in exchange
168+
for never serving stale bytes.
169+
- Dropping the index checksum slightly reduces index-level
170+
defense-in-depth; this is accepted because the commit already fixes
171+
the bytes and transport is HTTPS.
172+
173+
## Alternatives Considered
174+
175+
- **Keep both constants in code.** Status quo; rejected for the
176+
two-value coupling, opacity, and cache coupling above.
177+
- **Version the data with git tags** (`data-vN` or per-release tags).
178+
Rejected: the repository is multi-purpose, so data-driven tags pollute
179+
its tag namespace and conflate data with site/metadata changes.
180+
- **Append-only versioned directories** (`data/v3/...`). Rejected: it
181+
conflicts with the preferred replace-in-place workflow and grows the
182+
repository indefinitely.
183+
- **Git submodule of the data repository.** Rejected: no submodules, and
184+
the data is too large to check out or ship with the library.
185+
- **Hold the value in `pyproject.toml`.** Rejected: not present in the
186+
installed wheel and not exposed via `importlib.metadata`, so it is not
187+
runtime-readable for installed users (see Decision 2).
188+
- **Track a moving branch (e.g. `master`) for releases.** Rejected:
189+
releases would retroactively see new data and lose reproducibility;
190+
also defeats the filename cache-busting.
191+
192+
## Deferred Work
193+
194+
- **Development data channel and override.** A future change may let
195+
unreleased/dev builds resolve a live channel automatically and/or
196+
honor an `EASYDIFFRACTION_DATA_REF` environment variable to point a
197+
build at a branch or commit for testing data before it is finalized.
198+
This ADR only fixes the released-build pin; the dev workflow today is
199+
to set the commit (or the override, once added) to the data snapshot
200+
under test.
201+
- **Automated bump.** Optionally, release CI could write the current
202+
data commit into `_data_index_ref.txt` so the value is never
203+
hand-edited. Out of scope here; manual editing remains the baseline.
204+
- **Dedicated data home.** If the umbrella repository grows, moving the
205+
data to its own released artifact could fully decouple its lifecycle.
206+
Out of scope: the project does not want additional repositories now.

‎docs/dev/adrs/accepted/display-ux.md‎

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ project.display.parameters.free()
7373
project.display.parameters.fittable()
7474
project.display.parameters.all()
7575
project.display.parameters.access()
76-
project.display.parameters.cif_uids()
76+
project.display.parameters.uid()
77+
project.display.parameters.edi()
78+
project.display.parameters.cif()
7779

7880
project.display.fit.results()
7981
project.display.fit.correlations()
@@ -88,22 +90,26 @@ project.display.posterior.predictive(expt_name='hrpt')
8890
current responsibilities move to clearer homes, while the implementation
8991
may keep the existing helpers as internal delegation targets:
9092

91-
| Current method | New home |
92-
| ---------------------------- | -------------------------------------------------------------- |
93-
| `all_params()` | `project.display.parameters.all()` |
94-
| `fittable_params()` | `project.display.parameters.fittable()` |
95-
| `free_params()` | `project.display.parameters.free()` |
96-
| `how_to_access_parameters()` | `project.display.parameters.access()` |
97-
| `parameter_cif_uids()` | `project.display.parameters.cif_uids()` |
98-
| `fit_results()` | `project.display.fit.results()` |
99-
| `constraints()` | `project.analysis.constraints.show()` |
100-
| `as_cif()` | `project.analysis.as_cif` and `project.analysis.show_as_cif()` |
101-
102-
`project.analysis` and `project.info` follow the same CIF display
103-
pattern as structures and experiments:
104-
105-
- `as_cif` is a read-only property returning CIF text as a string.
106-
- `show_as_cif()` pretty-prints the CIF text with a header.
93+
| Current method | New home |
94+
| ---------------------------- | --------------------------------------------------------------- |
95+
| `all_params()` | `project.display.parameters.all()` |
96+
| `fittable_params()` | `project.display.parameters.fittable()` |
97+
| `free_params()` | `project.display.parameters.free()` |
98+
| `how_to_access_parameters()` | `project.display.parameters.access()` |
99+
| `parameter_uids()` | `project.display.parameters.uid()` |
100+
| `parameter_edi_tags()` | `project.display.parameters.edi()` |
101+
| `parameter_cif_tags()` | `project.display.parameters.cif()` |
102+
| `fit_results()` | `project.display.fit.results()` |
103+
| `constraints()` | `project.analysis.constraints.show()` |
104+
| `as_cif()` | `project.analysis.as_cif` and `project.analysis.show_as_text()` |
105+
106+
`project.analysis` and `project.info` follow the same display pattern as
107+
structures and experiments:
108+
109+
- `as_cif` is a read-only property returning the serialized CIF text as
110+
a string (the block body that is persisted into the project's Edi
111+
files).
112+
- `show_as_text()` pretty-prints that text with a header.
107113

108114
## Pattern Display
109115

0 commit comments

Comments
 (0)