Skip to content

Conversation

@edoyango
Copy link
Collaborator

@edoyango edoyango commented Dec 4, 2025

This adds test coverage for filtering for numpy, dask, xarray. Contains a few tests unrelated to filtering. Some of the xarray filtering seemed improperly implemented (looks like it was copied from numpy), so I added some proper implementations.

WIP.

raise TypeError("This filter only accepts xr.DataArray or xr.Dataset")

if not function(sample):
if not drop:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the doc string for DropValue:

Filter to drop data containing more than a given percentage of a value.

all the DropValue filters calculate whether % of elemns matching value >= the percentage, and then not's them here, which does the opposite of what the doc string says. @tennlee should I follow what the doc string says or leave the logic as is?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The top-level filter class says "filter should sairse a PipelineFilterException if invalid. So I think the not is unwanted? The test for me is that a pipelinefilterexception should be raised if data with a high proportion of nans (or whatever query value) is supplied.

@coveralls
Copy link

coveralls commented Dec 4, 2025

Pull Request Test Coverage Report for Build 20294261772

Details

  • 228 of 228 (100.0%) changed or added relevant lines in 9 files are covered.
  • 7 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+1.2%) to 64.798%

Files with Coverage Reduction New Missed Lines %
packages/pipeline/src/pyearthtools/pipeline/operations/xarray/remapping/healpix.py 7 3.94%
Totals Coverage Status
Change from base Build 19503286433: 1.2%
Covered Lines: 10417
Relevant Lines: 15721

💛 - Coveralls

@edoyango edoyango closed this Dec 5, 2025
@edoyango edoyango reopened this Dec 5, 2025
@edoyango edoyango marked this pull request as ready for review December 5, 2025 01:06
@edoyango edoyango force-pushed the xarray_remapping_tests branch from 152094d to 0b43a9f Compare December 5, 2025 01:09
@edoyango
Copy link
Collaborator Author

edoyango commented Dec 5, 2025

covered dask case so pr is ready to review.

@edoyango
Copy link
Collaborator Author

edoyango commented Dec 5, 2025

not sure why ci has suddenly started failing at install depends step...

@tennlee
Copy link
Collaborator

tennlee commented Dec 10, 2025

Sorry for the delay here ... a few things at work meant a building of reviews, and I had some difficult refactoring to do on "scores". I'll get to this next week, maybe earlier.

@tennlee
Copy link
Collaborator

tennlee commented Dec 17, 2025

I note the unit tests are failing due to the dependencies now exceeding the disk space allowed by the CI/CD system. I am trying to push up changes to bring the CI/CD setup back within the tolerances set by Github.

@tennlee
Copy link
Collaborator

tennlee commented Dec 17, 2025

@edoyango okay, so I think the CI/CD is doing its job again. However, surprisingly, one of the tests i failing on Python 3.13 specifically, which is unexpectedly. Let me know if you can take a look. If I can figure it out, I'll happily push up a fix, but the answer is not springing to mind.

@tennlee
Copy link
Collaborator

tennlee commented Dec 17, 2025

@edoyango I'm going to merge this to get the obvious benefits from improved coverage and getting the CI/CD passing again. However I've raised a new issue around the point you identified about the directionality of the logic in the filter. If you have time to address it, please do.

@tennlee tennlee merged commit d5f6ea4 into ACCESS-Community-Hub:develop Dec 17, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants