Skip to content

Commit 19e5d9a

Browse files
committed
Fixed typos and bugs
modified: tests/test_snanaio.py
1 parent 24924f2 commit 19e5d9a

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

tests/test_snanaio.py

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
# IPython log file
1+
from __future__ import absolute_import, print_function, division
22

33
import analyzeSN as ans
44
import os
55
import pandas as pd
66
from pandas.util.testing import assert_frame_equal
7-
registeredBandName = tuple('mega_' + band for band in 'ugriz')
7+
registeredMegaCamBands = tuple('mega_' + band for band in 'ugriz')
88
def test_load():
9-
headFile = os.path.join(ans.__path__[0], 'example_data', 'snana_fits_HEAD.FITS')
10-
photFile = os.path.join(ans.__path__[0], 'example_data', 'snana_fits_PHOT.FITS')
11-
sne = ans.SNANASims(headFile=headFile, photFile=photFile, coerce_inds2int=False,
12-
SNANABandNames='urgiz', registeredBandName=registeredMegaCam)
9+
headFile = os.path.join(ans.__path__[0], 'example_data',
10+
'snana_fits_HEAD.FITS')
11+
photFile = os.path.join(ans.__path__[0], 'example_data',
12+
'snana_fits_PHOT.FITS')
13+
sne = ans.SNANASims(headFile=headFile, photFile=photFile,
14+
coerce_inds2int=False,
15+
SNANABandNames='ugriz',
16+
registeredBandNames=registeredMegaCamBands)
17+
print(sne.bandNames)
1318
assert sne.bandNames == 'ugriz'
1419
assert sne.newbandNames == ('mega_u', 'mega_g', 'mega_r', 'mega_i',
1520
'mega_z')
16-
assert len(sne.bandNameDict.keys()) == 6
21+
assert len(sne.bandNameDict.keys()) == 5
1722
assert len(sne.headData) == 2
1823
assert len(sne.get_SNANA_photometry(snid='03d1aw').lightCurve) > 0
1924
assert len(sne.get_SNANA_photometry(snid='03d1ax').lightCurve) > 0
2025
def test_snanadatafiles():
21-
headFile = os.path.join(ans.__path__[0], 'example_data', 'snana_fits_HEAD.FITS')
22-
photFile = os.path.join(ans.__path__[0], 'example_data', 'snana_fits_PHOT.FITS')
23-
#sne = ans.SNANASims(headFile=headFile, photFile=photFile, coerce_inds2int=False)
26+
headFile = os.path.join(ans.__path__[0], 'example_data',
27+
'snana_fits_HEAD.FITS')
28+
photFile = os.path.join(ans.__path__[0], 'example_data',
29+
'snana_fits_PHOT.FITS')
2430
loc = os.path.join(ans.__path__[0], 'example_data')
2531
testheadFile = ans.SNANASims.snanadatafile(snanafileroot='snana_fits',
2632
filetype='head',

0 commit comments

Comments
 (0)