Skip to content

Commit

Permalink
unexpose translate_units() from user
Browse files Browse the repository at this point in the history
  • Loading branch information
gibsongreen committed Mar 22, 2024
1 parent a2fb178 commit 299308e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def user_api(self):
expose = ['function', 'spatial_subset', 'aperture',
'add_results', 'collapse_to_spectrum',
'wavelength_dependent', 'reference_wavelength',
'aperture_method', 'translate_units']
'aperture_method']
if self.dev_bg_support:
expose += ['background', 'bg_wavelength_dependent']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,13 @@ def test_unit_translation(cubeviz_helper):
# store to test second time after calling translate_units
mjy_sr_data1 = collapsed_spec._data[0]

extract_plg.translate_units(collapsed_spec)
extract_plg._obj.translate_units(collapsed_spec)

assert collapsed_spec._unit == u.MJy / u.sr
# some value in MJy/sr that we know the outcome after translation
assert np.allclose(collapsed_spec._data[0], 8751.653)

extract_plg.translate_units(collapsed_spec)
extract_plg._obj.translate_units(collapsed_spec)

# translating again returns the original units
assert collapsed_spec._unit == u.Jy / u.pix
Expand Down

0 comments on commit 299308e

Please sign in to comment.