From 600f13da94a319f0881b3a71e59513f9c4b199f6 Mon Sep 17 00:00:00 2001 From: Doug Latornell Date: Thu, 6 Jun 2024 09:30:59 -0700 Subject: [PATCH] Update make_live_ocean_files re: single filepath `salishsea_tools.LiveOcean_BCs.create_LiveOcean_TS_BCs()` returns a single filepath not a list of filepaths. As a result of this change, the related logging message and checklist assignment have been updated and corresponding test cases have been adjusted as well. --- nowcast/workers/make_live_ocean_files.py | 6 +++--- tests/workers/test_make_live_ocean_files.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nowcast/workers/make_live_ocean_files.py b/nowcast/workers/make_live_ocean_files.py index 14780605..31e685ce 100644 --- a/nowcast/workers/make_live_ocean_files.py +++ b/nowcast/workers/make_live_ocean_files.py @@ -77,7 +77,7 @@ def make_live_ocean_files(parsed_args, config, *args): LO_to_SSC_parameters = LiveOcean_parameters.set_parameters( config["temperature salinity"]["parameter set"] ) - filepaths = create_LiveOcean_TS_BCs( + filepath = create_LiveOcean_TS_BCs( ymd, file_template=file_template, meshfilename=meshfilename, @@ -85,8 +85,8 @@ def make_live_ocean_files(parsed_args, config, *args): LO_dir=download_dir, LO_to_SSC_parameters=LO_to_SSC_parameters, ) - logger.info(f"Stored T&S western boundary conditions file: {filepaths[0]}") - checklist = {"temperature & salinity": filepaths[0]} + logger.info(f"Stored T&S western boundary conditions file: {filepath}") + checklist = {"temperature & salinity": filepath} return checklist diff --git a/tests/workers/test_make_live_ocean_files.py b/tests/workers/test_make_live_ocean_files.py index c63cf5f6..6606ea1d 100644 --- a/tests/workers/test_make_live_ocean_files.py +++ b/tests/workers/test_make_live_ocean_files.py @@ -180,7 +180,7 @@ def test_checklist(self, m_create_ts, m_set_params, config, caplog): filename = config["temperature salinity"]["file template"].format( run_date.datetime ) - m_create_ts.return_value = [filename] + m_create_ts.return_value = filename checklist = make_live_ocean_files.make_live_ocean_files(parsed_args, config) assert checklist == {"temperature & salinity": filename} @@ -191,7 +191,7 @@ def test_log_messages(self, m_create_ts, m_set_params, config, caplog): filename = config["temperature salinity"]["file template"].format( run_date.datetime ) - m_create_ts.return_value = [filename] + m_create_ts.return_value = filename caplog.set_level(logging.DEBUG) make_live_ocean_files.make_live_ocean_files(parsed_args, config)