Skip to content

Commit

Permalink
updated keyword arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tjalling-dejong committed Jan 15, 2025
1 parent fc84e2b commit f353f8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions fm2prof/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class GenerateCrossSectionLocationFile(FM2ProfBase):
def __init__(
self,
network_definition_file: str | Path,
crossection_location_file: str | Path,
branchrule_file: str | Path = "",
cross_section_location_file: str | Path,
branch_rule_file: str | Path = "",
) -> None:
"""Generate cross section location file object.
Expand All @@ -143,16 +143,16 @@ def __init__(
"""
super().__init__()

network_definition_file, crossection_location_file, branchrule_file = map(
network_definition_file, cross_section_location_file, branch_rule_file = map(
Path,
[network_definition_file, crossection_location_file, branchrule_file],
[network_definition_file, cross_section_location_file, branch_rule_file],
)

if not network_definition_file.exists():
err_msg = "Network difinition file not found"
raise FileNotFoundError(err_msg)

self._network_definition_file_to_input(network_definition_file, crossection_location_file, branchrule_file)
self._network_definition_file_to_input(network_definition_file, cross_section_location_file, branch_rule_file)

def _parse_network_definition_file(self, network_definition_file: Path, branchrules: dict | None = None) -> dict:
"""Parse network definition file.
Expand Down
14 changes: 7 additions & 7 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_given_networkdefinitionfile_cssloc_file_is_generated(self, tmp_path: Pa
# 2. Set Expectations

# 3. Run test
GenerateCrossSectionLocationFile(network_definition_file=path_1d, crossection_location_file=output_file)
GenerateCrossSectionLocationFile(network_definition_file=path_1d, cross_section_location_file=output_file)

# 4. verify
assert output_file.is_file()
Expand All @@ -37,9 +37,9 @@ def test_given_branchrulefile_output_is_generated(self, tmp_path: Path):

# 3. Run test
GenerateCrossSectionLocationFile(
networkdefinitionfile=path_1d,
crossectionlocationfile=output_file,
branchrulefile=branch_rule_file,
network_definition_file=path_1d,
cross_section_location_file=output_file,
branch_rule_file=branch_rule_file,
)

# 4. verify
Expand All @@ -55,9 +55,9 @@ def test_given_branchrule_exceptions_output_is_generated(self, tmp_path: Path):

# 3. Run test
GenerateCrossSectionLocationFile(
networkdefinitionfile=path_1d,
crossectionlocationfile=output_file,
branchrulefile=branch_rule_file,
network_definition_file=path_1d,
cross_section_location_file=output_file,
branch_rule_file=branch_rule_file,
)

# 4. verify
Expand Down

0 comments on commit f353f8f

Please sign in to comment.