Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
ecb51e4
Add Bayesian analysis design note
AndrewSazonov May 7, 2026
b3a5462
Add arviz for Bayesian analysis
AndrewSazonov May 7, 2026
252ee56
Remove old package structure documentation
AndrewSazonov May 7, 2026
7849de3
Update package structure docs with refln reorganization
AndrewSazonov May 7, 2026
9a88081
Plan Bayesian DREAM implementation
AndrewSazonov May 7, 2026
e34c278
Register BUMPS DREAM minimizer
AndrewSazonov May 7, 2026
303dc27
Add Bayesian fit result models
AndrewSazonov May 7, 2026
cd8d233
Thread random seed through fitting
AndrewSazonov May 7, 2026
3e4d09e
Implement DREAM sampling
AndrewSazonov May 7, 2026
448887b
Add Bayesian fit result display
AndrewSazonov May 7, 2026
3d44796
Plot Bayesian parameter correlations
AndrewSazonov May 7, 2026
391699d
Add posterior ArviZ plots
AndrewSazonov May 7, 2026
8add028
Add posterior predictive plots
AndrewSazonov May 7, 2026
100678e
Refine Bayesian fit UX
AndrewSazonov May 7, 2026
d17fc0d
Fix DREAM sampler progress reporting
AndrewSazonov May 7, 2026
a33f657
Fix posterior pair plot axis sharing
AndrewSazonov May 7, 2026
55adea8
Improve Bayesian demo parameter choices
AndrewSazonov May 7, 2026
4c07c18
Expose DREAM sampler settings
AndrewSazonov May 7, 2026
c1d6e83
Render posterior marginals as KDE curves
AndrewSazonov May 8, 2026
5ec9def
Add posterior pair density contours
AndrewSazonov May 8, 2026
0f2731c
Switch Bayesian demo to correlated pair
AndrewSazonov May 8, 2026
c3ad035
Add Bayesian tracking and posterior plot updates
AndrewSazonov May 8, 2026
6eb6725
Add posterior draws and log-posterior tracking
AndrewSazonov May 8, 2026
2f592c8
Use population mean log-posterior for progress tracking
AndrewSazonov May 8, 2026
4dbc84d
Polish Bayesian progress and posterior plots
AndrewSazonov May 8, 2026
16f9fc6
Fix DREAM diagnostics and posterior KDEs
AndrewSazonov May 8, 2026
1dde15b
Refine posterior plot styling
AndrewSazonov May 8, 2026
8cf5f05
Improve posterior pair plot UX
AndrewSazonov May 8, 2026
74930c1
Add uncertainty-based fit bounds method
AndrewSazonov May 8, 2026
46d2d81
Tighten posterior pair plot layout
AndrewSazonov May 8, 2026
c680355
Make fit bounds helper a setter
AndrewSazonov May 8, 2026
7fd16ce
Refine posterior contour layering
AndrewSazonov May 8, 2026
0aaf2e9
Fix posterior contour layering
AndrewSazonov May 8, 2026
b4a00c3
Preserve pair plot sample hover
AndrewSazonov May 8, 2026
c7de062
Enforce pair plot trace z-order
AndrewSazonov May 8, 2026
2b501c9
Restore pair plot axis frames
AndrewSazonov May 8, 2026
a71b706
Split posterior diagnostic warnings
AndrewSazonov May 8, 2026
6259084
Strengthen pair plot axis borders
AndrewSazonov May 8, 2026
bdcb095
Free broad_gauss and set bounds from uncertainty
AndrewSazonov May 8, 2026
60bac37
Draw explicit pair plot borders
AndrewSazonov May 8, 2026
ca7bdde
Align pair plot y-axis titles
AndrewSazonov May 8, 2026
659c30a
Unify plot axis border colors
AndrewSazonov May 8, 2026
a1ad6c3
Lock posterior pair axis ranges
AndrewSazonov May 8, 2026
e87055e
Align pair plot title with modebar
AndrewSazonov May 8, 2026
2d58e56
Update diagonal subplot axis styling
AndrewSazonov May 8, 2026
1da1f2e
Expose DREAM init and align pair labels
AndrewSazonov May 8, 2026
9cc9343
Tighten fit bounds multiplier from 5 to 4
AndrewSazonov May 8, 2026
f4aa5ef
Match pair plot axis title font sizes
AndrewSazonov May 8, 2026
ae98ffe
Disable Rich highlighting in Bayesian summaries
AndrewSazonov May 8, 2026
e5dd8b6
Tune DREAM and model parameters in fit
AndrewSazonov May 8, 2026
29f9db7
Expand Bayesian tutorial walkthrough
AndrewSazonov May 8, 2026
af27c2f
Apply linting rules and formatting
AndrewSazonov May 8, 2026
506e5f4
Add LBCO Bayesian tutorial
AndrewSazonov May 8, 2026
9cf4ffe
Make posterior pair plots responsive
AndrewSazonov May 8, 2026
3443981
Add DREAM bound validation and flexible parameter selection
AndrewSazonov May 8, 2026
8301900
Adopt fixed-aspect CSS for posterior pair plots
AndrewSazonov May 9, 2026
1282c95
Add posterior pair plot rendering modes
AndrewSazonov May 10, 2026
65c4a28
Add multiline axis titles to posterior pair plots
AndrewSazonov May 10, 2026
46a9cb6
Redesign correlation heatmap display
AndrewSazonov May 10, 2026
e97f049
Simplify tutorial parameter loops and bounds
AndrewSazonov May 10, 2026
ffbc033
Improve hover template readability
AndrewSazonov May 10, 2026
78261ca
Improve posterior plot binning and styling
AndrewSazonov May 10, 2026
0f79235
Refactor posterior x-axis range to static method
AndrewSazonov May 10, 2026
dc38184
Change posterior predictive default style to band
AndrewSazonov May 10, 2026
6d8ce0f
Add separate caching for band summaries
AndrewSazonov May 10, 2026
19815af
Reduce sampling steps and adjust plot ranges
AndrewSazonov May 10, 2026
469ed50
Update posterior pair plot marker and background
AndrewSazonov May 10, 2026
fcd9722
Update notebooks
AndrewSazonov May 10, 2026
f1039da
Fix docstring errors in Plotter class
AndrewSazonov May 10, 2026
a79bd66
Standardize axis title font size
AndrewSazonov May 11, 2026
9731a7a
Improve Bayesian fit summary display
AndrewSazonov May 11, 2026
511a5e5
Improve Bayesian fit result display
AndrewSazonov May 11, 2026
46791e2
Adjust posterior and band fill transparency
AndrewSazonov May 11, 2026
f3f5acc
Update fit bounds and plot range in ed-21
AndrewSazonov May 11, 2026
1f3e1ae
Improve posterior table diagnostic notes
AndrewSazonov May 11, 2026
01dc005
Add parallel DREAM sampling
AndrewSazonov May 11, 2026
83ef153
Add parallel=0 description to DREAM tutorial
AndrewSazonov May 11, 2026
b2ac66a
Fix test expectations for r-hat and parallel=0
AndrewSazonov May 11, 2026
72093d7
Add Bayesian DREAM to architecture
AndrewSazonov May 11, 2026
d901adc
Clean up
AndrewSazonov May 11, 2026
c7f3a6d
Fix Bayesian diagnostics and DREAM cleanup edge cases
AndrewSazonov May 11, 2026
798b0bc
Fix square matrix plot spacing and aspect ratio
AndrewSazonov May 11, 2026
39683b5
Apply the latest templates
AndrewSazonov May 11, 2026
078842c
Bump setup-pixi to v0.9.5
AndrewSazonov May 11, 2026
ab3843b
Bump dependencies
AndrewSazonov May 11, 2026
45b2fc5
Bump pixi.lock from v6 to v7
AndrewSazonov May 11, 2026
e2c913b
Add correlation-based limits to posterior pair plots
AndrewSazonov May 12, 2026
09da469
Improve posterior summary plot styling
AndrewSazonov May 12, 2026
1bb174b
Add single-crystal posterior predictive scatter plot
AndrewSazonov May 12, 2026
72a99ec
Add Tb2TiO7 Bayesian tutorial
AndrewSazonov May 12, 2026
6b6f622
Set default correlation and pair-plot limit to six
AndrewSazonov May 12, 2026
7d3341b
Bump copier template to v0.11.3
AndrewSazonov May 12, 2026
2f1f65f
Update tutorials
AndrewSazonov May 12, 2026
213a63c
Adjust posterior pair plot margins and title shift
AndrewSazonov May 12, 2026
156ec24
Generalize pair-plot layout to square matrix
AndrewSazonov May 12, 2026
006ca6a
Switch DREAM defaults and refine Bayesian fit displays
AndrewSazonov May 12, 2026
043e7fd
Show uncertainty multiplier in pair plot titles
AndrewSazonov May 12, 2026
3db44d1
Refine Bayesian tutorial examples
AndrewSazonov May 12, 2026
a862edc
Shorten fit-bounds multiplier constant name
AndrewSazonov May 12, 2026
8a21d94
Bump dependencies
AndrewSazonov May 12, 2026
d17b479
Add ADR documents
AndrewSazonov May 13, 2026
9d03c30
Improve CI and codecov settings
AndrewSazonov May 13, 2026
303a419
Fix structure factor support for X-ray
AndrewSazonov May 13, 2026
ebfa81f
Increase integration coverage for Bayesian fit helpers
AndrewSazonov May 13, 2026
c22525e
Remove unused benchmark dependency and track serial benchmarks
AndrewSazonov May 13, 2026
d2f53fb
Normalize styled console output in Windows integration tests
AndrewSazonov May 13, 2026
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
26 changes: 26 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Codecov configuration
# https://docs.codecov.com/docs/codecov-yaml

