Skip to content

🐛 fix(pdoc): correct four misspelled __pdoc__ kwargs - #710

Merged
nstarman merged 2 commits into
GalacticDynamics:mainfrom
nstarman:claude/fix-pdoc-kwarg-typos
Aug 14, 2026
Merged

🐛 fix(pdoc): correct four misspelled __pdoc__ kwargs#710
nstarman merged 2 commits into
GalacticDynamics:mainfrom
nstarman:claude/fix-pdoc-kwarg-typos

Conversation

@nstarman

Copy link
Copy Markdown
Contributor

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.

Verified before changing anything:

>>> 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')"

Sites

file was
_src/base/charts.py use_short_names, named_units both wrong
frames/_src/base.py use_short_names named_unit already correct
transforms/_src/actions/add.py use_short_names named_unit already correct

The latter two were half-working: units printed positionally while the class
name stayed long. charts.py was the only fully-broken one.

Output change

Small, and confined to charts.py — two doctests move from unit='km' to
'km', which is exactly what named_unit=False was 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)
  )

StaticQuantity has no short_name, so use_short_name=True has no visible
effect 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 hypothesis DeadlineExceeded in
tests/unit/charts/test_cdict.py that passes on re-run and is unrelated.
ruff check and ruff format --check clean.

Found while tracing __pdoc__ kwargs for GalacticDynamics/unxt#855.

`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>
Copilot AI lite review requested due to automatic review settings August 13, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_namesuse_short_name in the __pdoc__ defaults for charts, frames, and transforms.
  • Replace named_unitsnamed_unit in chart __pdoc__ defaults.
  • Update two charts.py doctest 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.

@github-actions github-actions Bot added the 🐛 Fix a bug Fix a bug. label Aug 13, 2026
@nstarman nstarman added this to the v0.24.0 milestone Aug 13, 2026
`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>
@github-actions github-actions Bot added the ✅ Add / update / pass tests Add, update, or pass tests. label Aug 13, 2026
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.47%. Comparing base (0800737) to head (898a4c5).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nstarman
nstarman merged commit 14748eb into GalacticDynamics:main Aug 14, 2026
17 of 18 checks passed
@nstarman
nstarman deleted the claude/fix-pdoc-kwarg-typos branch August 14, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✅ Add / update / pass tests Add, update, or pass tests. 🐛 Fix a bug Fix a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants