Skip to content

Correct the documented defaults for filled and alpha - #1073

Merged
kbattocchi merged 1 commit into
py-why:mainfrom
VenishPaneliya:documented-defaults
Oct 22, 2026
Merged

kbattocchi merged 1 commit into
py-why:mainfrom
VenishPaneliya:documented-defaults

Conversation

@VenishPaneliya

Copy link
Copy Markdown
Contributor

Ten documented defaults disagree with the code.

filled — nine entries say "default False" for an argument that defaults to True:

file methods
_tree_exporter.py _SingleTreeExporterMixin.export_graphviz, .render, .plot
policy/_drlearner.py export_graphviz, render, plot on both the policy tree and the policy forest interpreter

These surface on the public interpreters, since _SingleTreeExporterMixin is inherited by PolicyTree and by SingleTreeCateInterpreter / SingleTreePolicyInterpreter. _make_mpl_exporter documents filled without claiming a default, so it is left alone — it was the only one of the ten entries that was already correct.

alpha — one entry claims a default the signature does not have:

PopulationSummaryResults.percentile_point documents alpha as "default 0.05", but the signature is alpha=None and the body does alpha = self.alpha if alpha is None else alpha. conf_int_mean and conf_int_point use the same fallback and document it as "optional", so this now matches them rather than inventing new wording.

Docs only, no behaviour change. ruff check passes.

@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!

@kbattocchi
kbattocchi enabled auto-merge (rebase) October 20, 2026 13:50
Nine `filled` entries say "default False" for an argument that defaults
to True, across the three exporter methods on _SingleTreeExporterMixin
and the six on the policy tree and forest interpreters. _make_mpl_exporter
documents `filled` without claiming a default and is left alone.

PopulationSummaryResults.percentile_point documents alpha as
"default 0.05", but it defaults to None and falls back to self.alpha.
conf_int_mean and conf_int_point use the same fallback and document it as
"optional", so this now matches them.

Signed-off-by: VenishPaneliya <141703684+VenishPaneliya@users.noreply.github.com>
@kbattocchi
kbattocchi merged commit 9f61a33 into py-why:main Oct 22, 2026
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