Exemple #1
0
 def _load_file(self):
     """Load the file."""
     if not os.path.exists(self.file_path):
         raise FileExistsError(f"File {self.file_path} does not exist.")
     self.file = CrossSectionDataFactory().Open(
         Connection.Create(self.file_path),
         Diagnostics("Error loading file."))
     self._closed = False
def CreateMike1DData(inputFileName, simulationId=None):
    diagnostics = Diagnostics("Export diagnostics")
    connection = CreateConnection(inputFileName, simulationId)

    mike1DBridge = Mike1DBridge()
    mike1DData = mike1DBridge.Open(connection, diagnostics)

    return mike1DData
Exemple #3
0
    def _load_file(self):
        if not os.path.exists(self.file_path):
            raise FileExistsError(f"File {self.file_path} does not exist.")

        self._data = ResultData()
        self._data.Connection = Connection.Create(self.file_path)
        self._data.Load(Diagnostics())
        self._query = ResultDataQuery(self._data)
Exemple #4
0
    def __init__(self, filename, useFilter=None, outputDataItem=True):
        # Load result file
        self.diagnostics = Diagnostics("Loading file")
        self.resultData = ResultData()
        self.resultData.Connection = Connection.Create(filename)
        self.useFilter = useFilter
        self.outputDataItem = outputDataItem

        if useFilter:
            self.SetupFilter()
        else:
            self.Load()

        # Searcher is helping to find reaches, nodes and catchments
        self.searcher = ResultDataSearch(self.resultData)
Exemple #5
0
    def _load_header(self):
        if not os.path.exists(self.file_path):
            raise FileExistsError(f"File {self.file_path} does not exist.")

        self._data = ResultData()
        self._data.Connection = Connection.Create(self.file_path)
        self._diagnostics = Diagnostics("Loading header")

        if self._lazy_load:
            self._data.Connection.BridgeName = "res1dlazy"

        if self._use_filter:
            self._data.LoadHeader(True, self._diagnostics)
        else:
            self._data.LoadHeader(self._diagnostics)