From 10686553101b81a5c7b01f89d264f005431b7d6f Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Tue, 29 Oct 2024 17:17:41 -0500 Subject: [PATCH] Fix filename produced by extrap_woa test case The filename now indicates that it is for January (`_jan`) and includes a datestamp. --- compass/ocean/tests/utility/extrap_woa/extrap_step.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compass/ocean/tests/utility/extrap_woa/extrap_step.py b/compass/ocean/tests/utility/extrap_woa/extrap_step.py index 9e07db0ac1..38b14f951f 100644 --- a/compass/ocean/tests/utility/extrap_woa/extrap_step.py +++ b/compass/ocean/tests/utility/extrap_woa/extrap_step.py @@ -1,4 +1,5 @@ import os +from datetime import datetime from functools import partial from multiprocessing import Pool @@ -48,7 +49,9 @@ def setup(self): """ Determine the output filename """ - self.woa_filename = 'woa23_decav_0.25_extrap.nc' + now = datetime.now() + datestring = now.strftime("%Y%m%d") + self.woa_filename = f'woa23_decav_0.25_jan_extrap.{datestring}.nc' self.add_output_file(self.woa_filename) def run(self): @@ -162,7 +165,7 @@ def _extrap_vert(self, use_ocean_mask): out_filename = 'extrap_ocean/woa_extrap.nc' else: in_filename = 'extrap_land/woa_extrap_horiz.nc' - out_filename = 'woa23_decav_0.25_extrap.nc' + out_filename = self.woa_filename ds = xr.open_dataset(in_filename)