Skip to content

Commit

Permalink
Revert runoff file name templates config
Browse files Browse the repository at this point in the history
To avoid disrupting automation for v201905 production.
  • Loading branch information
douglatornell committed May 18, 2023
1 parent 1d0d204 commit 76ae435
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion config/nowcast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ rivers:
b201702: /SalishSeaCast/rivers-climatology/rivers_month_201702.nc
# Templates for the runoff forcing file name
# **Must be quoted to project {} characters**
file template: "R201702DFraCElse_{:y%Ym%md%d}.nc"
# TODO: collapse to single item for v202111; b201702 key not required
file templates:
b201702: "R201702DFraCElse_{:y%Ym%md%d}.nc"
# Module containing dictionary of the proportions that each river occupies in its watershed
prop_dict module: salishsea_tools.river_201702
turbidity:
Expand Down
5 changes: 3 additions & 2 deletions tests/workers/test_make_forcing_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,10 @@ def test_ssh_dir(self, host, ssh_dir, prod_config):
prod_config["run"]["enabled hosts"][host]["forcing"]["ssh dir"] == ssh_dir
)

def test_rivers_file_template(self, prod_config):
def test_rivers_file_templates(self, prod_config):
assert (
prod_config["rivers"]["file template"] == "R201702DFraCElse_{:y%Ym%md%d}.nc"
prod_config["rivers"]["file templates"]["b201702"]
== "R201702DFraCElse_{:y%Ym%md%d}.nc"
)

@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion tests/workers/test_make_runoff_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_message_types(self, msg, prod_config):

def test_rivers_sections(self, prod_config):
rivers = prod_config["rivers"]
assert rivers["file template"] == "R201702DFraCElse_{:y%Ym%md%d}.nc"
assert rivers["file templates"]["b201702"] == "R201702DFraCElse_{:y%Ym%md%d}.nc"
assert rivers["rivers dir"] == "/results/forcing/rivers/"
assert rivers["prop_dict module"] == "salishsea_tools.river_201702"
assert (
Expand Down
2 changes: 1 addition & 1 deletion tests/workers/test_upload_forcing.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def test_fraser_turbidity_uploads(self, host, expected, prod_config):
)
def test_river_runoff_uploads(self, host, expected, prod_config):
rivers = prod_config["rivers"]
assert rivers["file template"] == "R201702DFraCElse_{:y%Ym%md%d}.nc"
assert rivers["file templates"]["b201702"] == "R201702DFraCElse_{:y%Ym%md%d}.nc"
assert rivers["rivers dir"] == "/results/forcing/rivers/"
host_config = prod_config["run"]["enabled hosts"][host]
assert host_config["forcing"]["rivers dir"] == expected
Expand Down

0 comments on commit 76ae435

Please sign in to comment.