-
Notifications
You must be signed in to change notification settings - Fork 102
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
Numpy frame #739
base: master
Are you sure you want to change the base?
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. |
src/pyclaw/solution.py
Outdated
@@ -136,8 +136,7 @@ def get_clawpack_dot_xxx(modname): return modname.rpartition('.')[0] | |||
if len(arg) == 1: | |||
# Load frame | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to just do frame = int(arg[0])
?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, good point. Not sure what is better I guess then.
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.
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
frame
argument 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: