Skip to content

Commit

Permalink
Fix for packet source unit test (#1009)
Browse files Browse the repository at this point in the history
* Initial commit

* Suggested name change
  • Loading branch information
epassaro authored and wkerzendorf committed Jan 21, 2020
1 parent 4161630 commit 71dad34
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tardis/montecarlo/tests/test_packet_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,19 @@
def data_path():
return os.path.join(tardis.__path__[0], 'montecarlo', 'tests', 'data')

@pytest.fixture
def packet_unit_test_fpath(tardis_ref_path):
return os.path.abspath(os.path.join(
tardis_ref_path, 'packet_unittest.h5'))

def test_bb_packet_sampling(tardis_ref_data):
def test_bb_packet_sampling(tardis_ref_data, packet_unit_test_fpath):
bb = BlackBodySimpleSource(2508)
#ref_df = pd.read_hdf('test_bb_sampling.h5')
if pytest.config.getvalue("--generate-reference"):
ref_bb = pd.read_hdf(packet_unit_test_fpath, key='/blackbody')
ref_bb.to_hdf(tardis_ref_data, key='/packet_unittest/blackbody',
mode='a')

ref_df = tardis_ref_data['/packet_unittest/blackbody']
nus = bb.create_blackbody_packet_nus(10000, 100)
mus = bb.create_zero_limb_darkening_packet_mus(100)
Expand Down

0 comments on commit 71dad34

Please sign in to comment.