-
Notifications
You must be signed in to change notification settings - Fork 66
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
full size xg and yg #246
full size xg and yg #246
Conversation
I will delay this PR until PR #98 is merged. |
Hi @rabernat, I think I found a solution. In the current version of this PR we are extending extending i_g and j_g to nx + 1. I tested it with a cs grid. But it should also work with llc. Cheers |
I think this PR solves the issues of my previous implementation of this utility function |
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.
Thanks @raphaeldussin for your feedback! I changed it to match your feedback.
Hi @rabernat, @raphaeldussin, just a quick reminder that my work on this PR is finished. |
Hi, just another casual reminder @rabernat and @raphaeldussin (sorry for bothering). |
Thanks for the reminder @AaronDavidSchneider, and sorry for taking so long to review! We really appreciate your contribution. I will do my best to have a look this week. |
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.
This is really great!
My one central concern is that we don't have a test. @raphaeldussin - do any of the test cases contain the needed input files to test this code?
Co-authored-by: Ryan Abernathey <ryan.abernathey@gmail.com>
Co-authored-by: Ryan Abernathey <ryan.abernathey@gmail.com>
Co-authored-by: Ryan Abernathey <ryan.abernathey@gmail.com>
Co-authored-by: Ryan Abernathey <ryan.abernathey@gmail.com>
Thanks for your comments @rabernat! |
Regarding the tests: What do you think? |
So I looked it up, and it seems that we already have a good test for the xmitgcm/xmitgcm/test/test_utils.py Line 961 in 4a9c748
To this test you should add a section that calls the function with
No, I would not recommend that. The data are coming from files hosted in the test data repo, so I would not make assumptions about the values. You just want to check that the arrays are the right shape. Do you know how to run the test suite? Just run |
AaronDavidSchneider#1 should solve the problem. |
change logic, pass all tests
Thanks @raphaeldussin for your feedback and work on this PR. |
getting very close to the finish line @AaronDavidSchneider |
Thanks for your feedback @raphaeldussin. I tried to address the proposed changes. I still have one open question (see above). |
So I just had a look into the llc checks in xc1 = read_raw_data(grid1, dtype=np.dtype('>d'), shape=(ny1, nx),
partial_read=True) does not work. I would suggest, that we merge this PR first (once its ready) and work on cs grid checks afterwards, since these checks are not really related to this PR anyway. I would be happy to open up a new PR to work on these checks. However, I would need your help @raphaeldussin for the |
I think this test on the values is important so we preserve the answers in any future code changes.
read all variables: raw = read_raw_data('grid_cs32.face001.bin', np.dtype('>d'), (18,33,33)) read only first one: raw = read_raw_data('grid_cs32.face001.bin', np.dtype('>d'), (33,33), partial_read=True) read second: raw = read_raw_data('grid_cs32.face001.bin', np.dtype('>d'), (33,33), partial_read=True, offset=(33*33*8)) from there you should be able to add a section to the test for CS geometry. |
Thanks for the explanation @raphaeldussin! I took the llc check and adapted it for the CS grid. What do you think? |
LGTM! @rabernat are you good with this as well? |
Hi @rabernat, could you have a final look on this PR? |
Hi @rabernat, could you have a final look on this PR? |
Just another kind reminder @rabernat. |
Hi @rabernat, |
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.
Sorry for being extremely slow here. Just one question, then LGTM.
Added precision and endianness to grid common. |
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.
Fantastic!
Reading the code, I realized I don't like how we have separate parameters for dtype
and endian
. We can handle endianness as part of dtype, so this is unnecessary. However, that predates your PR, so it doesn't have to be fixed here.
This PR picks up on PR #195 and is currently WIP.
I plan to keep this PR minimal and not pick up the ability to reshape a dataset in tiles of a specified shape.
This PR only extends xg and yg to their full size.