-
Notifications
You must be signed in to change notification settings - Fork 46
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
Kapton error handling #2317
Kapton error handling #2317
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2317 +/- ##
==========================================
- Coverage 80.59% 80.54% -0.05%
==========================================
Files 587 587
Lines 67135 67144 +9
Branches 8950 8954 +4
==========================================
- Hits 54109 54084 -25
- Misses 10957 10988 +31
- Partials 2069 2072 +3 |
Do other parts of the code use "other" anywhere, or is it just worth removing "other" from the list of possibilities? I also wonder if |
I checked and these are the only two places where In the current state of code I briefly spoke with @irisdyoung and another idea to simplify phil here would be to remove If we are already speaking about kapton phil, then I personally do not understand why the distinction between All of these kapton phil modifications could make a good subject of another PR, but here I'd just want to focus on making the Error message clearer. |
Okay, normally I'd push for the "other" handling to be removed from here (and the PHIL option) since it does nothing (anyone extending it would need to know that it went here anyway), but as a general policy don't touch anything in |
Previously UnboundLocalError was raised when absorption_correction.apply=True, but absorption_correction.algorithm was unspecified. Now, whenever algorithm= is expected but unspecified, a ValueError is raised, unless user specifically requests algorithm=other.
Previous implementation of
dials/command_line/stills_process.py Processor.integrate
anddials/command_line/integrate.py run_integration
had an unexpectedUnboundLocalError
wheneverabsorption_correction.apply=True
, butabsorption_correction.algorithm
was unspecified (former specifier 2/4 possible states, and later 1/4 possible state). Now, in both places wheneverabsorption_correction.algorithm
is expected but unspecified, aValueError
is raised, unless user specifically requestsabsorption_correction.algorithm=other
.'This change should not affect any existing processes, but might save a few hours some other poor soul, who will inevitably accidentally declare multiple absorption protocols and unexpectedly ends up with
{apply=True, algorithm=None}
, like me last week.