Skip to content

Commit f178c9e

Browse files
Align IUCr CIF tags and report export (#184)
1 parent 5a6fea2 commit f178c9e

84 files changed

Lines changed: 6113 additions & 634 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: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ posterior summaries:
8585
- `posterior_effective_sample_size_bulk`
8686

8787
`_fit_result` stores the latest saved fit header and scalar
88-
family-specific fit outputs:
88+
family-specific fit outputs. In the default project save this category
89+
is topology-neutral: single-crystal and powder fits both persist under
90+
`_fit_result.*`. The IUCr submission export may remap these same values
91+
to topology-specific dictionary categories (`_refine_ls.*`,
92+
`_pd_proc_ls.*`, `_reflns.*`) as described by
93+
[`iucr-cif-tag-alignment.md`](iucr-cif-tag-alignment.md), but the
94+
round-trip project schema remains common.
8995

9096
- `result_kind`
9197
- `success`
@@ -113,6 +119,43 @@ Deterministic fit-result classes add compact fit output counts:
113119
- `covariance_available`
114120
- `correlation_available`
115121

122+
These deterministic fields are always written once a deterministic
123+
fit-result projection exists.
124+
125+
Reflection-result fields are written only when a fitted experiment has
126+
persisted reflection rows:
127+
128+
- `R_factor_all`
129+
- `wR_factor_all`
130+
- `R_factor_gt`
131+
- `wR_factor_gt`
132+
- `threshold_expression`
133+
- `number_reflns_total`
134+
- `number_reflns_gt`
135+
136+
Powder-profile fields are written only when the result contains powder
137+
profile diagnostics:
138+
139+
- `prof_R_factor`
140+
- `prof_wR_factor`
141+
- `prof_wR_expected`
142+
- `profile_function`
143+
- `background_function`
144+
145+
Restraint and constraint counts are written only when positive:
146+
147+
- `number_restraints`
148+
- `number_constraints`
149+
150+
The deterministic R-factor, profile, restraint / constraint, and
151+
reflection-aggregate fields use dictionary-canonical item names where
152+
those exist, including uppercase `R` / `wR`, while retaining the
153+
project-side `_fit_result` category prefix in the default save. Live
154+
deterministic fit results may also carry transient diagnostics such as
155+
`shift_over_su_max` and `shift_over_su_mean`; those are not written to
156+
`analysis/analysis.cif` until a topology-specific persistence contract
157+
needs them.
158+
116159
When the LSQ backend provides a termination reason that differs from the
117160
common `_fit_result.message`, deterministic fit results also store:
118161

‎docs/dev/adrs/accepted/fit-results-display-naming.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ Both converge on `s.u.` as the appropriate cross-method label.
5151

5252
[`display-ux.md`](display-ux.md) defines facade method names but not
5353
column headers or footnotes;
54-
[`iucr-cif-tag-alignment.md`](../suggestions/iucr-cif-tag-alignment.md)
55-
defines persisted CIF tag names but not display labels;
54+
[`iucr-cif-tag-alignment.md`](iucr-cif-tag-alignment.md) defines
55+
persisted CIF tag names but not display labels;
5656
[`analysis-cif-fit-state.md`](analysis-cif-fit-state.md) defines Python
5757
and CIF attribute names but not user-visible labels. Display naming for
5858
fit-results tables is a real gap.
@@ -281,9 +281,9 @@ None directly amended. This ADR complements:
281281

282282
- [`display-ux.md`](display-ux.md) — defines facade method names; this
283283
ADR fills in the column-header layer underneath.
284-
- [`iucr-cif-tag-alignment.md`](../suggestions/iucr-cif-tag-alignment.md)
285-
— defines persisted CIF tag names; this ADR is the matching
286-
display-time label layer.
284+
- [`iucr-cif-tag-alignment.md`](iucr-cif-tag-alignment.md) — defines
285+
persisted CIF tag names; this ADR is the matching display-time label
286+
layer.
287287
- [`analysis-cif-fit-state.md`](analysis-cif-fit-state.md) — defines
288288
Python / CIF attribute names (e.g. `Parameter.uncertainty`,
289289
`posterior_uncertainty`); display headers map to those without

‎docs/dev/adrs/accepted/help-discoverability.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ Accepted and implemented.
99
EasyDiffraction is used by scientists who often explore the API in
1010
notebooks. The main object graph already exposes many focused objects:
1111
projects, project metadata, structures, experiments, categories,
12-
parameters, analysis helpers, summaries, and display facades. Users need
13-
a consistent way to discover the next useful operation from any of these
12+
parameters, analysis helpers, reports, and display facades. Users need a
13+
consistent way to discover the next useful operation from any of these
1414
objects without reading source code.
1515

1616
Most model objects inherit `GuardedBase`, `CategoryItem`,
1717
`CategoryCollection`, `DatablockItem`, or `DatablockCollection`, which
1818
already provide `help()` output. Plain facade classes such as display
19-
namespaces and summaries do not inherit those base classes, so they need
19+
namespaces and reports do not inherit those base classes, so they need
2020
the same discovery behavior explicitly.
2121

2222
## Decision
@@ -28,7 +28,7 @@ includes:
2828
- category items and category collections
2929
- datablock items and datablock collections
3030
- project-level objects such as `Project`, `ProjectInfo`, `Analysis`,
31-
`Summary`, and `Rendering`
31+
`Report`, and `Rendering`
3232
- display facades such as `project.display`,
3333
`project.display.parameters`, `project.display.fit`,
3434
`project.display.posterior`, and `analysis.display`
@@ -52,7 +52,7 @@ project.help()
5252
project.display.help()
5353
project.display.parameters.help()
5454
project.analysis.display.help()
55-
project.summary.help()
55+
project.report.help()
5656
project.experiments.help()
5757
project.experiments['hrpt'].help()
5858
project.experiments['hrpt'].background.help()

0 commit comments

Comments
 (0)