Skip to content

[ESSSPECTROSCOPY] test: add absolute tolerances to make tests less flaky - #697

Merged
jokasimr merged 2 commits into
mainfrom
fix-tol
Aug 12, 2026
Merged

[ESSSPECTROSCOPY] test: add absolute tolerances to make tests less flaky#697
jokasimr merged 2 commits into
mainfrom
fix-tol

Conversation

@jokasimr

@jokasimr jokasimr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@jokasimr
jokasimr requested a review from jl-wynen August 10, 2026 10:55
@github-actions github-actions Bot added the essspectroscopy Issues for essspectroscopy. label Aug 10, 2026
@github-actions github-actions Bot changed the title test: add absolute tolerances to make tests less flaky [ESSSPECTROSCOPY] test: add absolute tolerances to make tests less flaky Aug 10, 2026
@jokasimr

Copy link
Copy Markdown
Contributor Author

The workaround for unit=None will not be required after scipp/scipp#3945 has been deployed.

@jokasimr
jokasimr requested review from MridulS and removed request for jl-wynen August 11, 2026 13:29
expected.coords[name],
atol=(
sc.scalar(1e-15, unit=expected.coords[name].unit)
# TODO: When scipp supports unit=None in .to(), remove this case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So does this fail when one of the coords has unit=None because internally assert_allclose is calling .to(unit=) on the arguments?

Maybe the call to .to() should be removed and we should just check if the units are the same? (thus requiring manual conversion from the user before calling assert_allclose, but maybe that's ok?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the fix is rather to make .to() accept unit=None, I have made a PR to Scipp to add support for that.

@nvaytet nvaytet Aug 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

my question was more: what was the reason for needing to treat the unit is None case?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After in-person discussion: calling .to(unit=...) is only called on the atol, not on the variables passed.
So ok for the workaround here.

@jokasimr
jokasimr added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 96ac4a7 Aug 12, 2026
6 checks passed
@jokasimr
jokasimr deleted the fix-tol branch August 12, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

essspectroscopy Issues for essspectroscopy.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weekly Platform Test Failures 2026-08-10

2 participants