Git Product home page Git Product logo

swmmnetwork's Introduction

SWMM Network Water Quality

https://api.travis-ci.org/austinorr/swmmnetwork.svg?branch=master https://codecov.io/gh/austinorr/swmmnetwork/branch/master/graphs/badge.svg?

SWMMNetwork helps users of EPA SWMM 5.1 perform water quality and load reduction calculations.

API

via classmethod:

inp_path = 'test.inp'
G = SwmmNetwork.from_swmm_inp(inp_path)

or via add_edges_from method

G = SwmmNetwork()
G.add_edges_from_swmm_inp(inp_path)

or via Scenario constructors which help combine input and report files from SWMM 5.1, and which help append subcatchment-based pollutant data from a dataframe.

rpt_path = 'test.rpt'
sub_conc = pandas.read_csv('subcatchment_concentrations.csv', index_col=[0])
sh = Scenario(inp_path, rpt_path)
sl = ScenarioLoading(sh.all_nodes, sh.all_edges,
                     conc=sub_conc, wq_value_col='concentration')
G = SwmmNetwork(scenario=sl)
G.add_edges_from_swmm_inp(inp_path)

then to solve the network:

G.solve_network(
    load_cols='POC1',
    tmnt_flags=['TR'],
    vol_reduced_flags=['INF'],
    bmp_performance_mapping_conc={
        "BR": { # in this example "BR" is meant to indicate a bioretention BMP
            "POC1": lambda x: .3 * x  # 70% reduced
        }
    )

results = G.to_dataframe(index_col='id')

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.