Skip to content

Access INP file without running a simulation #201

Answered by aerispaha
JoaoBarreiro asked this question in Q&A
Discussion options

You must be logged in to vote

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, 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…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@JoaoBarreiro
Comment options

@bemcdonnell
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by JoaoBarreiro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants