{"id":13949117,"url":"https://github.com/kLabUM/pystorms","last_synced_at":"2025-07-20T11:30:51.290Z","repository":{"id":45104631,"uuid":"212178547","full_name":"kLabUM/pystorms","owner":"kLabUM","description":"Simulation Sandbox for the Design and Evaluation of Stormwater Control Algorithms","archived":false,"fork":false,"pushed_at":"2025-06-28T20:56:43.000Z","size":450706,"stargazers_count":33,"open_issues_count":3,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-07T01:03:47.547Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pystorms.netlify.app","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kLabUM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-01T19:09:06.000Z","updated_at":"2025-06-28T20:56:47.000Z","dependencies_parsed_at":"2025-04-17T10:30:42.857Z","dependency_job_id":"7d3e7877-e8d8-453f-b235-8b9485bae4bf","html_url":"https://github.com/kLabUM/pystorms","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/kLabUM/pystorms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kLabUM%2Fpystorms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kLabUM%2Fpystorms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kLabUM%2Fpystorms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kLabUM%2Fpystorms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kLabUM","download_url":"https://codeload.github.com/kLabUM/pystorms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kLabUM%2Fpystorms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264719224,"owners_count":23653540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-08T05:01:38.682Z","updated_at":"2025-07-20T11:30:51.278Z","avatar_url":"https://github.com/kLabUM.png","language":"Jupyter Notebook","readme":"# pystorms: simulation sandbox for the evaluation and design of stormwater control algorithms\n[![pystorms](https://github.com/kLabUM/pystorms/actions/workflows/python-package.yml/badge.svg?branch=master\u0026event=push)](https://github.com/kLabUM/pystorms/actions/workflows/python-package.yml)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)\n\n## Overview \n\nThis library has been developed in an effort to systematize quantitative analysis of stormwater control algorithms.\nIt is a natural extension of the Open-Storm's mission to open up and ease access into the technical world of smart stormwater systems.\n Our initial efforts allowed us to develop open source and free tools for anyone to be able to deploy flood sensors, measure green infrastructure, or even control storm or sewer systems.\n Now we have developed a tool to be able to test the performance of algorithms used to coordinate these different sensing and control technologies that have been deployed throughout urban water systems.    \n\nFor the motivation behind this effort, we refer the reader to our manuscript [*pystorms*](https://dl.acm.org/citation.cfm?id=3313336). In general, this repo provides a library of `scenarios` that are built to allow for systematic quantitative evaluation of stormwater control algorithms.\n\n\n## Getting Started \n\n### Installation \n\n**Requirements**\n\n- PyYAML \u003e= 5.3\n- numpy \u003e= 18.4\n- pyswmm \u003c 2.0.0\n\n\n```bash \npip install pystorms\n```\n\nPlease raise an issue on the repository or reach out if you run into any issues installing the package. \n\n### Example \n\nHere is an example implementation on how you would use this library for evaluating the ability of a rule based control in maintaining the flows in a network below a desired threshold. \n\n```python \nimport pystorms \nimport numpy as np\n\n# Define your awesome controller \ndef controller(state):\n\tactions = np.ones(len(state))\n\tfor i in range(0, len(state)):\n\t\tif state[i] \u003e 0.5:\n\t\t\tactions[i] = 1.0\n\treturn actions \n\t\n\nenv = pystorms.scenarios.theta() # Initialize scenario \n\ndone = False\nwhile not done:\n\tstate = env.state()\n\tactions = controller(state)\n\tdone = env.step(actions)\n\nperformance = env.performance()\n\n```\n\nUpdated versions of _theta_, _alpha_, _gamma_, _delta_, and _epsilon_ are accessible via a version keyword in the initialization command.\n\n```python\nenv = pystorms.scenarios.theta(version=version) # \"1\" is the default and original, \"2\" are the updated versions.\n```\n\nSensor noise and actuator faults can also be enabled via the level keyword. The options are 1, 2, and 3 in ascending order of difficulty. Version or level or both can be specified. \n\n```python\nenv = pystorms.scenarios.theta(version=version, level=level) # \"1\" is the ideal, original, and default case. \"2\" is realistic and \"3\" is adverse.\nenv = pystorms.scenarios.theta(level=level) # also valid. This would load version 1 of the model.\n```\nMore details on the updates are accessible at (preprint link). As of June 2025, these updates are only in the \"dev\" branch and have not yet been merged in \"master.\"\n\nDetailed documentation can be found on the [webpage](https://www.pystorms.org)\n","funding_links":[],"categories":["Natural Resources"],"sub_categories":["Water Supply and Quality"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FkLabUM%2Fpystorms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FkLabUM%2Fpystorms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FkLabUM%2Fpystorms/lists"}