pyswmm / Stormwater-Management-Model

PySWMM Stormwater Management Model repository
Other
99 stars 77 forks source link

Create CLI progress bar #305

Closed michaeltryby closed 4 years ago

michaeltryby commented 4 years ago

This PR does the following:

michaeltryby commented 4 years ago

@cbuahin Thanks for the review! One of the things I like about this PR is that it factors out the "progress display" concern from swmm_run() and moves it to main(). This makes more sense to me.

If you could build and run for a long simulation that would be very helpful. Thanks!

cbuahin commented 4 years ago

I agree with you and like how you've separated the progress display from running the model. I will try running it for a long simulation and will report the results here.

cbuahin commented 4 years ago

There was no significant change in performance so I say we are good!

jennwuu commented 4 years ago

It's odd that ubuntu seems to be failing in github actions.

michaeltryby commented 4 years ago

@jennwuu There was a change made to the Actions Build Runner image that is causing the test build to fail on Ubuntu. I haven’t determined the cause but was able to get it running again by rolling back to Ubuntu v16.04.

michaeltryby commented 4 years ago

@jennwuu I think I misunderstood your question on the first go around. Let me know if this doesn't answer your question.

This PR adds a progress bar style "interface" to the runswmm command line tool using a callback. The function swmm_run() was part of the original swmm API swmm_run_cb() has been added so that a callback function can be registered with it. swmm_run() was reimplemented using swmm_run_cb() for backward compatibility.

Thanks for your review!

jennwuu commented 4 years ago

Thank you for the explanation. This makes sense to me. :D