Giter VIP home page Giter VIP logo

swmmtoolbox's Introduction

swmmtoolbox's People

Contributors

bbuzz31 avatar deepsourcebot avatar kakila avatar timcera avatar timothycera-noaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

swmmtoolbox's Issues

"extract" method should be updated

Hello,

result = pd.concat(jtsd, axis=1, join_axes=[jtsd[0].index])

seem to be not supported any more in Pandas ja yields an error "concat() got an unexpected keyword argument 'join_axes'"

If I substituted the row with:

result = pd.concat(jtsd, axis=1).reindex(jtsd[0].index)

this seems to work fine and no error is thrown! Please check and change the code if neccesary.

Using extract with multiple labels

Can you provide me with an example of calling extract with multiple labels? I can get one set of labels to work, but not multiple ones, even though I have tried a variety of different formats.

These for work:
df = swmmtoolbox.extract(swmm_output_file_path, 'node,node_0,Total_inflow')
df = swmmtoolbox.extract(swmm_output_file_path, ['node,node_0,Total_inflow'])

But these don't:
df = swmmtoolbox.extract(swmm_output_file_path, 'node,node_0,Total_inflow node,node_1,Total_inflow')
df = swmmtoolbox.extract(swmm_output_file_path, [['node,node_0,Total_inflow'], ['node,node_1,Total_inflow']])

results extract is not the same with the results show up in SWMM5

Hi Tim.
I use your swmmtoolbox to extract my SWMM5 output.
However i found that the extracted results from swmmtoolbox is not the samw with results showing in the program.
I want to extract the Node flooding (which is in the summary Results) during the time series of each nodes.

What i did with SWMM:
I run the model and create the time series by objects, i chose 1 node that supposed to be flooded
With the swmmtoolbox i did it in jupyter notebook:
from swmmtoolbox import swmmtoolbox as sw
filename = 'D:\***\15.10.out'
g = sw.extract(filename,[['node','N31-17-1', '']])
g.to_excel(r'abc_2.xlsx')

Then i compare that timeseries made by SWMM with the time series which create by swmmtoolbox
And it is not fit with each other.

This is the result from the model (the starting time)
Table - Node N31-17-1
Depth Head Volume Lateral Inflow Total Inflow Flooding
Days Hours (m) (m) (m3) (CMS) (CMS) (CMS)
0 00:01:00 0.00 5.77 0.00 0.00 0.00 0.00

node_N31-17-1_Depth_above_invert	node_N31-17-1_Hydraulic_head	node_N31-17-1_Volume_stored_ponded	node_N31-17-1_Lateral_inflow	node_N31-17-1_Total_inflow	node_N31-17-1_Flow_lost_flooding

2020-10-14 00:01:00 0.000103365 5.773803711 0 2.41268E-05 2.82158E-05 0

So, as we can se that only the Head is fit, but the Depth and the other are not.
I come further than that, then even the head completely is not fit.

Table - Node N31-17-1
Depth Head Volume Lateral Inflow Total Inflow Flooding
Days Hours (m) (m) (m3) (CMS) (CMS) (CMS)
1 18:37:00 1.34 7.12 58.23 0.00 0.10 0.04

node_N31-17-1_Depth_above_invert node_N31-17-1_Hydraulic_head node_N31-17-1_Volume_stored_ponded node_N31-17-1_Lateral_inflow node_N31-17-1_Total_inflow node_N31-17-1_Flow_lost_flooding
2020-10-15 18:37:00 0.391102254 6.164802551 0 8.8702E-05 0.006102621 0

i dont know if i run the code wrong?
I use the CMS flow units in the model.

Thank you !

Incorrect "system,_,_" labels should error

Right now an inconsistent input will just report a time-series of zeros.

outflow = swmmtoolbox.extract(filename, 'system,Flow_leaving_outfalls,1')

Should error instead gives time-series of zeros.

This is what should work:

outflow = swmmtoolbox.extract(filename, 'system,Flow_leaving_outfalls,11')

See #2 for some discussion.

Breaking change extract method in version 3.3.5

Hi @timcera,

Going to version 3.3.5 has created a breaking change in the extract method.

In our usage of the method we used to call it this way :

extract(r"sample.out", ["system", "Rainfall", "Rainfall"])

Which was fine with 3.3.2 but in the new 3.3.5 this now results in

Traceback (most recent call last):
  File "C:/Users/Florian DORRE/swmm_extract.py", line 5, in <module>
    extract(r"sample.out", ["system", "Rainfall", "Rainfall"])
  File "C:\Users\Florian DORRE\Envs\test_swmmtoolbox\lib\site-packages\swmmtoolbox\swmmtoolbox.py", line 745, in extract
    words = tsutils.make_list(label, n=3)
  File "C:\Users\Florian DORRE\Envs\test_swmmtoolbox\lib\site-packages\tstoolbox\tsutils.py", line 901, in make_list
    strorlist, n, kwdname
ValueError: 
*
*   The list ['system'] for "" should have 3 members according to
*   function requirements.
*

Of course a fix to that on our side would be to use the syntax like below that is working fine :

extract(r"sample.out", ["system,Rainfall,Rainfall"])

Would it be possible to add a specific condition if the parameter is already a list like it was before ?

Accessing System Data via swmmtoolbox.extract

What is the format to extract system data using swmmtoolbox.extract()? I tried looking at docs, but didn't find any thing. My point of confusion is what to include in the second argument for example,

'system, __ , 12'

Thanks,
-G

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.