From c7bbacf319fc8cbd0738ddada23ef18bb9c3d9de Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 19 Dec 2024 17:36:16 +0000 Subject: [PATCH 1/3] add new pv runvl model --- india_forecast_app/models/all_models.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/india_forecast_app/models/all_models.yaml b/india_forecast_app/models/all_models.yaml index 29d8f36..e914a18 100644 --- a/india_forecast_app/models/all_models.yaml +++ b/india_forecast_app/models/all_models.yaml @@ -32,6 +32,12 @@ models: version: d71104620f0b0bdd3eeb63cafecd2a49032ae0f7 client: ruvnl asset_type: pv + - name: pvnet_india_ecmwf_mo_gfs + type: pvnet + id: openclimatefix/pvnet_india + version: 0561e737765df164b572fa506401995263c6401b + client: ruvnl + asset_type: pv # Ad client solar - name: pvnet_ad_sites type: pvnet From dccebf6402ecc320f0ddae1d641d59030b6e818b Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 19 Dec 2024 17:51:00 +0000 Subject: [PATCH 2/3] update conftest --- tests/conftest.py | 17 ++++++++++++++--- tests/models/test_pydantic_models.py | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 8291877..920de68 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -166,7 +166,7 @@ def generation_db_values(db_session, sites, init_timestamp): def generation_db_values_only_wind(db_session, sites, init_timestamp): """Create some fake generations""" - n = 20*25 # 25 hours of readings + n = 20 * 25 # 25 hours of readings start_times = [init_timestamp - dt.timedelta(minutes=x * 3) for x in range(n)] # remove some of the most recent readings (to simulate missing timestamps) @@ -389,10 +389,21 @@ def nwp_mo_global_data(tmp_path_factory, time_before_present): ds[v].encoding.clear() # change variables values to for MO global - ds.variable.values[0:3] = ["temperature_sl", "wind_u_component_10m", "wind_v_component_10m"] + ds.variable.values[0:10] = [ + "temperature_sl", + "wind_u_component_10m", + "wind_v_component_10m", + "downward_shortwave_radiation_flux_gl", + "cloud_cover_high", + "cloud_cover_low", + "cloud_cover_medium", + "relative_humidity_sl", + "snow_depth_gl", + "visibility_sl", + ] # interpolate 3 hourly step to 1 hour steps - steps = pd.TimedeltaIndex(np.arange(49) * 3600 * 1e9, freq='infer') + steps = pd.TimedeltaIndex(np.arange(49) * 3600 * 1e9, freq="infer") ds = ds.interp(step=steps, method="linear") ds["mo_global"] = xr.DataArray( diff --git a/tests/models/test_pydantic_models.py b/tests/models/test_pydantic_models.py index 73b61be..3f23330 100644 --- a/tests/models/test_pydantic_models.py +++ b/tests/models/test_pydantic_models.py @@ -5,7 +5,7 @@ def test_get_all_models(): """Test for getting all models""" models = get_all_models() - assert len(models.models) == 9 + assert len(models.models) == 10 def test_get_all_models_client(): From f5572d55dd23b9ea6c28a4e3a6afb98984fb3852 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Thu, 19 Dec 2024 18:53:06 +0000 Subject: [PATCH 3/3] update conftest --- tests/conftest.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 920de68..87a35e5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -361,12 +361,9 @@ def nwp_mo_global_data(tmp_path_factory, time_before_present): # Load dataset which only contains coordinates, but no data ds = xr.open_zarr( - f"{os.path.dirname(os.path.abspath(__file__))}/test_data/nwp-no-data_gfs.zarr" + f"{os.path.dirname(os.path.abspath(__file__))}/test_data/nwp-no-data.zarr" ) - # rename dimension init_time_utc to init_time - ds = ds.rename({"init_time_utc": "init_time"}) - # Last t0 to at least 4 hours ago and floor to 3-hour interval t0_datetime_utc = time_before_present(dt.timedelta(hours=0)).floor("3h") t0_datetime_utc = t0_datetime_utc - dt.timedelta(hours=4)