github_checks:
annotations: true

comment:
layout: 'reach, diff, flags, files'
behavior: default
require_changes: false
require_base: false
require_head: true

coverage:
status:
project:
default:
target: auto
threshold: 1%
# Make project coverage informational (won't block PR)
informational: true
patch:
default:
target: auto
# Require patch coverage but with threshold
threshold: 1%
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.11.1-12-gbb9bb30
_commit: v0.11.4
_src_path: gh:easyscience/templates
app_docs_url: https://easyscience.github.io/diffraction-app
app_doi: 10.5281/zenodo.18163581
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-pixi/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ inputs:
runs:
using: 'composite'
steps:
- uses: prefix-dev/setup-pixi@v0.9.4
- uses: prefix-dev/setup-pixi@v0.9.5
with:
environments: ${{ inputs.environments }}
activate-environment: ${{ inputs.activate-environment }}
Expand Down
13 changes: 6 additions & 7 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
## Testing

- Every new module, class, or bug fix ships with tests. See
`docs/architecture/architecture.md` §10 for the full strategy.
`docs/dev/architecture.md` §10 for the full strategy.
- Unit tests mirror the source tree:
`src/easydiffraction/<pkg>/<mod>.py` →
`tests/unit/easydiffraction/<pkg>/test_<mod>.py`. Verify with
Expand All @@ -102,8 +102,8 @@

