USEPA / SWMM-EPANET_User_Interface

User interface for the Stormwater-Management-Model
112 stars 67 forks source link

Static Averaged fails running in time setting #272

Closed ehsanMa86 closed 4 years ago

ehsanMa86 commented 6 years ago

Static Averaged fails running in time setting

Version: EPANET MTP4r2 (master branch) Priority: High

TongZhai commented 6 years ago

@ehsanMa86 need more details

TongZhai commented 5 years ago

@ehsanMa86 this looks like a model issue with EPANET as it indeed ran into problem when average is used.

TongZhai commented 5 years ago

@michaeltryby current epanet dll is the 64-bit epanet-2.1-win version. I've tried the 2.2 release, didn't see a 64-bit version of the epanet dll though. It seems the epanet engine needs update for this project per these simulation input issues.

eladsal commented 5 years ago

@TongZhai the current compiled versions of v2.2 may be found here: https://www.dropbox.com/sh/slgsvyj7d7a6sx3/AACpeOyBZiVy0j3ZfLsPvxG1a?dl=0

TongZhai commented 5 years ago

@eladsal Thanks for the v2.2 program. I just tried it, it looks like the program ran successfully, but the output api got error code #422 when opening the output binary file. The output api version number is 20012. It failed in the ENR_newOutValueSeries function. So, perhaps the output api should be updated as well, would you or @michaeltryby take on this?

michaeltryby commented 5 years ago

@TongZhai I’m on vacation so I won’t get to this until next week.

michaeltryby commented 5 years ago

@TongZhai I've had a chance to look at this bug and have a few thoughts ...

When statistical processing is selected all the results of an extended period simulation are summarized for each node and link as one value for each output attribute (so for example a node has only one value for pressure, one value for quality, etc. instead of a time series) Does that make sense?

So when this option is selected time series result does't exist. You can see this in the behavior of the old UI. One can't plot or generate a table to display time series when a statistic is computed.

Also, the function ENR_newOutValueSeries is a helper function for allocating memory that has been deprecated in the latest version of the output API. The new version of the output API handles memory allocation and deallocation for you in the python wrapper.

Lastly, why does the UI start allocating memory for time series immediately after the simulation before the user has requested them?

TongZhai commented 5 years ago

@michaeltryby thanks for the in depth analysis. I think @ehsanMa86 was first and foremost pointing out the the same parameterization doesn't cause an error message to be displayed in the original UI. The new output api indeed detect issues when calling the ENR_newOutValueSeries routine and its error code is propagated up to the UI. So, I think first thing to consider is how to deal with the internal issues like these parameters' settings, should we give error display or simply say run is successful as in the original UI. I think the new UI is preping for animation to get the data time series ready after the simulation.

michaeltryby commented 5 years ago

@TongZhai Since the application "knows" when a statistical summary option has been selected or when a steady-state simulation has been performed it should also "know" that time series are not available. A good solution would involve NOT automatically pre-loading them under these circumstances. Also, the output library should be upgraded and the call to ENR_newOutValueSeries() should be eliminated.

TongZhai commented 5 years ago

@michaeltryby I've downloaded the latest epanet.dll (link above by @eladsal ), please help confirm it is the latest engine dll. Where is the latest compatible ENOutput API? I would like to get these updated for a release.

michaeltryby commented 5 years ago

@TongZhai the latest epanet-python packages can be found here. Please use them instead. Thanks!

TongZhai commented 5 years ago

@michaeltryby just installed this toolkit, it looks very different from the existing ENOutputAPI, I couldn't find any output retrieval routines corresponding to those in the current ENOutputAPI..., is there an API document to see what's available in the whl?

michaeltryby commented 5 years ago

@TongZhai its the exact same library. The functions have been renamed to be more Pythonic.

TongZhai commented 5 years ago

@michaeltryby ok, I see the xxxx_getvalue api functions, are those the ones to use to retrieve output data? are there out of the box functions to retrieve time series or we just do that with the getvalue functions?

michaeltryby commented 5 years ago

@TongZhai are you looking at the epanet.output package or the epanet.toolkit package?

TongZhai commented 5 years ago

@michaeltryby that link you provided above points to this whl: epanet.toolkit-0.2.1.dev0-cp37-cp37m-win_amd64.whl, so yes, it is the toolkit package. So, I guess we need the latest epanet.output package...

michaeltryby commented 5 years ago

@TongZhai the epanet.output wheels are located along with the epanet.toolkit wheels in the link I provided.

TongZhai commented 5 years ago

@michaeltryby sorry, I am going cross eyed, the output whl is right there, I somehow downloaded the toolkit. Ok, one more time.

PaulDudaRESPEC commented 4 years ago

Closing old issues, assuming this issue is not relevant to the current version of the software. Feel free to re-open if the problem still occurs.