-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor!: B field access returns Result #825
refactor!: B field access returns Result #825
Conversation
Codecov Report
@@ Coverage Diff @@
## main #825 +/- ##
==========================================
- Coverage 48.68% 48.54% -0.14%
==========================================
Files 327 328 +1
Lines 16893 16958 +65
Branches 7945 7999 +54
==========================================
+ Hits 8224 8233 +9
- Misses 3066 3082 +16
- Partials 5603 5643 +40
Continue to review full report at Codecov.
|
Turns out the interpolated b field test was actually wrong. detail::EquidistantAxis r(0.0, 4.0, 4u);
detail::EquidistantAxis z(-5, 5, 5u); and then asserted that the map went from Also, |
Ok, I think now it should be ready, sorry for the flip flop @HadrienG2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
Previously, we didn't have a mechanism to communicate that a field query failed. This is problematic, because it's not clear what to do when for instance our interpolated field goes out of bounds (see #784). This PR makes
MagneticFieldProvider
require thegetField
andgetFieldGradient
methods to returnResult<Vector3>
instead of the bare vector. This changes the public interface slightly, and all clients need to be adjusted.Additionally, the
InterpolatedBFieldMap
now checks each time a field cell is created or if the field is queried directly, whether the query position is out of bounds of the map, and will return a newMagneticFieldError::OutOfBounds
if that happens.BREAKING CHANGE:
MagneticFieldProvider
changes fromInterpolatedBFieldMap::getMin
andInterpolatedBFieldMap::getMax
now return the extent of the valid interpolation domain, rather than the raw grid extent.