Skip to content

Commit aa86327

Browse files
langmoreWeatherbench2 authors
authored and
Weatherbench2 authors
committed
--fanout FLAG added to [weatherbench2]/scripts/compute_zonal_energy_spectrum
PiperOrigin-RevId: 575047105
1 parent 58d6f14 commit aa86327

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/compute_zonal_energy_spectrum.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@
9191
' average.'
9292
),
9393
)
94+
FANOUT = flags.DEFINE_integer(
95+
'fanout',
96+
None,
97+
help='Beam CombineFn fanout. Might be required for large dataset.',
98+
)
9499

95100
RUNNER = flags.DEFINE_string('runner', None, 'beam.runners.Runner')
96101

@@ -199,7 +204,7 @@ def main(argv: list[str]) -> None:
199204
)
200205
| xbeam.SplitVariables()
201206
| beam.MapTuple(_strip_offsets)
202-
| xbeam.Mean(AVERAGING_DIMS.value)
207+
| xbeam.Mean(AVERAGING_DIMS.value, fanout=FANOUT.value)
203208
| xbeam.ChunksToZarr(
204209
OUTPUT_PATH.value, template, output_chunks, num_threads=16
205210
)

0 commit comments

Comments
 (0)