Skip to content

Commit

Permalink
thor support (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbyrohl authored Oct 15, 2024
1 parent e192474 commit 15e06dd
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/scida/helpers_hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,9 @@ def dtps(k, s):
# create groups
for group in sorted(groups):
if group == "/":
continue # nothing to do.
hf.create_group(group)
group = ""
else:
hf.create_group(group)
groupfields = [
field
for field in shapes.keys()
Expand Down
3 changes: 3 additions & 0 deletions tests/customs/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ def test_allunitsdiscovered(testdatapath, caplog):
if "gaia" in testdatapath:
# skip gaia for now; because invalid pint units (like mag) are not yet handled
return
if "thor" in testdatapath:
# no metadata units in thor yet
return
assert (
"Cannot determine units from neither unit file nor metadata" not in caplog.text
)
Expand Down
12 changes: 12 additions & 0 deletions tests/customs/test_thor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from scida.convenience import load
from scida.interface import Dataset
from tests.testdata_properties import require_testdata_path


# for now we do individual photon types (original, peel, input) separately
@require_testdata_path("interface", only=["thor_mcrt/peel"])
def test_mcrt(testdatapath):
ds = load(testdatapath)
assert isinstance(ds, Dataset)
assert len(ds.data.keys()) > 0
print(ds.data.keys())
8 changes: 6 additions & 2 deletions tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def return_intended_stype(name) -> Type[DatasetSeries]:
return SwiftSimulation
elif any(k in name for k in ["tng"]):
return ArepoSimulation
raise ValueError("Have not specified intended type for %s" % name)
print("No intended type found for %s" % name)
return DatasetSeries
# raise ValueError("Have not specified intended type for %s" % name)


def return_intended_dstype(name, simconf=False) -> Type[Dataset]:
Expand Down Expand Up @@ -63,7 +65,9 @@ def return_intended_dstype(name, simconf=False) -> Type[Dataset]:
elif any(k in name for k in ["rockstar"]):
return RockstarCatalog

raise ValueError("Have not specified intended type for %s" % name)
print("No intended type found for %s" % name)
return Dataset
# raise ValueError("Have not specified intended type for %s" % name)


@require_testdata_path("series")
Expand Down
3 changes: 3 additions & 0 deletions tests/testdata.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
testdata:
thor_mcrt/peel:
types:
- interface
TNG50-4:
types:
- series
Expand Down

0 comments on commit 15e06dd

Please sign in to comment.