Access INP file without running a simulation #201
-
Hello, def getElementsProperties(InpFilePath):
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@JoaoBarreiro, I think you should use swmmio for accessing info. You are correct, pyswmm.Simulation “opens” a simulation (which will overwrite your RPT/OUT). I’m guessing that is the problem you’re experiencing. Swmmio and pyswmm are friends at the moment and will soon be coupled together more tightly. I’m going to transfer this discussion to swmmio |
Beta Was this translation helpful? Give feedback.
-
Hi @JoaoBarreiro, as @bemcdonnell suggested, you can used swmmio to fetch data from the INP file without needing to run the simulation. Here is a basic example: import swmmio
# instantiate a swmmio Model object with your inp file
model = swmmio.Model('path/to/model.inp')
# access an aggregation of inp data related to model nodes, using the higher level api
nodes = model.nodes.dataframe
# similarly, access an aggregation of data related to model links
links = model.links.dataframe Here, Finally, if you need data from the INP that isn't provided in the higher level API via model.inp.dwf More documentation on this can be found over here. Does that answer your question? |
Beta Was this translation helpful? Give feedback.
Hi @JoaoBarreiro, as @bemcdonnell suggested, you can used swmmio to fetch data from the INP file without needing to run the simulation. Here is a basic example:
Here,
nodes
will be Pandas DataFrames with columns for InvertElev, SurchargeDepth, and many others. Similarly,links
will be a DataFrame containing InletNode, OutletNode, Geom1 etc.Finally, if you need dat…