Skip to content
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!: Propagate free-to-bound conversion error #739

Merged

Conversation

paulgessinger
Copy link
Member

Previously, if a free parameter set was given that was not on-surface, a FATAL error message was given, but the parameters were still returned. Client code is then unable to tell something went wrong. This changes the error to propagate, so it can hopefully be caught by the top caller.

Addresses #579, but I'm not sure it fixes it, really.

/cc @osbornjd

Previously, if a free parameter set was given that was not on-surface,
a FATAL error message was given, but the parameters were still returned.
Client code is  then unable to tell something went wrong. This changes
the error to propagate, so it can hopefully be caught by the top caller.
@paulgessinger paulgessinger added this to the next milestone Mar 3, 2021
Copy link
Contributor

@asalzburger asalzburger left a comment

Choose a reason for hiding this comment

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

Ideally, if you could add the test & remove the comment/warning that would be great

@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #739 (1c4f527) into master (506d1d8) will decrease coverage by 0.09%.
The diff coverage is 23.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #739      +/-   ##
==========================================
- Coverage   48.96%   48.87%   -0.10%     
==========================================
  Files         325      325              
  Lines       16639    16670      +31     
  Branches     7762     7783      +21     
==========================================
  Hits         8147     8147              
- Misses       3042     3058      +16     
- Partials     5450     5465      +15     
Impacted Files Coverage Δ
Core/include/Acts/Propagator/EigenStepper.hpp 67.56% <ø> (ø)
Core/include/Acts/Propagator/EigenStepper.ipp 51.88% <ø> (ø)
...re/include/Acts/Propagator/StraightLineStepper.hpp 67.27% <ø> (ø)
...de/Acts/TrackFinding/CombinatorialKalmanFilter.hpp 29.21% <0.00%> (-1.06%) ⬇️
Core/src/Propagator/StraightLineStepper.cpp 68.57% <ø> (ø)
Core/include/Acts/Propagator/AtlasStepper.hpp 69.36% <16.66%> (-0.18%) ⬇️
Core/include/Acts/TrackFitting/KalmanFitter.hpp 40.24% <21.05%> (-1.20%) ⬇️
Core/include/Acts/Propagator/Propagator.ipp 37.17% <25.00%> (-0.16%) ⬇️
Core/src/EventData/TransformationFreeToBound.cpp 38.09% <28.57%> (+1.73%) ⬆️
Core/src/Propagator/detail/CovarianceEngine.cpp 52.13% <33.33%> (-1.02%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 506d1d8...1c4f527. Read the comment docs.

@paulgessinger
Copy link
Member Author

Ok, there we go. The unit test that I now added fails because of the FATAL that is logged. @HadrienG2 what would be your preferred solution here? Remove the FATAL, demote it to ERROR?

@HadrienG2
Copy link
Contributor

HadrienG2 commented Mar 3, 2021

Hmmm, I didn't expect that indeed.

Demoting to ERROR won't work, because with current CI settings fail-on-error will trigger all the way down to WARNING, so you need to use INFO level or less. Which seems inappropriate.

Try-catching the fail-on-error exception could work, but will not allow you to check that a correct Result is returned when fail-on-error is disabled.

So what you probably need here is a mechanism to locally disable fail-on-error for the duration of the test... which means making the fail-on-error level dynamic (yay global variable).

Or you can just remove the offending log or demote it to INFO, if it doesn't bring that much to have it FATAL.

@HadrienG2
Copy link
Contributor

HadrienG2 commented Mar 3, 2021

Basically, the reason why this is tricky is that we have an operation that is an error from the point of view of the parameter conversion code, but not an error from the point of view of the whole program (unit test), whereas the current fail-on-error logic considers log severity to be a program-wide property.

I have no idea how to pass down the information that some local errors are not program-wide errors without indefinitely delaying logs and making every Acts component that calls code that emits logs care about fail-on-error (which would certainly be excessive), so since unit tests that exercise failures are rare, I guess the least bad option would be to instead have a way for them to say "errors are expected here, and that's fine by me, I'll handle them".

@paulgessinger
Copy link
Member Author

Honestly, I'm considering to just remove the fatal completely. Now that the error bubbles up, it's not critical to to have this anymore I suppose, and it uses a hack to get hold of a logger anyway so I'd be happy to remove that.

Does that seem reasonable?

@osbornjd
Copy link
Contributor

osbornjd commented Mar 3, 2021

From the user side, I agree with Paul. The logging doesn't provide anything anymore if the exception can be handled by the user, so it doesn't serve a purpose if the result can be caught.

@asalzburger asalzburger merged commit ea4e91c into acts-project:master Mar 4, 2021
@paulgessinger paulgessinger modified the milestones: next, v7.0.0 Apr 8, 2021
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.

None yet

4 participants