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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WARNING: Do not edit this file manually.
# Any changes will be overwritten by Copier.
_commit: v0.12.0
_commit: v0.13.1-4-g190905c
_src_path: gh:easyscience/templates
app_docs_url: https://easyscience.github.io/diffraction-app
app_doi: 10.5281/zenodo.18163581
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,14 @@ jobs:

# Build the static files for the documentation site for local inspection
# Input: docs/ directory containing the Markdown files
# Output: site/ directory containing the generated HTML files
# Output: docs/site/ directory containing the generated HTML files
# Also verifies that mkdocstrings generated docs/site/objects.inv.
- name: Build site for local check
run: pixi run docs-build-local
run: |
pixi run docs-build-local
pixi run docs-inventory-check

# Upload the static files from the site/ directory to be used for
# Upload the static files from the docs/site/ directory to be used for
# local check
- name: Upload built site as artifact
uses: ./.github/actions/upload-artifact
Expand Down
29 changes: 6 additions & 23 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,15 @@ jobs:
frozen: false

- name: Init pixi project
run: pixi init easydiffraction
run:
pixi init --platform linux-64 --platform osx-arm64 --platform win-64
easydiffraction

- name: Configure Pixi platforms
- name: Configure pixi platforms
working-directory: easydiffraction
shell: bash
run: |
set -euo pipefail

case "$RUNNER_OS" in
Linux)
pixi_platforms='[{ name = "linux-64-glibc-2-35", platform = "linux-64", glibc = "2.35" }]'
;;
macOS)
pixi_platforms='[{ name = "osx-arm64-macos-14-0", platform = "osx-arm64", macos = "14.0" }]'
;;
Windows)
pixi_platforms='["win-64"]'
;;
*)
echo "Unsupported runner OS: $RUNNER_OS"
exit 1
;;
esac

PIXI_PLATFORMS="$pixi_platforms" python -c 'import os, pathlib; path = pathlib.Path("pixi.toml"); text = path.read_text(); path.write_text(text.replace(text.split("platforms = ", 1)[1].split("\n", 1)[0], os.environ["PIXI_PLATFORMS"], 1))'
pixi workspace platform list
pixi workspace platform edit linux-64 --glibc 2.35 --no-install
pixi workspace platform edit osx-arm64 --macos 14.0 --no-install

- name: Add Python 3.14
working-directory: easydiffraction
Expand Down
22 changes: 3 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,28 +228,12 @@ jobs:
echo "🔹🔸🔹🔸🔹 Python: $py_ver 🔹🔸🔹🔸🔹"

echo "Initializing pixi project"
pixi init easydiffraction_py$py_ver
pixi init --platform linux-64 --platform osx-arm64 --platform win-64 easydiffraction_py$py_ver
cd easydiffraction_py$py_ver

echo "Configure Pixi platforms"
case "$RUNNER_OS" in
Linux)
pixi_platforms='[{ name = "linux-64-glibc-2-35", platform = "linux-64", glibc = "2.35" }]'
;;
macOS)
pixi_platforms='[{ name = "osx-arm64-macos-14-0", platform = "osx-arm64", macos = "14.0" }]'
;;
Windows)
pixi_platforms='["win-64"]'
;;
*)
echo "Unsupported runner OS: $RUNNER_OS"
exit 1
;;
esac

PIXI_PLATFORMS="$pixi_platforms" python -c 'import os, pathlib; path = pathlib.Path("pixi.toml"); text = path.read_text(); path.write_text(text.replace(text.split("platforms = ", 1)[1].split("\n", 1)[0], os.environ["PIXI_PLATFORMS"], 1))'
pixi workspace platform list
pixi workspace platform edit linux-64 --glibc 2.35 --no-install
pixi workspace platform edit osx-arm64 --macos 14.0 --no-install

