Skip to content

Fix utilities docstrings that name parameters the functions do not have - #1076

Merged
kbattocchi merged 1 commit into
py-why:mainfrom
VenishPaneliya:utilities-param-names
Oct 20, 2026
Merged

kbattocchi merged 1 commit into
py-why:mainfrom
VenishPaneliya:utilities-param-names

Conversation

@VenishPaneliya

Copy link
Copy Markdown
Contributor

Three entries in econml.utilities name a parameter the function does not have. The module is in the public autosummary in doc/reference.rst, so these are rendered.

function signature documented
size X a
stack XS arrays
cross_product *XS X1 and X2

cross_product is the interesting one: neither X1 nor X2 can be passed by name, and documenting exactly two matrices understates it — the body loops over XS, so any number works. The two entries are replaced by a single *XS entry that keeps the original note about n-element vectors.

The Returns entry of cross_product is named A; numpydoc allows naming a return, so I left that alone.

Docs only, no behaviour change. ruff check passes. Small follow-up to #1072.

- size takes X, documented as a
- stack takes XS, documented as arrays
- cross_product takes *XS, but documented X1 and X2 as separate
  parameters. Neither name can be passed, and the entries implied exactly
  two matrices when the function accepts any number, so the two entries
  are replaced by one for *XS.

The Returns entry of cross_product is named A, which numpydoc allows, so
it is left alone.

Signed-off-by: VenishPaneliya <141703684+VenishPaneliya@users.noreply.github.com>

@kbattocchi kbattocchi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution! I don't think we'd ever expect cross_product to be called with named parameters, but I guess it doesn't hurt to clean this up.

@kbattocchi
kbattocchi enabled auto-merge (rebase) October 20, 2026 13:46
@kbattocchi
kbattocchi merged commit 98eaca1 into py-why:main Oct 20, 2026
111 of 114 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants