Skip to content

Commit 8553023

Browse files
committed
Merge branch 'develop'
2 parents 0e8ca2c + 56f99ff commit 8553023

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ requires = [
1919
name = "ai-models-gencast"
2020

2121
description = "An ai-models plugin to run Deepmind's gencast model"
22+
readme = "README.md"
2223
keywords = [
2324
"ai",
2425
"tools",

src/ai_models_gencast/model.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import functools
1111
import gc
1212
import logging
13+
import math
1314
import os
1415
import warnings
1516
from contextlib import nullcontext
@@ -336,8 +337,11 @@ def get_path(filename):
336337
pmap_devices=jax.local_devices(),
337338
)
338339
):
339-
time_step = (i % (self.lead_time // self.hour_steps)) + 1
340-
ensemble_chunk = ((i // (self.lead_time // self.hour_steps))) * len(jax.local_devices())
340+
341+
num_steps = math.ceil(self.lead_time / self.hour_steps)
342+
343+
time_step = (i % num_steps) + 1
344+
ensemble_chunk = ((i // num_steps)) * len(jax.local_devices())
341345
member_number_subset = self.member_number[
342346
ensemble_chunk : ensemble_chunk + len(jax.local_devices())
343347
]

0 commit comments

Comments
 (0)