Skip to content

Commit 13c3294

Browse files
Merge pull request #147 from easyscience/develop
Release: merge develop into master
2 parents 84f32ae + 7f4f336 commit 13c3294

323 files changed

Lines changed: 57673 additions & 9680 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.

.copier-answers.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# WARNING: Do not edit this file manually.
22
# Any changes will be overwritten by Copier.
3-
_commit: v0.10.1-33-g0f85abf
3+
_commit: v0.10.1-40-g29e2ccf
44
_src_path: gh:easyscience/templates
55
app_docs_url: https://easyscience.github.io/diffraction-app
66
app_doi: 10.5281/zenodo.18163581
77
app_package_name: easydiffraction_app
8-
app_python: '3.13'
8+
app_python: '3.14'
99
app_repo_name: diffraction-app
1010
home_page_url: https://easyscience.github.io/diffraction
1111
home_repo_name: diffraction
1212
lib_docs_url: https://easyscience.github.io/diffraction-lib
1313
lib_doi: 10.5281/zenodo.18163581
1414
lib_package_name: easydiffraction
1515
lib_python_max: '3.14'
16-
lib_python_min: '3.11'
16+
lib_python_min: '3.12'
1717
lib_repo_name: diffraction-lib
1818
project_contact_email: support@easydiffraction.org
1919
project_copyright_years: 2021-2026

.github/copilot-instructions.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
and UPPER_SNAKE_CASE for constants.
4343
- Use `from __future__ import annotations` in every module.
4444
- Type-annotate all public function signatures.
45-
- Docstrings on all public classes and methods (numpy style).
45+
- Docstrings on all public classes and methods (numpy style). These must
46+
include sections Parameters, Returns and Raises, where applicable.
4647
- Prefer flat over nested, explicit over clever.
4748
- Write straightforward code; do not add defensive checks for unlikely
4849
edge cases.
@@ -59,6 +60,19 @@
5960
with both getter and setter) or **read-only** (property with getter
6061
only). If internal code needs to mutate a read-only property, add a
6162
private `_set_<name>` method instead of exposing a public setter.
63+
- Lint complexity thresholds (`max-args`, `max-branches`,
64+
`max-statements`, `max-locals`, `max-nested-blocks`, etc. in
65+
`pyproject.toml`) are intentional code-quality guardrails. They are
66+
not arbitrary numbers — the project uses ruff's defaults (with
67+
`max-args` and `max-positional-args` set to 6 instead of 5 to account
68+
for ruff counting `self`/`cls`). When code violates a threshold, it is
69+
a signal that the function or class needs refactoring — not that the
70+
threshold needs raising. Do not raise thresholds, add `# noqa`
71+
comments, or use any other mechanism to silence complexity violations.
72+
Instead, refactor the code (extract helpers, introduce parameter
73+
objects, flatten nesting, etc.). For complex refactors that touch many
74+
lines or change public API, propose a refactoring plan and wait for
75+
approval before proceeding.
6276

6377
## Architecture
6478

@@ -107,6 +121,26 @@
107121
`*.py` script, then run `pixi run notebook-prepare` to regenerate the
108122
notebook.
109123

124+
## Testing
125+
126+
- Every new module, class, or bug fix must ship with tests. See
127+
`docs/architecture/architecture.md` §10 for the full test strategy.
128+
- **Unit tests mirror the source tree:**
129+
`src/easydiffraction/<pkg>/<mod>.py`
130+
`tests/unit/easydiffraction/<pkg>/test_<mod>.py`. Run
131+
`pixi run test-structure-check` to verify.
132+
- Category packages with only `default.py`/`factory.py` may use a single
133+
parent-level `test_<package>.py` instead of per-file tests.
134+
- Supplementary test files use the pattern `test_<mod>_coverage.py`.
135+
- Tests that expect `log.error()` to raise must `monkeypatch` Logger to
136+
RAISE mode (another test may have leaked WARN mode).
137+
- `@typechecked` setters raise `typeguard.TypeCheckError`, not
138+
`TypeError`.
139+
- No test-ordering dependence, no network, no sleeping, no real
140+
calculation engines in unit tests.
141+
- After adding or modifying tests, run `pixi run unit-tests` and confirm
142+
all tests pass.
143+
110144
## Changes
111145

