Skip to content

Commit

Permalink
now using to_parquet_row_groups and tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
zbilodea committed Feb 1, 2024
1 parent eac58a7 commit ae761b0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/test_root_to_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ def HZZ_test():
original = f["events"].arrays()
od.root_to_parquet(
in_file=skhep_testdata.data_path("uproot-HZZ.root"),
out_file="test.parquet",
out_file="/Users/zobil/Documents/odapt/test.parquet",
step_size="100 MB",
force=True,
)
from_parquet = ak.from_parquet("/Users/zobil/Documents/odapt/test.parquet")
for key in f["events"].keys():
assert ak.all(from_parquet[0][key] == original[key])
assert ak.all(from_parquet[key] == original[key])


def specify_tree():
Expand All @@ -35,7 +35,7 @@ def specify_tree():
)
from_parquet = ak.from_parquet("/Users/zobil/Documents/odapt/test.parquet")
for key in f["events"].keys():
assert ak.all(from_parquet[0][key] == original[key])
assert ak.all(from_parquet[key] == original[key])


def Zmumu_test():
Expand All @@ -48,10 +48,10 @@ def Zmumu_test():
)
from_parquet = ak.from_parquet("/Users/zobil/Documents/odapt/test1.parquet")
for key in f["events"].keys():
assert ak.all(from_parquet[0][key] == original[key])
assert ak.all(from_parquet[key] == original[key])


def break_trees():
def no_trees():
with pytest.raises(AttributeError):
od.root_to_parquet(
in_file=skhep_testdata.data_path("uproot-hepdata-example.root"),
Expand All @@ -60,4 +60,10 @@ def break_trees():
)


HZZ_test()
def two_trees():
with pytest.raises(AttributeError):
od.root_to_parquet(
in_file=skhep_testdata.data_path("uproot-hepdata-example.root"),
out_file="test2.parquet",
step_size="100 MB",
)

0 comments on commit ae761b0

Please sign in to comment.