Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for packet source unit test #1009

Merged
merged 2 commits into from
Jan 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ref_bb.to_hdf(tardis_ref_data, key='/packet_unittest/blackbody',
ref_bb.to_hdf(tardis_ref_data, key='/packet_unit_test/blackbody',

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Marc followed the convention and named packet_unittest as previous group called plasma_unittest.

mode='a')

ref_df = tardis_ref_data['/packet_unittest/blackbody']
epassaro marked this conversation as resolved.
Show resolved Hide resolved
nus = bb.create_blackbody_packet_nus(10000, 100)
mus = bb.create_zero_limb_darkening_packet_mus(100)
Expand Down