Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Sep 8, 2023
1 parent 0c30040 commit f737f24
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tardis/montecarlo/tests/test_packet_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
montecarlo_configuration as montecarlo_configuration,
)

class TestPacketSource():

class TestPacketSource:
@pytest.fixture(scope="class")
def packet_unit_test_fpath(self, tardis_ref_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 All @@ -22,7 +25,13 @@ def blackbodysimplesource(self, request):
yield cls.bb
montecarlo_configuration.LEGACY_MODE_ENABLED = False

def test_bb_packet_sampling(self, request, tardis_ref_data, packet_unit_test_fpath, blackbodysimplesource):
def test_bb_packet_sampling(
self,
request,
tardis_ref_data,
packet_unit_test_fpath,
blackbodysimplesource,
):
if request.config.getoption("--generate-reference"):
ref_bb = pd.read_hdf(packet_unit_test_fpath, key="/blackbody")
ref_bb.to_hdf(
Expand All @@ -37,4 +46,4 @@ def test_bb_packet_sampling(self, request, tardis_ref_data, packet_unit_test_fpa
unif_energies = self.bb.create_packet_energies(100)
assert np.all(np.isclose(nus, ref_df["nus"]))
assert np.all(np.isclose(mus, ref_df["mus"]))
assert np.all(np.isclose(unif_energies, ref_df["energies"]))
assert np.all(np.isclose(unif_energies, ref_df["energies"]))

0 comments on commit f737f24

Please sign in to comment.