Closed cshanahan1 closed 8 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 82.16%. Comparing base (
85e1b20
) to head (ddc7aab
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
fixed the failing docstring
This PR cleans up a few things in Background.
Added a condition to FlatTrace that trace position must be negative. This check was originally done in Background when a FlatTrace was being used, but should generally be done. Before, if trace_pos was negative, a fully masked trace was being returned.
Previously, Background produced an unrelated error if 'traces' was None. Now, if no trace/number is passed in, a FlatTrace in the middle of the image will be used.
There was some other inconsistencies with inputs - the docstring said 'traces' must be a list, but the logic in the code implied that it could be a Trace object not in a list. Also, a FlatTrace object can be defined with either a float or an int, where previously 'Background' allowed only integer inputs. I fixed this to allow either single trace/int/float or list trace/int/float inputs. The only condition is that lists must all be of the same type (either numeric or
Trace
). I also added some checks for input to make sure something valid is passed in fortraces
(either None, int/float or list of int/float to define FlatTraces, or a Trace object, or a list of Trace objects). I also added tests for all of these allowed inputs.