Skip to content

Conversation

@Radonirinaunimi
Copy link
Member

Addresses #366.

Copy link
Contributor

@felixhekhorn felixhekhorn left a comment

Choose a reason for hiding this comment

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

With this fix the evolution does no longer crash with Error: interpolations do not match (I'm not sure which PDF the EKO corresponds to so I'm happy with a Error: grids are different)

@felixhekhorn felixhekhorn linked an issue Nov 26, 2025 that may be closed by this pull request
@cschwan
Copy link
Contributor

cschwan commented Nov 26, 2025

@Radonirinaunimi: can you please write a regression test where one of the fields is a NaN?

@Radonirinaunimi
Copy link
Member Author

@Radonirinaunimi: can you please write a regression test where one of the fields is a NaN?

Good point! I just added a simple unit test.

@Radonirinaunimi
Copy link
Member Author

@cschwan Are you happy with this?

InterpMeth::Lagrange,
);

assert!(interp.min.is_nan());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert!(interp.min.is_nan());
assert!(interp.min.is_nan());
assert!(!interp.min().is_nan());

I haven't run it, but I think this should pass - this would make the "weird" behaviour a bit more plain

Copy link
Contributor

Choose a reason for hiding this comment

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

You probably refer to NaN != NaN being a true statement, but NaN.is_nan() should always be true.

Copy link
Contributor

Choose a reason for hiding this comment

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

nope - I want to highlight the difference between the method min and the attribute min (which was confusing to me)

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, to me too 😄. In that case a clarifying comment is in order.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's why I needed the rmin method in the issue. From the existing test we then know that approx_eq!(f64,NaN,NaN,ulps=1) is true, which may be (for me: is) surprising. From the new test we would also know that NaN.min(1.0) is 1.0, which may be (for me: is) surprising.

Do you mean something like this

Suggested change
assert!(interp.min.is_nan());
// Starting from below the valid domain of the map results in a NaN for the attribute `min`, ...
assert!(interp.min.is_nan());
// but recall that the corresponding method `min()` is minimising between `min` and `max`,
// as the map might be inverse proportional:
assert!(!interp.min().is_nan());

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.

Evolution results in "interpolations do not match"

4 participants