-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My swmmio 0.4.3 failed to read rpt file. #97
Comments
I tried my code in differnt computers and kept all the dependencies with same versions. Resutls suggested that this read failure could be caused by swmmio 0.4.3. When I changed all my swmmio into version 0.4.2, they all worked well. |
@xiang3874264 can you provide sample data (the model and results, or a portion of it) that can be used to reproduce this error? Maybe we need to expand our CI unit tests to include more architectures. |
I have tested some different .inp files to exclude the potential error caused by the .inp file. This .inp file can be an example. The .rpt file was got by the swmm5 downloaded from from the epa official website, with a version of 5.1.14 I tried to read the .inp and .rpt files in my path using swmmio 0.4.2. The code is as follows:
where I got a However, when I use swmmio 0.4.3 or 0.4.4 to execute the same code, I only got a n with a size of [5 rows x 9 columns]. The .rpt information doesn't involved in I don't know whether the inconsistency is caused by the some new features of swmmio. @aerispaha. |
Hi @xiang3874264. I finally had some time to track down what is going on here. The change that you're observing seems to be due to this change to the elements.ModelSection, elements.Nodes ObjectsThe objects within Because there are many pieces of data within inp/rpt files that are associated with a particular model element (e.g. coordinates, MaxTotalInflow, InvertElev), and because several of these pieces of data can have the same name (e.g. Time of Max Occurence in the Node Depth Summary and Node Inflow Summary), we've had to make some decision on what should be provided by default by these higher-level abstractions. These default settings are supposed to be reflected by what's in the Here, the That being said, it seems to me that the current WorkaroundOne way to get exactly what you want from all sections of the SWMM5 model is to use the from swmmio import Model, Nodes
m = Model("D:\\Working\\test")
# pass custom init arguments into the Nodes object instead of using default settings referenced by m.nodes()
nodes = Nodes(
model=m,
inp_sections=['junctions', 'storages', 'outfalls'],
rpt_sections=['Node Depth Summary', 'Node Inflow Summary'],
columns=[ 'InvertElev', 'MaxDepth', 'InitDepth', 'SurchargeDepth', 'MaxTotalInflow', 'coords']
)
# access data (same as nodes())
df = nodes.dataframe If you want all columns from all sections, omit the Proposed FixI think we need to decide what should be provided by default by higher level abstractions like m.nodes(). An easy solution for Another option is to the What do you think? |
I install my swmmio by the pip way. My python version is 3.7.7 (x64), and the platform is windows 7 (x64)
I used
swmmio.Model
to read my swmm files (.inp, .rpt), but is could only read .inp file in.I tried to read the same files in my windows10 PC (also with python 3.7.7), and the .rpt was read correctly.
The text was updated successfully, but these errors were encountered: