Skip to content

Commit

Permalink
Merge pull request #35 from rosteen/codestyle-fixes
Browse files Browse the repository at this point in the history
Fix codestyle errors so tox test passes
  • Loading branch information
eteq authored Jul 2, 2021
2 parents 9dca451 + 79a447f commit f7dafba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions glue_astronomy/translators/ccddata.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from astropy.wcs import WCS
from astropy.nddata import CCDData
from astropy import units as u

from glue.config import data_translator
from glue.core import Data, Subset
from glue.core.coordinates import Coordinates

from astropy import units as u

from astropy.nddata import CCDData


@data_translator(CCDData)
class CCDDataHandler:
Expand Down
5 changes: 3 additions & 2 deletions glue_astronomy/translators/tests/test_ccddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def test_from_ccddata(with_wcs):
assert_allclose(image_new.data, [[2, 3], [4, 5]])
assert image_new.unit is u.Jy


def test_meta_round_trip():
wcs = WCS(naxis=2)
wcs.wcs.ctype = ['RA---TAN', 'DEC--TAN']
Expand All @@ -153,12 +154,12 @@ def test_meta_round_trip():

assert isinstance(data, Data)
assert len(data.meta) == 2
assert data.meta['BUNIT'] =='Jy/beam'
assert data.meta['BUNIT'] == 'Jy/beam'
assert data.meta['some_variable'] == 10

# Check round-tripping
image_new = data.get_object(attribute='data')
assert isinstance(image_new, CCDData)
assert len(image_new.meta) == 2
assert image_new.meta['BUNIT'] =='Jy/beam'
assert image_new.meta['BUNIT'] == 'Jy/beam'
assert image_new.meta['some_variable'] == 10

0 comments on commit f7dafba

Please sign in to comment.