Skip to content

Fix exclusion ordering on lattice param change#936

Merged
psavery merged 1 commit into
masterfrom
fix-exclusion-ordering
May 15, 2026
Merged

Fix exclusion ordering on lattice param change#936
psavery merged 1 commit into
masterfrom
fix-exclusion-ordering

Conversation

@psavery
Copy link
Copy Markdown
Collaborator

@psavery psavery commented May 15, 2026

Overview

Previously, tThSort and tThSortInv would effectively cancel each other out, as long as the two theta ordering stayed constant (which is usually true for high symmetry systems). This issue would not be encountered by most users, since most users are dealing with high symmetry systems.

In low symmetry systems, the two theta ordering can be more easily re-arranged on lattice parameter changes, so this would land the exclusions at incorrect indices.

An example of this issue in the GUI: if you had a triclinic material and selected HKL 002, then changed the c lattice parameter, the selected HKL could be changed to something else, like -1 -1 2.

A simple test was added that reproduced the issue, and that also verifies that the issue is fixed.

Affected Workflows

All

Documentation Changes

None

Copy link
Copy Markdown
Member

@saransh13 saransh13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes the issue

Previously, `tThSort` and `tThSortInv` would effectively cancel each
other out, as long as the two theta ordering stayed constant (which
is usually true for high symmetry systems). This issue would not be
encountered by most users, since most users are dealing with high
symmetry systems.

In low symmetry systems, the two theta ordering can be more easily
re-arranged on lattice parameter changes, so this would land the
exclusions at incorrect indices.

An example of this issue in the GUI: if you had a triclinic material
and selected HKL `002`, then changed the `c` lattice parameter, the
selected HKL could be changed to something else, like `-1 -1 2`.

A simple test was added that reproduced the issue, and that also
verifies that the issue is fixed.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@psavery psavery force-pushed the fix-exclusion-ordering branch from 68cfc76 to 06bf739 Compare May 15, 2026 20:53
@psavery
Copy link
Copy Markdown
Collaborator Author

psavery commented May 15, 2026

Rebased on master to fix the packaging

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.61%. Comparing base (2185e8a) to head (06bf739).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #936   +/-   ##
=======================================
  Coverage   72.61%   72.61%           
=======================================
  Files         142      142           
  Lines       21940    21940           
=======================================
  Hits        15932    15932           
  Misses       6008     6008           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@psavery
Copy link
Copy Markdown
Collaborator Author

psavery commented May 15, 2026

This actually seemed to be a relatively important issue with calibrating, especially with low symmetry materials, because if you calibrated lattice parameters, you could end up with wrong exclusions selected.

@psavery psavery merged commit 29c9d31 into master May 15, 2026
10 checks passed
@psavery psavery deleted the fix-exclusion-ordering branch May 15, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants