From 0d64ff712d21ffb9ff8d557258187831eec97d64 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Tue, 19 Nov 2024 16:03:15 +0100 Subject: [PATCH] fix calendar fix temp path --- src/rook/utils/decadal_fixes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rook/utils/decadal_fixes.py b/src/rook/utils/decadal_fixes.py index 686f325..a5a75b0 100644 --- a/src/rook/utils/decadal_fixes.py +++ b/src/rook/utils/decadal_fixes.py @@ -147,7 +147,7 @@ def decadal_fix_calendar(ds_id, ds, output_dir=None): ds.time.encoding["calendar"] = "standard" # need to write and read file to rewrite time dimension for the standard calendar! tmp_dir = tempfile.TemporaryDirectory(dir=output_dir) - fixed_nc = os.path.join(tmp_dir, "fixed_calendar.nc") + fixed_nc = os.path.join(tmp_dir.name, "fixed_calendar.nc") ds.to_netcdf(fixed_nc) ds = open_xr_dataset(fixed_nc) tmp_dir.cleanup()