-
Notifications
You must be signed in to change notification settings - Fork 6
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 #75 from DHI/feature/merge_res1d
Merging of regular and LTS extreme/periodic res1d files
- Loading branch information
Showing
20 changed files
with
969 additions
and
16 deletions.
There are no files selected for viewing
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
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,44 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from typing import List | ||
|
||
from System.Collections.Generic import List as DotNetList | ||
from System import String | ||
|
||
from DHI.Mike1D.MikeIO import ResultMerger as Res1DResultMerger | ||
|
||
|
||
class ResultMerger: | ||
""" | ||
Wrapper class for merging res1d result files. | ||
Parameters | ||
---------- | ||
file_names : list of str | ||
List of res1d file names to merge. | ||
""" | ||
|
||
def __init__(self, file_names: List[str]): | ||
self.file_names = file_names | ||
|
||
def merge(self, merged_file_name: str): | ||
""" | ||
Merges the data from in file_names to a file | ||
specified by merged_file_name. | ||
Parameters | ||
---------- | ||
merged_file_name : str | ||
File name of the res1d file to store the merged data. | ||
""" | ||
file_names_dotnet = self._get_file_name_dotnet() | ||
Res1DResultMerger.Merge(file_names_dotnet, merged_file_name) | ||
|
||
def _get_file_name_dotnet(self): | ||
file_names_dotnet = DotNetList[String]() | ||
for file_name in self.file_names: | ||
file_names_dotnet.Add(file_name) | ||
return file_names_dotnet |
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
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
Binary file not shown.
Binary file not shown.
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.