Skip to content

Commit

Permalink
add dev note and fix output_unit exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Nov 23, 2021
1 parent 3cfd92d commit ad97141
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# copied and modified from astropy: https://github.com/astropy/astropy/pull/12304
"""Tests for physical functions."""
# pylint: disable=no-member, invalid-name
import pytest
Expand Down
7 changes: 6 additions & 1 deletion jdaviz/models/physical_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# copied and modified from astropy: https://github.com/astropy/astropy/pull/12304
"""
Models that have physical origins.
"""
Expand Down Expand Up @@ -269,7 +270,11 @@ def output_units(self, unit):
# let's provide some convenience for passing these as strings
unit = self._native_output_units.get(unit)
else:
unit = u.Unit(unit)
try:
unit = u.Unit(unit)
except ValueError:
# then the string wasn't a valid unit, we'll allow the error below to be raised
pass

if unit is None:
pass
Expand Down

0 comments on commit ad97141

Please sign in to comment.