From f6a7cd07e99e750f4dbbfe0b966c66434180a1d3 Mon Sep 17 00:00:00 2001 From: Henry Addison Date: Fri, 2 Aug 2024 11:20:27 +0100 Subject: [PATCH] compress samples on disk in predict.py --- bin/predict.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/predict.py b/bin/predict.py index cf73a50d2..edf61de0c 100644 --- a/bin/predict.py +++ b/bin/predict.py @@ -276,6 +276,8 @@ def main( output_filepath = output_dirpath / f"predictions-{shortuuid.uuid()}.nc" logger.info(f"Saving samples to {output_filepath}...") + for varname in xr_samples.data_vars: + xr_samples[varname].encoding.update(zlib=True, complevel=5) xr_samples.to_netcdf(output_filepath)