Fix docstring parameter names that do not match the signatures - #1254
Open
VenishPaneliya wants to merge 1 commit into
Open
VenishPaneliya wants to merge 1 commit into
VenishPaneliya wants to merge 1 commit into
Conversation
Three docstrings name a parameter the function does not have. In two of them the name is the spelling used by a sibling function, so the docs drifted rather than being wrong from the start: - `validate_axes(axes)` documents `axis`, which is the parameter of the neighbouring `validate_axis_name`. - `SpatialData.subset(filter_tables=...)` documents `filter_table`, the spelling used by the `*_query` functions. The same docstring already refers to `filter_tables` correctly when describing `include_orphan_tables`. - `rasterize_bins(return_region_as_labels=...)` documents `return_regions_as_labels`, which is `rasterize`'s spelling. Its own `value_key` entry already refers to `return_region_as_labels`. `rasterize_bins_link_table_to_labels` repeats the last one in prose and tells the reader to call `rasterize_bins()` with `return_regions_as_labels=True`; `rasterize_bins` has no such parameter and takes no `**kwargs`, so that call raises `TypeError`. Docstrings only, no behaviour change.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1254 +/- ##
=======================================
Coverage 91.40% 91.40%
=======================================
Files 53 53
Lines 8381 8381
=======================================
Hits 7661 7661
Misses 720 720
🚀 New features to boost your workflow:
|
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.
Three docstrings name a parameter that the function does not have. In two of the three the name is the spelling used by a sibling function, so these look like drift rather than an original mistake.
1.
rasterize_bins—return_regions_as_labelsvsreturn_region_as_labelsrasterize_bins()takesreturn_region_as_labels(singular), whilerasterize()takesreturn_regions_as_labels(plural). Therasterize_binsdocstring uses the plural form as its parameter heading, even though its ownvalue_keyentry already says:The same plural form is repeated in
rasterize_bins_link_table_to_labels, where it is given to the reader as an instruction:rasterize_binshas noreturn_regions_as_labelsparameter and takes no**kwargs, so following that sentence literally raisesTypeError: rasterize_bins() got an unexpected keyword argument 'return_regions_as_labels'.2.
SpatialData.subset—filter_tablevsfilter_tablesThe signature is
subset(element_names, filter_tables=True, include_orphan_tables=False), but the Parameters section documentsfilter_table. The singularfilter_tableis the query functions' spelling (bounding_box_query,polygon_query). Theinclude_orphan_tablesentry in the very same docstring already refers tofilter_tablescorrectly, so the two halves disagree with each other.3.
validate_axes—axisvsaxesvalidate_axes(axes)documentsaxis, which is the parameter ofvalidate_axis_namedirectly above it.All three are docstrings only, no behaviour change, and the singular/plural spellings used elsewhere in the codebase are left untouched — only the entries that disagree with their own signature are corrected.
Checked with a source-level pass over each function: the parameter names in the Parameters section now equal the signature exactly.
validate_axes['axes']['axes']SpatialData.subset['element_names', 'filter_tables', 'include_orphan_tables']rasterize_bins[..., 'value_key', 'return_region_as_labels']ruff checkandruff format --checkare clean on all three files.