Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Mar 11, 2024
1 parent 5658562 commit ef58b05
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions tardis/montecarlo/tests/test_packet_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def packet_unit_test_fpath(self, tardis_ref_path):
-------
os.path
"""
return os.path.abspath(os.path.join(tardis_ref_path, "packet_unittest.h5"))
return os.path.abspath(
os.path.join(tardis_ref_path, "packet_unittest.h5")
)

@pytest.fixture(scope="class")
def blackbodysimplesource(self, request):
Expand Down Expand Up @@ -63,7 +65,11 @@ def blackbody_simplesource_relativistic(self, request):
montecarlo_configuration.LEGACY_MODE_ENABLED = False

def test_bb_packet_sampling(
self, request, tardis_ref_data, packet_unit_test_fpath, blackbodysimplesource
self,
request,
tardis_ref_data,
packet_unit_test_fpath,
blackbodysimplesource,
):
"""
Parameters
Expand All @@ -74,7 +80,9 @@ def test_bb_packet_sampling(
"""
if request.config.getoption("--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_bb.to_hdf(
tardis_ref_data, key="/packet_unittest/blackbody", mode="a"
)
pytest.skip("Reference data was generated during this run.")

ref_df = tardis_ref_data["/packet_unittest/blackbody"]
Expand All @@ -101,9 +109,11 @@ def test_bb_packet_sampling_relativistic(
blackbody_simplesource_relativistic.beta = 0.25

nus = blackbody_simplesource_relativistic.create_packet_nus(100).value
unif_energies = blackbody_simplesource_relativistic.create_packet_energies(
100
).value
unif_energies = (
blackbody_simplesource_relativistic.create_packet_energies(
100
).value
)
blackbody_simplesource_relativistic._reseed(2508)
mus = blackbody_simplesource_relativistic.create_packet_mus(10)

Expand Down

0 comments on commit ef58b05

Please sign in to comment.