-
Notifications
You must be signed in to change notification settings - Fork 297
Added dataless rolling window, _intersect #6757
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6757 +/- ##
==========================================
+ Coverage 90.29% 90.37% +0.08%
==========================================
Files 91 91
Lines 24656 24727 +71
Branches 4618 4633 +15
==========================================
+ Hits 22264 22348 +84
+ Misses 1620 1608 -12
+ Partials 772 771 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| def test_weights_cube(self): | ||
| @pytest.mark.parametrize("dataless", [True, False]) | ||
| def test_weights_cube(self, dataless): |
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.
Same as previous comment - this test doesn't assert anything for dataless cubes.
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.
Small suggestion, but basically all good!
| self.mock_agg.post_process = mock.Mock(side_effect=lambda x, y, z: x) | ||
|
|
||
| def test_string_coord(self): | ||
| @pytest.mark.parametrize("dataless", [True, False]) |
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.
There are an awful lot of repetitions of this particular "parametrize" usage.
Some of them (but not all) have also ids=["dataless", "with data"]
As a general point, once you have this more than a couple of times, I would alway just put it in a fixture instead:
@pytest.fixture(params=[True, False], ids=["dataless", "with_data"])
def dataless(request):
yield request.param
With this, you just get rid of all the parametrize decorators, and the tests don't need any further reference, other than the "dataless" argument which they already have.
This is ensures they are all the same, which is more DRY and easier to understand (probably??) .
Actually, there are a few more often-repeated usages of parametrize in this file, but this is the big one !!
Interpolation and regridding are both quite involved. For completion sake, I would've liked to get interpolation in, but I don't think it's worth the time it would take to get it right. Some of the underlying logic just doesn't work with dataless cubes, and would need chasing around the place.
So for now, I think this is it for single operations. If there's a call in the future for interpolate or regridding (the latter seems particularly unlikely), then we can work towards them then.