Document num_sample=None in natural_breaks docstring#3505
Merged
brendancol merged 2 commits intoJun 26, 2026
Conversation
natural_breaks accepts num_sample=None (use all data) like the other classifiers, but its docstring only described it as int. Bring the parameter wording in line with quantile/maximum_breaks/percentiles.
Contributor
Author
Review: document num_sample=None in natural_breaksRead the full Suggestion
Suggest rewording so it says What looks good
Checklist
|
The first pass copied the percentile classifiers' '(safe for numpy/cupy, automatically capped for dask)' wording. For natural_breaks None fits Jenks on all data, which is the O(n^2) case the docstring warns about and which raises MemoryError past the half-RAM guard, so 'safe' was wrong. Describe the actual cost instead. Addresses review on #3505.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3501.
natural_breaksalready acceptsnum_sample=None(use all data) the sameway
quantile,maximum_breaks, andpercentilesdo, but its docstringonly described
num_sampleasintand never mentionedNone. This bringsthe wording in line with the other three classifiers.
Docstring only. No signature or behavior change.
Verified
natural_breaks(agg, k=5, num_sample=None)on both the numpy andcupy backends.
pytest xrspatial/tests/test_classify.py -k natural_breakspasses (22 passed).