- Before any structural/design change (new categories, factories,
switchable-category wiring, datablocks, CIF serialisation), read
`docs/architecture/architecture.md` and follow documented patterns.
Localised bug fixes or test updates need only this file.
`docs/dev/architecture.md` and follow documented patterns. Localised
bug fixes or test updates need only this file.
- Project is in beta: no legacy shims, no deprecation warnings — update
tests and tutorials to the current API.
- Minimal diffs; don't reformat working code. Fix only what's asked;
Expand Down Expand Up @@ -146,13 +146,12 @@ Non-trivial changes use a two-phase workflow:

Notes:

- `pixi run fix` regenerates `docs/architecture/package-structure-*.md`
- `pixi run fix` regenerates `docs/dev/package-structure-*.md`
automatically — never edit those by hand. Don't review auto-fixes;
accept and move on. Then `pixi run check` until clean.
- Open issues / design questions / planned improvements live in
`docs/architecture/issues_open.md` (priority-ordered). On resolution,
move to `docs/architecture/issues_closed.md` and update
`architecture.md` if affected.
`docs/dev/issues_open.md` (priority-ordered). On resolution, move to
`docs/dev/issues_closed.md` and update `architecture.md` if affected.

### Planning

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
push:
branches:
- develop
# Do not run on version tags (those are handled by other workflows)
tags-ignore: ['v*']
# Trigger the workflow on pull request
pull_request:
# Allows you to run this workflow manually from the Actions tab
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ jobs:
- name: Set up pixi
uses: ./.github/actions/setup-pixi