112146
- Before implementing any structural or design change (new categories,
@@ -147,6 +181,8 @@
147181
`docs/architecture/architecture.md`.
148182
- After changes, run linting and formatting fixes with `pixi run fix`.
149183
Do not check what was auto-fixed, just accept the fixes and move on.
184+
Then, run linting and formatting checks with `pixi run check` and
185+
address any remaining issues until the code is clean.
150186
- After changes, run unit tests with `pixi run unit-tests`.
151187
- After changes, run integration tests with
152188
`pixi run integration-tests`.

.github/workflows/backmerge.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ concurrency:
2020
group: backmerge-master-into-develop
2121
cancel-in-progress: false
2222

23+
# Opt into Node.js 24 for all JavaScript actions.
24+
# Remove once all referenced actions natively target Node 24.
25+
env:
26+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
27+
2328
jobs:
2429
backmerge:
2530
runs-on: ubuntu-latest

.github/workflows/cleanup.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ on:
6161
- 'false'
6262
- 'true'
6363

64+
# Opt into Node.js 24 for all JavaScript actions.
65+
# Remove once all referenced actions natively target Node 24.
66+
env:
67+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
68+
6469
jobs:
6570
del-runs:
6671
runs-on: ubuntu-latest

.github/workflows/coverage.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Coverage checks
22

33
on:
4-
# Trigger the workflow on push
4+
# Trigger the workflow on push to develop
55
push:
6+
branches:
7+
- develop
68
# Do not run on version tags (those are handled by other workflows)
79
tags-ignore: ['v*']
810
# Trigger the workflow on pull request
@@ -15,15 +17,18 @@ permissions:
1517
actions: write
1618
contents: read
1719

18-
# Allow only one concurrent workflow, skipping runs queued between the run
19-
# in-progress and latest queued. And cancel in-progress runs.
20+
# Allow only one concurrent workflow per PR or branch ref.
21+
# Cancel in-progress runs only for pull requests, but let branch push runs finish.
2022
concurrency:
2123
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
22-
cancel-in-progress: true
24+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2325

2426
# Set the environment variables to be used in all jobs defined in this workflow
2527
env:
2628
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
29+
# Opt into Node.js 24 for all JavaScript actions.
30+
# Remove once all referenced actions natively target Node 24.
31+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
2732

2833
jobs:
2934
# Job 1: Run docstring coverage

.github/workflows/dashboard.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ env:
1414
DEVELOP_BRANCH: develop
1515
REPO_OWNER: ${{ github.repository_owner }}
1616
REPO_NAME: ${{ github.event.repository.name }}
17+
# Opt into Node.js 24 for all JavaScript actions.
18+
# Remove once all referenced actions natively target Node 24.
19+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1720

1821
jobs:
1922
dashboard:

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ env:
4848
IS_RELEASE_TAG: ${{ startsWith(github.ref, 'refs/tags/v') }}
4949
GITHUB_REPOSITORY: ${{ github.repository }}
5050
NOTEBOOKS_DIR: tutorials
51+
# Opt into Node.js 24 for all JavaScript actions.
52+
# Remove once all referenced actions natively target Node 24.
53+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
5154

5255
jobs:
5356
# Single job that builds and deploys documentation.

.github/workflows/issues-labels.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@ on:
1111
permissions:
1212
issues: write
1313

14+
# Opt into Node.js 24 for all JavaScript actions.
15+
# Remove once all referenced actions natively target Node 24.
16+
env:
17+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
18+
1419
jobs:
1520
check-labels:
21+
if: github.actor != 'easyscience[bot]'
22+
1623
runs-on: ubuntu-latest
1724

25+
concurrency:
26+
group: issue-labels-${{ github.event.issue.number }}
27+
cancel-in-progress: true
28+
1829
steps:
1930
- name: Checkout repository
2031
uses: actions/checkout@v5

.github/workflows/lint-format.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ permissions:
3434
# Set the environment variables to be used in all jobs defined in this workflow
3535
env:
3636
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
37+
# Opt into Node.js 24 for all JavaScript actions.
38+
# Remove once all referenced actions natively target Node 24.
39+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
3740

3841
jobs:
3942
lint-format:

.github/workflows/pypi-publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
# Allows you to run this workflow manually from the Actions tab
1111
workflow_dispatch:
1212

13+
# Opt into Node.js 24 for all JavaScript actions.
14+
# Remove once all referenced actions natively target Node 24.
15+
env:
16+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
17+
1318
jobs:
1419
pypi-publish:
1520
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)