Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
30 changes: 30 additions & 0 deletions integration_tests/test_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pytest

# test cases
# 1: num_input_steps > 1, num_steps > 1 (1527)
# => what sources get written (multiple sources without targets?) => test with offset=1
# 2: inference on jepa (1759) (jepa_wael)
# 3: jepa pretraining on era5, finetuning/inference on synop (1736)
# 4: guarantee outputput item is never overwritten (1575)
# 5: allow subsetting (for io) channels used as targets (1705)
# forecast offset 0/1
# predictions without targets/sources
# allow incremental writes
# allow non continouos fsteps
# always have source at fstep=0




@pytest.fixture
def output_items():
pass

def test_target_source_identity(offset):
pass

def test_time_coordinates(output_items):
pass

def test_spatial_coordinates(output_items):
pass
9 changes: 7 additions & 2 deletions packages/common/src/weathergen/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,14 @@ def load_streams(streams_directory: Path) -> list[Config]:
return list(streams.values())


def get_path_run(config: Config) -> Path:
def get_path_run(config: Config | None = None, run_id: str | None = None) -> Path:
"""Get the current runs results_path for storing run results and logs."""
return _get_shared_wg_path() / "results" / get_run_id_from_config(config)
if config or run_id:
run_id = run_id if run_id else get_run_id_from_config(config)
else:
msg = f"Missing run_id and cannot infer it from config: {config}"
raise ValueError(msg)
return _get_shared_wg_path() / "results" / run_id


def get_path_model(config: Config | None = None, run_id: str | None = None) -> Path:
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/weathergen/common/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ def __init__(
self._append_dataset(self.source, "source")

if self.key.with_target(forecast_offset):
# TODO requiring target data currently prevents predictions with unknowable target
self._append_dataset(self.target, "target")
self._append_dataset(self.prediction, "prediction")

Expand Down
Loading
Loading