Skip to content
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

Empty collection testing #53

Merged
merged 8 commits into from
Mar 8, 2024
Merged

Empty collection testing #53

merged 8 commits into from
Mar 8, 2024

Conversation

aazuspan
Copy link
Owner

@aazuspan aazuspan commented Mar 8, 2024

The main fix is to update the failing test_sample_data_point test caused by an apparent change in the EE server error handling. Previously, attempting to generate random points from a point geometry would raise an error, and sankee would catch that and rethrow. Now, we catch more specifically when an empty feature collection is sampled.

Some other minor changes:

  • Added the more specific SamplingError exception for all errors related to data sampling.
  • Fixed a pandas deprecation warning related to using the builtin sum in a groupby.
  • Simplified the CI by removing the unneeded Python script.
  • Added linting to the CI.
  • Switched from black to ruff for formatting.
  • Fixed auth errors in the CI by updating the repo secret to include the full contents of the credentials file rather than just the refresh_token.

aazuspan added 8 commits March 6, 2024 10:48
It looks like Earth Engine no longer raises a specific error for
sampling random points within a single point, so the error handling
and testing were modified for the more specific case of an empty
sampling region, e.g. a FeatureCollection with zero features.

In the process, the sampling error handling was refactored and a
new SamplingError class was added. SamplingError inherits from
ValueError which was the previous error type, so this shouldn't
affect any downstream error handling.
@aazuspan aazuspan added the bug Something isn't working label Mar 8, 2024
@aazuspan aazuspan self-assigned this Mar 8, 2024
@aazuspan aazuspan merged commit 800ce4f into main Mar 8, 2024
6 checks passed
@aazuspan aazuspan deleted the empty-collection-test branch March 8, 2024 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant