You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it just me or does the filter method for nodes and reaches not work when trying to load a Res1D file?
From your class Res1D in res1d.py file, line 90-98, there is written:
Examples
--------
An example of reading the res1d file only for nodes with
ID 'node1', 'node2' and reaches with ID 'reach1', 'reach2':
>>> nodes = ['node1', 'node2']
>>> reaches = ['reach1', 'reach2']
>>> res1d = Res1D('MyRes1D.res1d', nodes=nodes, reaches=reaches)
>>> res1d.read()
However, when I try to filter by nodes and reaches in my huge Res1D file, it still loads the entire dataset.
So, I got a variable selection which is a dict with keys as Node and Link, holding a list of names.
from mikeio1d import Res1D
file_path = 'my_model_result.res1d'
model_result = Res1D(file_path=file_path,nodes=selection['Node'],reaches=selection['Link'])
The Node and Link attributes holds a list with 3053 and 3080 name values, respectively. However, when the result is loaded, and I type out model_result.nodes or model_result.reaches, it will make a count of 20663 and 20756 records, respectively.
Is it not supposed to ONLY load the filtered name values? Or am I missing something here?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi, the are two kinds of data in a res1d file: static (information about a network, etc.) and dynamic (time series). The filter option filters out the loading of dynamic data, but creates all the information related to the static data. So you get all the attributes for nodes and links, like its geometric information. But the time time series is loaded only for filtered nodes and link.
For Python auto-completion we could consider to also assign only filtered information. In either case I can see that we can improve the comments of this functionality.
Hi there.
Is it just me or does the filter method for
nodes
andreaches
not work when trying to load a Res1D file?From your class
Res1D
inres1d.py
file, line 90-98, there is written:However, when I try to filter by nodes and reaches in my huge
Res1D
file, it still loads the entire dataset.So, I got a variable
selection
which is adict
with keys asNode
andLink
, holding a list of names.The
Node
andLink
attributes holds a list with 3053 and 3080 name values, respectively. However, when the result is loaded, and I type outmodel_result.nodes
ormodel_result.reaches
, it will make a count of 20663 and 20756 records, respectively.Is it not supposed to ONLY load the filtered name values? Or am I missing something here?
Thanks in advance!
The text was updated successfully, but these errors were encountered: