Skip to content

Commit

Permalink
Merge pull request #2820 from kecnry/glue-1.19
Browse files Browse the repository at this point in the history
Glue 1.19
  • Loading branch information
pllim authored Apr 19, 2024
2 parents bf59c22 + a39a0fe commit 41df897
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ Bug Fixes

- Standalone mode: stop jdaviz/voila processes when closing app. [#2791]

- Fixes compatibility with glue >= 1.19. [#2820]

Cubeviz
^^^^^^^

Expand Down
16 changes: 10 additions & 6 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,17 @@ def to_unit(self, data, cid, values, original_units, target_units):
# gives the units of the values array, which might not be the same
# as the original native units of the component in the data.
if cid.label == "flux":
spec = data.get_object(cls=Spectrum1D)
if len(values) == 2:
# Need this for setting the y-limits
spec_limits = [spec.spectral_axis[0].value, spec.spectral_axis[-1].value]
eqv = u.spectral_density(spec_limits*spec.spectral_axis.unit)
try:
spec = data.get_object(cls=Spectrum1D)
except RuntimeError:
eqv = []
else:
eqv = u.spectral_density(spec.spectral_axis)
if len(values) == 2:
# Need this for setting the y-limits
spec_limits = [spec.spectral_axis[0].value, spec.spectral_axis[-1].value]
eqv = u.spectral_density(spec_limits * spec.spectral_axis.unit)
else:
eqv = u.spectral_density(spec.spectral_axis)
else: # spectral axis
eqv = u.spectral()

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies = [
"traitlets>=5.0.5",
"bqplot>=0.12.37",
"bqplot-image-gl>=1.4.11",
"glue-core>=1.18.0,!=1.19.0",
"glue-core>=1.18.0",
"glue-jupyter>=0.20",
"echo>=0.5.0",
"ipykernel>=6.19.4",
Expand Down

0 comments on commit 41df897

Please sign in to comment.