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

only make data fixtures once #153

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion pvnet_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def app(
# Store the config filename so we can create batches suitable for all models
data_config_paths.append(data_config_path)
else:
warnings.warn(f"The model {model_config.name} cannot be run with input data available")
message = f"The model {model_config.name} cannot be run with input data available"
warnings.warn(message)

if len(forecast_compilers) == 0:
raise Exception(f"No models were compatible with the available input data.")
Expand Down
14 changes: 7 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

xr.set_options(keep_attrs=True)

@pytest.fixture()
@pytest.fixture(scope="module")
def test_t0():
return pd.Timestamp.now(tz=None).floor(timedelta(minutes=30))

Expand Down Expand Up @@ -115,7 +115,7 @@ def make_nwp_data(shell_path, varname, test_t0):
return ds


@pytest.fixture
@pytest.fixture(scope="module")
def nwp_ukv_data(test_t0):
return make_nwp_data(
shell_path=f"{os.path.dirname(os.path.abspath(__file__))}/test_data/nwp_ukv_shell.zarr",
Expand All @@ -124,7 +124,7 @@ def nwp_ukv_data(test_t0):
)


@pytest.fixture
@pytest.fixture(scope="module")
def nwp_ecmwf_data(test_t0):
return make_nwp_data(
shell_path=f"{os.path.dirname(os.path.abspath(__file__))}/test_data/nwp_ecmwf_shell.zarr",
Expand Down Expand Up @@ -168,20 +168,20 @@ def make_sat_data(test_t0, delay_mins, freq_mins):

return ds

@pytest.fixture()
@pytest.fixture(scope="module")
def sat_5_data(test_t0):
return make_sat_data(test_t0, delay_mins=10, freq_mins=5)

@pytest.fixture()
@pytest.fixture(scope="module")
def sat_5_data_zero_delay(test_t0):
return make_sat_data(test_t0, delay_mins=0, freq_mins=5)

@pytest.fixture()
@pytest.fixture(scope="module")
def sat_5_data_delayed(test_t0):
return make_sat_data(test_t0, delay_mins=120, freq_mins=5)


@pytest.fixture()
@pytest.fixture(scope="module")
def sat_15_data(test_t0):
return make_sat_data(test_t0, delay_mins=0, freq_mins=15)

Expand Down
Loading