# Install badgery into the active Pixi environment without modifying
# pixi.toml/pixi.lock. Using `pixi add` here re-solves the whole project
# and rebuilds the local editable package, which can cause intermittent
# Linux CI failures (`Text file busy`, os error 26).
- name: Install badgery
shell: bash
run: pixi add --pypi --git https://github.com/enhantica/badgery badgery
run: pixi run python -m pip install git+https://github.com/enhantica/badgery

- name: Run docstring coverage and code complexity/maintainability checks
run: |
Expand Down
149 changes: 20 additions & 129 deletions .github/workflows/issues-labels.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Verifies if the current issue has at least one real `[scope]` label and one
# real `[priority]` label. If either is missing, the workflow adds a reminder
# label with a warning emoji.
# Verifies if the current issue has at least one `[scope]` label and one
# `[priority]` label. If either is missing, the workflow adds a reminder label.

name: Issue labels check

Expand All @@ -20,130 +19,22 @@ jobs:
cancel-in-progress: true

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Sync missing-label reminders
uses: ./.github/actions/github-script
- name: Ensure [scope] label
uses: Rindrics/expect-label-prefix@v1.2.1
with:
script: |
const fs = require('fs');

const issueNumber = context.issue.number;
const action = context.payload.action;
const changedLabel = context.payload.label?.name ?? null;
const labels = context.payload.issue.labels.map(({ name }) => name);
const requirements = [
{
prefix: '[scope] ',
reminder: '[scope] ⚠️ label needed',
},
{
prefix: '[priority] ',
reminder: '[priority] ⚠️ label needed',
},
];

const labelsToAdd = [];
const labelsToRemove = [];
const evaluations = [];

console.log(`::group::Issue label check for #${issueNumber}`);
console.log(`Event action: ${action}`);
if (changedLabel) {
console.log(`Event label: ${changedLabel}`);
}
console.log(
`Current labels: ${labels.length > 0 ? labels.join(', ') : '(none)'}`,
);

for (const { prefix, reminder } of requirements) {
const matchingRealLabels = labels.filter(
(name) => name.startsWith(prefix) && name !== reminder,
);
const hasRealLabel = matchingRealLabels.length > 0;
const hasReminderLabel = labels.includes(reminder);

evaluations.push({
prefix,
reminder,
matchingRealLabels,
hasReminderLabel,
});

if (hasRealLabel && hasReminderLabel) {
labelsToRemove.push(reminder);
} else if (!hasRealLabel && !hasReminderLabel) {
labelsToAdd.push(reminder);
}
}

for (const evaluation of evaluations) {
if (evaluation.matchingRealLabels.length > 0) {
console.log(
`Found required ${evaluation.prefix}label(s): ${evaluation.matchingRealLabels.join(', ')}`,
);
} else {
console.log(`Missing required ${evaluation.prefix}label.`);
}

if (evaluation.hasReminderLabel) {
console.log(`Reminder label already present: ${evaluation.reminder}`);
}
}

if (labelsToAdd.length > 0) {
console.log(`Adding reminder labels: ${labelsToAdd.join(', ')}`);
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: labelsToAdd,
});
}

for (const name of labelsToRemove) {
console.log(`Removing reminder label: ${name}`);
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name,
});
}

if (labelsToAdd.length === 0 && labelsToRemove.length === 0) {
console.log('No label changes required.');
}

console.log('::endgroup::');

