Open pllim opened 4 days ago
Somehow this one test makes 2 very different tracebacks. Funky.
x = array([0., 0., 0., 0., 0., 0., 0.])
def f_la_from_f_nu(x):
> return x / (wav.to_value(si.AA, spectral()) ** 2 / c_Aps)
E ValueError: operands could not be broadcast together with shapes (7,) (3001,)
E astropy.units.core.UnitConversionError: 'erg / (Hz s cm2 pix2)' and 'erg / (Angstrom s cm2 pix2)' are not convertible
The original exception reported in JIRA also produces ValueError: operands could not be broadcast together with shapes (7,) (3438,)
(one of the exceptions from unskipped test)
Attention: Patch coverage is 91.66667%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 88.56%. Comparing base (
21e9b87
) to head (f6bdc8a
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@cshanahan1 , I tried to explain at https://github.com/spacetelescope/jdaviz/pull/3207#pullrequestreview-2341568057 but in case that is not clear enough, when one sets uc_plg.flux_unit = flux_unit
, glue invokes this:
You can see at https://github.com/glue-viz/glue/blob/main/glue/core/units.py that the converter has no access to app state or data. Therefore, the fix I used is to use https://docs.astropy.org/en/stable/api/astropy.units.set_enabled_equivalencies.html#astropy.units.set_enabled_equivalencies to pass in the equivalencies to global Python state so Jdaviz unit conversion can pick them up. It is used as context manager to hopefully only enable those equivalencies when needed.
Does this make sense?
Ignore devdeps failure, it is unrelated.
Description
This pull request is to unit conversion when equivalency needed breaks contours in cubeviz. Unskips a test added in https://github.com/spacetelescope/jdaviz/pull/3204 .
Probably no need for change log since this is patching unreleased feature, I assume.
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts, list the proposed change log here for review and add toCHANGES.rst
before merge. If no, maintainer should add ano-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.