You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently NDCube.rebin raises a warning if the uncertainty type is unknown (see here) and proceeds without propagating the uncertainty. While this is justified for the default uncertainty propagation function, it is confusing as it allows users to supply a disallowed kwarg without erroring. Moreover, users may have "unknown" uncertainty types that they know how to propagate, e.g. instrument-specific uncertainties. However, this is forbidden by the current NDCube.rebin implementation. Instead, if a user supplies a propagation function, the responsibility for deciding what types are valid should go to that function.
Proposed solution
Move the check at L1135 to L1146 and convert the warning to an error, i.e.
ifpropagate_uncertaintiesisTrue:
ifisinstance(self.uncertainty, astropy.nddata.UnknownUncertainty):
raiseValueError("self.uncertainty is of type UnknownUncertainty which does not ""support uncertainty propagation.")
propagate_uncertainties=utils.cube.propagate_rebin_uncertainties# Continue function...
This will error if the uncertainty type is unknown only if the default propagation function is used.
The text was updated successfully, but these errors were encountered:
Describe the feature
Currently
NDCube.rebin
raises a warning if the uncertainty type is unknown (see here) and proceeds without propagating the uncertainty. While this is justified for the default uncertainty propagation function, it is confusing as it allows users to supply a disallowed kwarg without erroring. Moreover, users may have "unknown" uncertainty types that they know how to propagate, e.g. instrument-specific uncertainties. However, this is forbidden by the currentNDCube.rebin
implementation. Instead, if a user supplies a propagation function, the responsibility for deciding what types are valid should go to that function.Proposed solution
Move the check at L1135 to L1146 and convert the warning to an error, i.e.
This will error if the uncertainty type is unknown only if the default propagation function is used.
The text was updated successfully, but these errors were encountered: