From 4600c0b4b20964826fb50057a781019af8c97ab4 Mon Sep 17 00:00:00 2001 From: FERREIRA mathilde Date: Tue, 18 Nov 2025 11:06:07 +0100 Subject: [PATCH 1/2] fix the selected forcing time step added to the model's output --- py4cast/lightning.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py4cast/lightning.py b/py4cast/lightning.py index 5cc313c3..808d6d18 100644 --- a/py4cast/lightning.py +++ b/py4cast/lightning.py @@ -610,9 +610,7 @@ def _common_step( ) elif ds: # update the coarse forcings with our netwwork output - last_coarse_step = batch.forcing.select_tensor_dim( - "timestep", -1 - ).clone() + last_coarse_step = batch.forcing.select_dim("timestep", i).tensor.clone() if self.mask_on_nan: last_coarse_step = torch.nan_to_num(last_coarse_step, nan=0) # only add common features From adf4be8289563ab17b1f6b0a5adb303e0250a670 Mon Sep 17 00:00:00 2001 From: FERREIRA mathilde Date: Tue, 18 Nov 2025 11:11:13 +0100 Subject: [PATCH 2/2] reformat --- py4cast/lightning.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py4cast/lightning.py b/py4cast/lightning.py index 808d6d18..6ad2700c 100644 --- a/py4cast/lightning.py +++ b/py4cast/lightning.py @@ -610,7 +610,9 @@ def _common_step( ) elif ds: # update the coarse forcings with our netwwork output - last_coarse_step = batch.forcing.select_dim("timestep", i).tensor.clone() + last_coarse_step = batch.forcing.select_dim( + "timestep", i + ).tensor.clone() if self.mask_on_nan: last_coarse_step = torch.nan_to_num(last_coarse_step, nan=0) # only add common features