🐛 fix(pdoc): correct four misspelled __pdoc__ kwargs - #710
Merged
nstarman merged 2 commits intoAug 14, 2026
Conversation
`use_short_names` and `named_units` are not parameters of
`unxt`'s `__pdoc__` -- the real names are singular, `use_short_name` and
`named_unit`. `wadler_lindig` forwards unrecognised kwargs untouched, so these
were swallowed by `**kwargs` and did nothing at all:
>>> wl.pformat(u.Q(10.0, "m"), short_arrays="compact",
... use_short_names=True, named_units=False) # misspelled
"Quantity(10., unit='m')"
>>> wl.pformat(u.Q(10.0, "m"), short_arrays="compact",
... use_short_name=True, named_unit=False) # correct
"Q(10., 'm')"
Two of the three call sites already spelled `named_unit` correctly on the
adjacent line, so they were half-working: units printed positionally while the
class name stayed long.
Only `charts.py` had both wrong, so it is the only place the output changes --
two doctests move from `unit='km'` to `'km'`, which is what
`named_unit=False` was asking for. `StaticQuantity` has no `short_name`, so
`use_short_name=True` has no visible effect there.
Found while tracing `__pdoc__` kwargs for GalacticDynamics/unxt#855.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes four misspelled __pdoc__ keyword arguments that were being silently ignored (forwarded via **kwargs) when building Wadler–Lindig docs, ensuring unxt pretty-printing options are correctly applied.
Changes:
- Replace
use_short_names→use_short_namein the__pdoc__defaults for charts, frames, and transforms. - Replace
named_units→named_unitin chart__pdoc__defaults. - Update two
charts.pydoctest expected outputs to reflect the corrected pretty-printer behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coordinax/transforms/_src/actions/add.py | Fixes __pdoc__ default kwarg name so short type names are actually used in transform docs/__repr__. |
| src/coordinax/frames/_src/base.py | Fixes __pdoc__ default kwarg name so frames can render with short type names as intended. |
| src/coordinax/_src/base/charts.py | Fixes both kwarg names and updates doctests so chart docs reflect the actual pretty-printer configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`use_short_name` now actually reaches `wadler_lindig`, so `Galactocentric`'s `z_sun` renders `Q(f64[], 'pc')` rather than `Quantity(f64[], 'pc')` -- which is the point of the fix, and matches every other quantity in the same repr. Only these two examples pinned the long spelling. Swept the rest of the repo for other stale long-name expectations; there are none. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #710 +/- ##
==========================================
- Coverage 96.52% 96.47% -0.06%
==========================================
Files 262 262
Lines 8578 8616 +38
==========================================
+ Hits 8280 8312 +32
- Misses 298 304 +6 ☔ View full report in Codecov by Harness. 🚀 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.
use_short_namesandnamed_unitsare not parameters ofunxt's__pdoc__—the real names are singular,
use_short_nameandnamed_unit.wadler_lindigforwards unrecognised kwargs untouched, so these were swallowedby
**kwargsand did nothing at all.Verified before changing anything:
Sites
_src/base/charts.pyuse_short_names,named_unitsframes/_src/base.pyuse_short_namesnamed_unitalready correcttransforms/_src/actions/add.pyuse_short_namesnamed_unitalready correctThe latter two were half-working: units printed positionally while the class
name stayed long.
charts.pywas the only fully-broken one.Output change
Small, and confined to
charts.py— two doctests move fromunit='km'to'km', which is exactly whatnamed_unit=Falsewas asking for:ProlateSpheroidal3D[('mu', 'nu', 'phi'), ('area', 'area', 'angle')]( - Delta=StaticQuantity(array(20), unit='km'), M=Rn(3) + Delta=StaticQuantity(array(20), 'km'), M=Rn(3) )StaticQuantityhas noshort_name, souse_short_name=Truehas no visibleeffect there. Nothing else in the suite changes.
Verification
pytest src docs tests README.md— the only failures were those two doctests(now updated) and one
hypothesisDeadlineExceeded intests/unit/charts/test_cdict.pythat passes on re-run and is unrelated.ruff checkandruff format --checkclean.Found while tracing
__pdoc__kwargs for GalacticDynamics/unxt#855.