lsmatott / ostrich-swmm Goto Github PK
View Code? Open in Web Editor NEWA toolset for connecting the OSTRICH optimization software toolkit with the SWMM simulation model.
License: GNU General Public License v2.0
A toolset for connecting the OSTRICH optimization software toolkit with the SWMM simulation model.
License: GNU General Public License v2.0
Hey all,
I was just poking around your repo this morning and I think I can help. I'd be happy to help migrate the core to use PySWMM
. This would ease the cross-platform / cross architecture compatibility. Rather than the user declaring the path to SWMM to run on the command line, pyswmm
(and a small wrapper which I propose to add to your repo) would manage the simulations. PySWMM
is already cross-platform/arch friendly. Furthermore, the way I am proposing to implement it still uses the subprocess
which inherently covers SWMM's lack of thread-safety limitations.
This proposal would effect the following lines of your code base:
Also, I would add a file call pyswmm_wrapper.py
which is what I provided to swmmio
this morning. Have a look at this new module. This change in SWMMIO
solves the exact same problem you have in OSTRICH-SWMM
.
Let me know if this is something you'd be open to these changes and I can make them! It would be a pretty straight-forward thing to do and it would not compromise the underlying tool.
@kmmacro, HI!
support for Python 2.7 packages will be going away soon
Hi, I'm searching for help for getting my Ostrich Swmm Project running and hope you can help me. I have to say that I'm new to Ostrich and after getting to know it and setting up the files for my EPA SWMM Model, I have struggles in running Ostrich for the Error "Value Extractor:: CTOR() could't open". Maybe there is any wrong format or an error in the configuration file? I thought there must be an error in the conection of Swmm and Ostrich, so that the problem lies in extracting values from the Swmm Output file. But after trying a lot, I am clueless so I would be very thankful for any help and comment.
Attached you find my Ostrich Project.
The subcatchment model in SWMM is not ideal, especially at the microscale for individual green infrastructure units.
If you look deeper into the source code, e.g. runon ("add to precipitation"), one has the impression of 'compromise' rather than optimise.
On the other hand, SWMM is very flexible and can simulate the pipe routing network with timeseries input to the junctions, without using SWMM's subcatchments and LID models.
"it's possible to have a SWMM model with no subcatchments or rain gauges or rainfall, where the only flow inputs are external hydrographs, then the answer is yes."
https://www.openswmm.org/Topic/29828/model-only-using-external-hydrographs
Is it possible to use these external timeseries and their SWMM pipe network as input into Ostrich-SWMM?
(ostrich) C:\Git\pub\ostrich-swmm>ostrich-swmm run
OSTRICH input for subcat S1##PP1_1 had too many lid units, changing to max number 41
OSTRICH input for subcat S2##RB1_2 had too many lid units, changing to max number 65
OSTRICH input for subcat S2##PP1_2 had too many lid units, changing to max number 10
OSTRICH input for subcat S3##PP1_3 had too many lid units, changing to max number 70
... EPA-SWMM 5.1 (Build 5.1.13)
o Retrieving project data
o Simulation complete
... EPA-SWMM completed in 0.00 seconds.
Traceback (most recent call last):
File "C:\Users\gqc\Envs\ostrich\Scripts\ostrich-swmm-script.py", line 11, in
load_entry_point('ostrich-swmm==0.6.0', 'console_scripts', 'ostrich-swmm')()
File "build\bdist.win-amd64\egg\ostrich_swmm_main_.py", line 247, in main
File "build\bdist.win-amd64\egg\ostrich_swmm_main_.py", line 116, in run_cmd
File "build\bdist.win-amd64\egg\ostrich_swmm\run.py", line 43, in perform_run
File "build\bdist.win-amd64\egg\ostrich_swmm\extract.py", line 332, in perform_extraction_steps
File "build\bdist.win-amd64\egg\ostrich_swmm\extract.py", line 43, in perform_node_extraction
AttributeError: 'SwmmExtract' object has no attribute 'TypeCheck'
Args:
binary_output (swmmtoolbox.SwmmExtract): The output to extract from.
node_output_file (file): The file to output extracted data to.
node_names (Iterable): A list of node names to extract data for.
statistics (Iterable): A list of statistics to extract.
event_threshold_flow_rate (Number): The flow rate above which a node
is considered to have flow. Defaults to 0.
"""
# Get the indicies of the relevant data in the binary output.
node_type = binary_output.TypeCheck('node')
node_total_inflow_variable_index = next(
index
for index, name
in binary_output.varcode[node_type].items()
if name == 'Total_inflow'
)
OS: Ubuntu 20.04
pip3 venv = py3swmm
python=v3.9
Is there an issue using python v3.9, rather than v3.8.3?
Trying to run ostrich-swmm for the first time, so any help appreciated.
I built and installed ostrich-swmm "lsmatott" in pip3 venv (the conda setup had too many conflicts) .
I am following the tutorial documentation, using the *.inp file to run this test.
I received the NameError: name 'sys' is not defined
I checked the listed files at their respective lines, but could not find a solution
Attached are the input and config files and the swmm5 executable.
Thanks for any help in getting this to run.
sh ostrich-swmm.sh
Traceback (most recent call last):
File "/media/l1nux/SAN240/py3venv/py3swmm/bin/ostrich-swmm", line 33, in
sys.exit(load_entry_point('ostrich-swmm==0.6.0', 'console_scripts', 'ostrich-swmm')())
File "/media/l1nux/SAN240/py3venv/py3swmm/lib/python3.9/site-packages/ostrich_swmm-0.6.0-py3.9.egg/ostrich_swmm/main.py", line 247, in main
File "/media/l1nux/SAN240/py3venv/py3swmm/lib/python3.9/site-packages/ostrich_swmm-0.6.0-py3.9.egg/ostrich_swmm/main.py", line 116, in run_cmd
File "/media/l1nux/SAN240/py3venv/py3swmm/lib/python3.9/site-packages/ostrich_swmm-0.6.0-py3.9.egg/ostrich_swmm/run.py", line 24, in perform_run
File "/media/l1nux/SAN240/py3venv/py3swmm/lib/python3.9/site-packages/ostrich_swmm-0.6.0-py3.9.egg/ostrich_swmm/inject.py", line 387, in perform_injection
File "/media/l1nux/SAN240/py3venv/py3swmm/lib/python3.9/site-packages/ostrich_swmm-0.6.0-py3.9.egg/ostrich_swmm/inject.py", line 171, in inject_parameters_into_input
File "/media/l1nux/SAN240/py3venv/py3swmm/lib/python3.9/site-packages/ostrich_swmm-0.6.0-py3.9.egg/ostrich_swmm/inject.py", line 55, in extract_subcatchment_polygons
NameError: name 'sys' is not defined
I found the article "OSTRICH-SWMM: A new multi-objective optimization tool for green infrastructure planning with SWMM" quite interesting and really want to run and test Ostrich-SWMM. As a start I want to run the examples that is posted with the scripts.
During a periode now I have been trying to understand this program trought this channel. But it seems to me that there something missing. The program is asking for the file: ostrich-swmm.sh throught the ModelExecutable in the ostln.txt file. I've read trought the tutorial and the ostrich-swmm.sh seems to be a part of the input. Do any of you know where I can find this file or explain how its created?
add on: I am running it on a Windows computer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.