Skip to content

Commit

Permalink
Update other tests to use 2023 data
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardo-rodrigues committed Jul 3, 2023
1 parent 9db36cf commit cf3374c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions tests/particle/test_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@
three_charge,
)

FILES = ["particle2021.csv", "particle2022.csv"]
FILES = ["particle2022.csv", "particle2023.csv"]


def test_generate(tmp_path):
"This verifies that the input and output files match."

particle2021 = tmp_path / "particle2021.csv"
particle2022 = tmp_path / "particle2022.csv"
particle2023 = tmp_path / "particle2023.csv"

produce_files(particle2021, particle2022, "DUMMY", "2022")
produce_files(particle2022, particle2023, "DUMMY", "2023")

particle2022_data = data.basepath / "particle2022.csv"
with particle2022.open() as src, particle2022_data.open() as res:
particle2023_data = data.basepath / "particle2023.csv"
with particle2023.open() as src, particle2023_data.open() as res:
src_filtered = [line for line in src.readlines() if not line.startswith("#")]
res_filtered = [line for line in res.readlines() if not line.startswith("#")]
assert src_filtered == res_filtered
Expand Down
6 changes: 3 additions & 3 deletions tests/particle/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@


def test_load_particle_table(benchmark):
benchmark(Particle.load_table, data.basepath / "particle2022.csv")
benchmark(Particle.load_table, data.basepath / "particle2023.csv")


def test_load_nuclei_append(benchmark):
def load_two():
Particle.load_table(data.basepath / "particle2022.csv")
Particle.load_table(data.basepath / "particle2023.csv")
Particle.load_table(data.basepath / "nuclei2022.csv", append=True)

benchmark(load_two)


def test_from_pdgid(benchmark):
Particle.load_table(data.basepath / "particle2022.csv")
Particle.load_table(data.basepath / "particle2023.csv")
table = [int(s.pdgid) for s in Particle.all()]

def get_all(listing):
Expand Down

0 comments on commit cf3374c

Please sign in to comment.