-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from Deltares/feature/107-as-a-developer-i-wa…
…nt-the-network-to-be-a-data-class feat: Added dataclass to represent the Network configuration input da…
- Loading branch information
Showing
139 changed files
with
2,127 additions
and
1,864 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
ra2ce/analyses/analysis_config_data/analysis_config_data_validator_with_network.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from ra2ce.analyses.analysis_config_data.analysis_config_data import ( | ||
AnalysisConfigDataWithNetwork, | ||
) | ||
from ra2ce.analyses.analysis_config_data.analysis_config_data_validator_without_network import ( | ||
AnalysisConfigDataValidatorWithoutNetwork, | ||
) | ||
from ra2ce.common.validation.ra2ce_validator_protocol import Ra2ceIoValidator | ||
from ra2ce.common.validation.validation_report import ValidationReport | ||
|
||
|
||
class AnalysisConfigDataValidatorWithNetwork(Ra2ceIoValidator): | ||
def __init__(self, config_data: AnalysisConfigDataWithNetwork) -> None: | ||
self._config = config_data | ||
|
||
def validate(self) -> ValidationReport: | ||
_base_report = AnalysisConfigDataValidatorWithoutNetwork( | ||
self._config | ||
).validate() | ||
_output_network_dir = self._config.get("output", None) | ||
if ( | ||
not _output_network_dir | ||
or not (_output_network_dir / "network.ini").is_file() | ||
): | ||
_base_report.error( | ||
f"The configuration file 'network.ini' is not found at {_output_network_dir}." | ||
f"Please make sure to name your network settings file 'network.ini'." | ||
) | ||
return _base_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.