-
Notifications
You must be signed in to change notification settings - Fork 17
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
Cf/Radial1 writer #126
Cf/Radial1 writer #126
Conversation
@syedhamidali I've fixed an issue on main to get the CI started here. I'll have a closer look later today if no one beats me to it. |
Codecov Report
@@ Coverage Diff @@
## main #126 +/- ##
==========================================
+ Coverage 88.21% 88.31% +0.10%
==========================================
Files 19 20 +1
Lines 3334 3431 +97
==========================================
+ Hits 2941 3030 +89
- Misses 393 401 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
So, @kmuehlbauer, could you please explain how Codecov works? My understanding is that we need to create some tests for it. However, I couldn't find any tests for |
@syedhamidali Currently we use the notebooks to test this. That's no full featured unittest as it just checks that it runs without raising an error. We'd decided to add tests while touching the codebase. |
Thank you for this info! So, what is the solution here? |
OK, I can't give a very detailed answer now, but the idea would be to create some roundtrip tests first. Where we write and read back some predefined data and compare it against each other. Finally, we would like to have tests for each 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.
@syedhamidali Thanks for tackling this issue. I've added a couple comments and suggestions.
For adding tests, maybe a simple roundtrip will be sufficient?
- read CfRadial1 file
- export to_cfradial1
- read back and compare with 1
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
@syedhamidali Let's try to get this in by tomorrow or Thursday latest. I'm really pushing for a release 0.4.0 on Thursday.
Removed contributions
release 0.4.0
@kmuehlbauer Notebook for the tests or for the example? |
Good question, do you think it would make sense to combine it? |
OK, then I'd suggest an example notebook and unit tests under xradar/tests/io -> test_cfradial1.py. You could use xr.testing.assert_identical(ds1, ds2) for testing. |
I tried that one, check this out #126 (comment), I feel that is masked_arrays/fill_value vs NaNs |
xr.testing.assert_identical(dtree["sweep_0"].ds, dtree2["sweep_0"].ds)
xr.testing.assert_equal(dtree["sweep_1"].ds, dtree2["sweep_1"].ds)
xr.testing.assert_equal(dtree["sweep_2"].ds, dtree2["sweep_2"].ds) Something like this works for me. |
I think you can't write masked arrays to netcdf with xarray. You would need |
@syedhamidali I think the roundtrip test is sufficient for now. Please let me know when this is ready for merge. There might be some clean-up needed in the CfRadial1 Notebook. Maybe we can have the release already tomorrow. 🚀 |
I tried to make a notebook, but the problem is that I don't know yet how this |
@syedhamidali The notebook looks nice for the first setup, you can extend it any time by adding additional information to it. Add it to the examples and we are almost ready to get this in. |
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.
@syedhamidali This is a great first contribution! I've added another couple of comments and suggestions. After addressing those we can get this in and have a release party.
Please also add an entry to docs/history.md! |
Hello Kai, Just a quick question before I run pre-commit, should I use tempfile generated filename, or just comment this xd.io.to_cfradial1 statement in the notebook |
Which notebook? If you mean your example notebook just keep the filename and write to the current directory. |
OK, we are very close now @syedhamidali. There are minimal tweakings needed to hook the example notebooks at the proper place in the docs. I can do this work after merging this while preparing the release. WDYT? Shall we merge? |
Thank you, @kmuehlbauer, please go ahead whenever you're ready. |
Thanks @syedhamidali, 👍 💯 ! |
Thanks for all your hard work here @syedhamidali !! |
history.md
I have incorporated the CFRadial1 writer into the code and tested it with four different CFRadial1 data files. It successfully processed three of the files. While it currently works with full radar volumes, I acknowledge that further refinement and compatibility with sweeps are necessary. I welcome any suggestions for improvement and am open to any modifications that enhance its suitability.
I also ran
pre-commit run --all-files
.Thanks
Hamid