-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make _error_check throw exception for all errcodes #173
Conversation
Instead of swallowing the exception and turning into a warning. Fixes issue pyswmm#172.
@dmcdougall, Thanks for the contribution! Looks like a couple tests need to be updated as well |
Cool, will get to those shortly. Thanks for the feedback. |
@dmcdougall, Do you plan to update the tests? If not, no problem - I can see if someone else can support you |
There is new api that fixes this problem in the swmm-python package. |
pyswmm could be the first package to build off the swmm-python foundation. |
I’m happy to update the tests. Sorry for the slow response. I can do this tomorrow. Michael’s suggestion points to a different way to handle this situation. Which direction do you folks prefer? I can update the tests to swallow an expected exception (no simulation running) which seems reasonable for a test suite. Or I can wait to build off of swmm-python. |
We are working toward moving this project away from ctypes to use the swig wrapped swmm-python but it will be quite a bit of work to flush out the swmm-python. Could be looking at many weeks/months actually. I think knowing this, updating tests would be nice; but it’s not on par with the long term objectives. In any event updating pyswmm to use swmm-python is going to be a fairly large effort. Swmm-python, today, only wraps the legacy api of swmm which is ~7 functions. The OWA swmm API has ~40 functions. When we make the next release of pyswmm using swmm-python as its low level interface to swmm, we will actually bump the release number to 1.0.0. I think the options are
|
Sure effort is involved but I disagree with your characterization that it’s going to be a “large” one. There is one technical hurdle remaining, how to handle structs. Then it’s smooth sailing. |
What would you like me to do? Fix up the PR or close it? If I fix up the PR, the user will see graceful failures instead of seeing warning. A consequence of this is that because of a current bug in swmm (pyswmm/Stormwater-Management-Model#193) their application won’t exit with a useful message. If I don’t fix up the PR, the user is left with a warning instead of an exception and could be misled into believing swmm is happy with an invalid internal state. I can see arguments on both sides. |
@dmcdougall, If you're keen to fix it (an update the tests), I'd say go for it! We will migrate the backend of this tool to use swmm-python ASAP. We can release a patch fix after you make this change |
Ok, then I’ll update the tests. Thanks for the guidance. |
I am loathe to remove a test, but we no longer swallow exceptions and turn them into warnings.
This is a test, so it makes sense that we're not running a simulation.
This is a test, not a simulation, so this makes sense.
This makes sense for a test.
Hmmm, all the tests pass locally for me. I think I have to do a little more digging... |
65f7183
to
232f5cb
Compare
Ah, right. The error code is 309 which indicates a problem writing an output file. I suppose the filesystem footprint on AppVeyor is limited and that's perhaps why. I'll have a think about how to handle those. |
I haven't forgotten about this. I think the best thing to do with the tests is to check the error code in the |
@dmcdougall, i'm going to close and re-open to see if the Scrutinizer and Circle CI integrations go away... not sure what's going on with them... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmcdougall I made a couple changes and got the tests to pass again in CI. We will be revisiting the error management down the road. In any event- Thanks for your help!
Closes #172
Instead of swallowing the exception and turning into a warning. Fixes
issue #172.