Skip to content

Commit 37b6382

Browse files
committed
Add timer to constant replacement
1 parent 8c5e85d commit 37b6382

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/ai_models_gencast/model.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,12 @@ def run(self):
280280
def get_path(filename):
281281
return os.path.join(self.assets, filename)
282282

283-
training_xarray["land_sea_mask"].values = np.load(get_path(self.download_masks[1]))
284-
training_xarray["geopotential_at_surface"].values = np.load(get_path(self.download_masks[0]))
283+
with self.timer("Replacing constants"):
284+
training_xarray["land_sea_mask"].values = np.load(get_path(self.download_masks[1]))
285+
training_xarray["geopotential_at_surface"].values = np.load(get_path(self.download_masks[0]))
285286

286-
sst_mask = np.load(get_path(self.download_masks[2])) == False # noqa: E712
287-
training_xarray["sea_surface_temperature"] = training_xarray["sea_surface_temperature"].where(sst_mask)
287+
sst_mask = np.load(get_path(self.download_masks[2])) == False # noqa: E712
288+
training_xarray["sea_surface_temperature"] = training_xarray["sea_surface_temperature"].where(sst_mask)
288289

289290
gc.collect()
290291

0 commit comments

Comments
 (0)