if (process.env.GITHUB_STEP_SUMMARY) {
const summaryLines = [
'### Issue Label Check',
`- Issue: #${issueNumber}`,
`- Event: ${action}`,
`- Trigger label: ${changedLabel ?? '(none)'}`,
`- Current labels: ${labels.length > 0 ? labels.join(', ') : '(none)'}`,
'',
'#### Requirement status',
...evaluations.map((evaluation) => {
const status =
evaluation.matchingRealLabels.length > 0
? `found ${evaluation.matchingRealLabels.join(', ')}`
: 'missing';
const reminder = evaluation.hasReminderLabel
? `reminder present: ${evaluation.reminder}`
: `reminder absent: ${evaluation.reminder}`;
return `- ${evaluation.prefix}: ${status}; ${reminder}`;
}),
'',
`- Labels to add: ${labelsToAdd.length > 0 ? labelsToAdd.join(', ') : '(none)'}`,
`- Labels to remove: ${labelsToRemove.length > 0 ? labelsToRemove.join(', ') : '(none)'}`,
];

fs.appendFileSync(
process.env.GITHUB_STEP_SUMMARY,
`${summaryLines.join('\n')}\n`,
);
}
repository_full_name: ${{ github.repository }}
token: ${{ github.token }}
label_prefix: '[scope]'
label_separator: ' '
add_label: 'true'
default_label: '[scope] ⚠️ label needed'

- name: Ensure [priority] label
uses: Rindrics/expect-label-prefix@v1.2.1
with:
repository_full_name: ${{ github.repository }}
token: ${{ github.token }}
label_prefix: '[priority]'
label_separator: ' '
add_label: 'true'
default_label: '[priority] ⚠️ label needed'
74 changes: 28 additions & 46 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,45 @@
# Verifies if a pull request has at least one label from a set of valid
# labels before it can be merged.
#
# NOTE:
# This workflow may be triggered twice in quick succession when a PR is
# created:
# 1) `opened` — when the pull request is initially created
# 2) `labeled` — if labels are added immediately after creation
# (e.g. by manual labeling, another workflow, or GitHub App).
#
# These are separate GitHub events, so two workflow runs can be started.
# The `concurrency` configuration below ensures that only the latest run
# for the same PR remains active, canceling any previous in-progress
# run.
# The label validation is delegated to `mheap/github-action-required-labels`,
# which checks the current PR labels via the GitHub API and can add or update a
# PR comment when the required label set is missing.

name: PR labels check

on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]

concurrency:
group: pr-labels-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
pull-requests: read
issues: write
pull-requests: write

jobs:
check-labels:
runs-on: ubuntu-latest

steps:
- name: Check for valid labels
run: |
PR_LABELS=$(echo '${{ toJson(github.event.pull_request.labels.*.name) }}' | jq -r '.[]')

echo "Current PR labels: $PR_LABELS"
VALID_LABELS=(
"[bot] release"
"[scope] bug"
"[scope] documentation"
"[scope] enhancement"
"[scope] maintenance"
"[scope] significant"
)

found=false
for label in "${VALID_LABELS[@]}"; do
if echo "$PR_LABELS" | grep -Fxq "$label"; then
echo "✅ Found valid label: $label"
found=true
break
fi
done

if [ "$found" = false ]; then
echo "ERROR: PR must have at least one of the following labels:"
for label in "${VALID_LABELS[@]}"; do
echo " - $label"
done
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup easyscience[bot]
id: bot
uses: ./.github/actions/setup-easyscience-bot
with:
app-id: ${{ vars.EASYSCIENCE_APP_ID }}
private-key: ${{ secrets.EASYSCIENCE_APP_KEY }}

- uses: mheap/github-action-required-labels@v5
with:
token: ${{ steps.bot.outputs.token }}
add_comment: true
mode: minimum
count: 1
labels: |
[bot] release
[scope] bug
[scope] documentation
[scope] enhancement
[scope] maintenance
[scope] significant
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ jobs:
exit 1
fi

whl_url="file://$(python -c 'import os,sys; print(os.path.abspath(sys.argv[1]))' "${whl_path[0]}")"
whl_abs_path="$(python -c 'import os,sys; print(os.path.abspath(sys.argv[1]))' "${whl_path[0]}")"

echo "Adding easydiffraction from: $whl_url"
pixi add --pypi "easydiffraction[dev] @ ${whl_url}"
echo "Adding easydiffraction from: $whl_abs_path"
pixi add --pypi "easydiffraction[dev] @ ${whl_abs_path}"

echo "Exiting pixi project directory"
cd ..
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ or to run only Python linting checks:
pixi run py-lint-check
```

To add missing license headers:

```bash
pixi run spdx-add
```

Some formatting issues can be fixed automatically:

```bash
Expand Down
13 changes: 0 additions & 13 deletions codecov.yml

This file was deleted.

Loading
Loading