echo "Add Python $py_ver"
pixi add "python=$py_ver"
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ src/easydiffraction/display/plotters/assets/
.cache
deps/
tmp/
.hypothesis/
4 changes: 2 additions & 2 deletions docs/dev/adrs/accepted/background-auto-estimate.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ 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
(`refine-lbco-hrpt-from-data`) and TOF (`fitting-exercise-si-lbco`)
(`refine-lbco-hrpt-from-data`) and TOF (`exercise-refine-si-lbco`)
datasets plus the analytic unit cases, and produce sensible
backgrounds there. Re-tuning stays possible if a future dataset needs
it.
Expand Down Expand Up @@ -488,7 +488,7 @@ curve. **Phase 2 outcome:** the functional regression validates two
representative datasets — CWL
[`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)
[`exercise-refine-si-lbco.py`](../../../../docs/docs/tutorials/exercise-refine-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
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/adrs/accepted/resource-naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ There is no `ed-19` tutorial — id 19 is a dataset only.
| ed-10 | PDF: Ni, NPD | `pdf-ni-npd` |
| ed-11 | PDF: Si, NOMAD (SNS) | `pdf-si-nomad` |
| ed-12 | PDF: NaCl, XRD | `pdf-nacl-xrd` |
| ed-13 | Fitting exercise: Si, LBCO | `fitting-exercise-si-lbco` |
| ed-13 | Refinement exercise: Si, LBCO | `exercise-refine-si-lbco` |
| ed-14 | Refinement: Tb2Ti2O7, HEiDi | `refine-tbti-heidi` |
| ed-15 | Refinement: Taurine, SENJU | `refine-taurine-senju` |
| ed-16 | Joint: Si, Bragg+PDF | `joint-si-bragg-pdf` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,34 @@ gap. Two ways to fix it:
delivery. Cons: more moving parts; depends on the notebook being
**trusted** for a reopened (not re-run) notebook to re-render.

**Current choice:** Option 2 (keeps the live-notebook extras). Revisit
Option 1 if the loader proves fragile across notebook frontends or the
maintenance cost outweighs the three behaviours.
- **Colab transport — versioned frame-local assets.** Colab isolates
every cell output in its own iframe, so the once-per-kernel browser
state assumed by Option 2 cannot cross cells. In Colab only, every
figure output loads the version-matched Plotly bundle and
`ed-figures.js` from the published documentation assets in parallel
(the loader only needs Plotly once it renders), then calls the same
`renderSpec` entry point. `google.colab.output.pauseOutputUntil` holds
the output frame until the figure — or a visible error message — is on
screen. Concurrent outputs in one cell share frame-global loading
promises, so each asset is fetched and parsed only once. An immutable,
exact-release-tag jsDelivr URL is the fallback while a new
documentation version is deploying or if that deployment fails. Dev
builds intentionally use only `/dev/` to avoid mixing arbitrary local
code with the loader from another revision. The browser cache avoids
embedding or repeatedly transferring the runtime, while all
loader-owned theme, resize, and legend behaviour remains intact.
Documentation `SHARED` mode is selected first and is unaffected.

Saved Colab outputs still depend on the host restoring their dynamic
scripts. Until that behaviour is confirmed manually, reopen-and-view
without re-running is not guaranteed; re-run a cell if its restored
output remains at the loading placeholder. An end-to-end test of a dev
build likewise requires its matching loader to have reached `/dev/`.

**Current choice:** Option 2 for JupyterLab, with the frame-local asset
transport for Colab. Revisit Option 1 if the loader proves fragile
across notebook frontends or the maintenance cost outweighs the three
behaviours.

**Depends on:** nothing.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
**Type:** Testing

The microstructural size/strain feature added four `Parameter`s to the
TOF peak mixin (`broad_gauss_size_g`, `broad_gauss_strain_g`,
`broad_lorentz_size_l`, `broad_lorentz_strain_l` in
TOF peak mixin (`broad_gauss_size`, `broad_gauss_strain`,
`broad_lorentz_size`, `broad_lorentz_strain` in
`src/easydiffraction/datablocks/experiment/categories/peak/tof_mixins.py`),
but they are never asserted at the mixin-test level. Their value
hand-off is covered indirectly via
Expand Down
1 change: 1 addition & 0 deletions docs/dev/package-structure/full.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@
│ │ │ │ ├── 📄 factory.py
│ │ │ │ │ └── 🏷️ class BackgroundFactory
│ │ │ │ └── 📄 line_segment.py
│ │ │ │ ├── 🏷️ class _EstimationArrays
│ │ │ │ ├── 🏷️ class LineSegment
│ │ │ │ └── 🏷️ class LineSegmentBackground
│ │ │ ├── 📁 calculator
Expand Down
Loading