-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add forestclaw IO option #547
Conversation
Included a bit of a refactor for the ASCII output as well so that forestclaw could reuse as much of that code as possible.
I am having two issues getting this to work correctly so if anyone has some ideas they would be most welcome:
I could make this easier and only add these to the ForestClaw repository itself but I was thinking it would be nice to start to build up the infrastructure for having a Python interface to ForestClaw. |
Strangely tests are passing on travis beyond the issues with Python 3.x. Still not seeing the test for ForestClaw though. |
You probably already know this but the test failures on Travis seem like they would be fixed by using range instead of xrange. See http://stackoverflow.com/questions/17192158/nameerror-global-name-xrange-is-not-defined-in-python-3. |
I believe nose does not pick up functions with |
src/forestclaw/geometry.py
Outdated
def test_forestclaw_patch(): | ||
"""Test the simple extension of the pyclaw.Patch class""" | ||
|
||
patch = Patch(pyclaw.geometry.dimension(0.0, 1.0, 10)) |
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.
When I run this test, I get an error because dimension
is not capitalized. Changing it to Dimension
(the class name) fixes that and the test passes.
The refactor of |
I see, I was confused to where the |
I realized that it would be better to call the io module in the forestclaw package ascii to align better with petclaw and that this is really just a slightly changed ascii format for ForestClaw. |
I think I may have confused myself. If |
Also include an actual test.
Note now with the move to have |
You need to import them only if you wish to be able to access them under the ForestClaw namespace. For instance, |
I kind of want to mimic what is possible with PetClaw as much as possible but I will try some things. I still actually do not have the tests passing on my own machine due to a weird import conflict but I think I have seen something weird like this before. Given that the Travis tests are working maybe this is ready to merge then. |
Care to post the error you're getting locally? |
Oops, I was wrong. To fix the current Travis error, you just need to change io -> fileio on line 11 of pyclaw/src/pyclaw/setup.py. |
I just opened a PR for clawpack/clawpack#110. Still working out the testing issues. |
Made some incremental changes and bug fixes. I am hoping that this can soon be merged in. @donnacalhoun and @ketch I may need to have you test these things out given that this will be a multi-repository commit. |
Thanks for all of your work on this! I'll check it out in the next few days. |
Rename io -> fileio in pyclaw/src/pyclaw/setup.py.
…-forestclaw-reading
Also fix forestclaw tests
Never mind; the issue is that we're getting this when we install pyclaw:
This seems to come from https://github.com/numpy/numpy/blob/master/numpy/distutils/misc_util.py#L925 but I have no idea why. There must still be a reference to pyclaw.io somewhere...? |
I think the only important change here is the one in pyclaw/src/pyclaw/fileio/setup.py.
Okay, my latest PR fixes it. I think that with that we are ready to merge. |
Annihilate pyclaw.io.
Yeah, I think this doesn't pass yet because it needs the clawpack/clawpack PR. |
Does this work for you then? |
I am a bit concerned that there is still something not working quite right but maybe we can merge this in and see where non-travis testing might give us. |
We are having trouble getting the read function in pyclaw/ascii to use the read_patch_header in forestclaw.fileio.ascii. So either we shouldn't' be in |
This might be best in an issue instead. In any case I am in the midst of trying to replicate the problem in the swirl ForestClaw example. Hopefully I can identify what's wrong. |
I'd be happy to start an issue, it that helps. |
I think that would be a bit cleaner given that this is already merged. |
Included a bit of a refactor for the ASCII output as well so that
forestclaw could reuse as much of that code as possible.