Numpy frame#739
Conversation
|
Yikes, that is annoying. I have run into the My one thought now looking at this is that maybe we would rather simply cast the |
|
It would also accept floats, is that fine? |
|
Cool ! I just noticed I had not treated the case where frame is passed as a keyword. |
| frame = arg[0] | ||
| if not isinstance(frame,int): | ||
| raise Exception('Invalid pyclaw.Solution object initialization') | ||
| frame = int(frame) |
There was a problem hiding this comment.
Is there a reason not to just do frame = int(arg[0])?
There was a problem hiding this comment.
Just that the error traceback is slighly more clear by explicitly saying frame is the issue:
frame = int(frame)
^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '_1_'
There was a problem hiding this comment.
Hmm, good point. Not sure what is better I guess then.
There was a problem hiding this comment.
Well... 'frame' still appears in frame = int(arg[0]) so I commited that change. Funny how it takes me 5 commits to change two lines.
|
The tests are failing as the Riemann commit does not include the |
|
Is there something I can do about the tests failing? |
|
We have to update the super-repository for clawpack with the updated commit point that includes the f-wave solver feature. |
|
I think clawpack/clawpack#259 should take care of this although the interface has changed since last I did a PR like this. Once that get merged the testing should work. |
Since `frame` would appear in the error anyway, I guess this is cleaner
|
This looks fine to me and works locally. |
Hi everyone!
I spent too much time on the error below that showed up because I gave the
frameargument ofpyclaw.solution.Solution.__init__a numpy integer instead of a pure python integer... So I thought it could be made a bit more flexible.With the suggested changes, the error message would look like this for an erroneous input: