Skip to content

Commit

Permalink
Update make_live_ocean_files re: single filepath
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
douglatornell committed Jun 6, 2024
1 parent b1fdb81 commit 600f13d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions nowcast/workers/make_live_ocean_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ 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,
bc_dir=bc_dir,
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


Expand Down
4 changes: 2 additions & 2 deletions tests/workers/test_make_live_ocean_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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)
Expand Down

0 comments on commit 600f13d

Please sign in to comment.