Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ci to balfrin #15

Merged
merged 4 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
move dataset
  • Loading branch information
cfkanesan committed May 22, 2024
commit c3f3c1876ae749e671eaa032a6ae34757637c0bc
4 changes: 2 additions & 2 deletions src/meteodatalab/data/fdb_config_balfrin.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
type: local
engine: toc
schema: /scratch/mch/ckanesan/fdb-setup/fdb-schema
schema: /store_new/mch/msopr/icon_workflow_2/fdb-schema
spaces:
- handler: Default
roots:
- path: /scratch/mch/ckanesan/fdb_32_39x45_51/
- path: /store_new/mch/msopr/icon_workflow_2/fdb_32_39x45_51/
28 changes: 22 additions & 6 deletions tests/test_meteodatalab/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,42 @@ def machine():


@pytest.fixture
def data_dir(request, machine):
def unpack(work_dir: Path):
def f(path: Path) -> Path:
src = path.with_suffix(".tar.gz")
if not src.exists():
return path
dst = work_dir
tgt = dst / path.name
if tgt.exists():
return tgt
subprocess.run(["tar", "-xf", str(src), "-C", str(dst)], check=True)
return tgt

return f


@pytest.fixture
def data_dir(request, machine, unpack):
"""Base data dir."""
if machine == "tsa":
base_dir = Path("/project/s83c/rz+/icon_data_processing_incubator/")
elif machine == "balfrin":
base_dir = Path("/scratch/mch/ckanesan/")
base_dir = Path("/store_new/mch/msopr/icon_workflow_2/")
else:
return None
marker = request.node.get_closest_marker("data")
if marker is None:
return base_dir / "datasets/32_39x45_51"
return unpack(base_dir / "datasets/32_39x45_51")
match marker.args[0]:
case "original":
return base_dir / "datasets/original"
case "reduced":
return base_dir / "datasets/32_39x45_51"
return unpack(base_dir / "datasets/32_39x45_51")
case "reduced-time":
return base_dir / "datasets/32_39x45_51/COSMO-1E_time"
return unpack(base_dir / "datasets/32_39x45_51") / "COSMO-1E_time"
case "reduced-ens":
return base_dir / "datasets/32_39x45_51/COSMO-1E_ens"
return unpack(base_dir / "datasets/32_39x45_51") / "COSMO-1E_ens"
case "flexpart":
return base_dir / "data/flexpart"
raise RuntimeError(f"No match for data mark {marker.args[0]}")
Expand Down
Loading