Repository navigation
DOC: Update table docstrings to clarify parameters and defaults - #20217
Merged
Merged
Conversation
Member
|
Have to wait for GHA to come back online first. |
taldcroft
force-pushed
the
table-fix-docstring-arguments
branch
from
August 7, 2026 13:11
b79a882 to
aa6c898
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
MaanasArora
pushed a commit
to MaanasArora/astropy
that referenced
this pull request
Aug 10, 2026
Member
|
Hmm if auto backport not possible, I guess I'll move it back to original milestone not to backport. Sorry for the noise! |
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.
AI disclosure
This PR was entirely generated by AI (Claude Opus 5) and @taldcroft reviewed the changes.
Description
This pull request is to fix inconsistencies between function signatures and their
numpydoc
Parameterssections throughout theastropy.tablesubpackage.All 22 modules in
astropy/tablewere audited with an AST-based checker that compareseach function/method signature against its docstring in both directions: parameters
documented but absent from the signature, signature parameters missing from the
docstring, parameter ordering disagreement, documented-vs-actual default values, and
__new__/__init__signature agreement.The changes are documentation-only — no runtime behavior is modified.
Incorrect documented default (user-visible)
BaseColumn.pprintdocumentedshow_dtypeas "Default is True" when the signaturedefault is
False.Undocumented parameters in public API
ColumnandMaskedColumnclass docstrings omittedcopyandcopy_indices.Note that the
copydefault isNone, notTrue: it is forwarded tonp.array(..., copy=...)and therefore follows NumPy 2 semantics, whereFalseraises
ValueErrorif a copy cannot be avoided. This was verified empiricallyrather than assumed, and is documented accordingly.
Table.insert_rowomittedindexfromParameters(it was only described in theprose above the section).
simple_tableomittedmasked, despite the docstring's own example callingsimple_table(3, 6, masked=True, kinds='ifOS').Parameter ordering mismatches
uniquedocumentedkeepbeforesilent; the signature isunique(input_table, keys=None, silent=False, keep="first"). Both are commonlypassed positionally, so the documented order was actively misleading.
notebook_backends.classicdocumentedtable_classbeforecssanddisplay_length; the signature has it after.Undocumented parameters in internal functions
_join: addedkeys_leftandkeys_right, reusing the wording already present onthe public
join._vstack: addedmetadata_conflicts, matching the publicvstackwording.table_info: addedtbl.Table._convert_string_dtype: addedencode_decode_func. The description waschecked against the two call sites, which pass
np.strings.decode/np.strings.encodeas a UTF-8 fallback after the fast ASCII path fails.
TableFormatter._pformat_col,_pformat_col_iter,_pformat_table, and_more_tabcol: added the leadingcol/table/tabcolargument, which is theprimary subject of each of these methods.
TableFormatter._pformat_table: fixed "Default is to False" to "Default is False".