Skip to content

Fix the PPO example docstrings to name the arguments the constructors take - #21887

Open
darkdi wants to merge 1 commit into
Lightning-AI:masterfrom
darkdi:fix/ppo-example-docstring-args
Open

Fix the PPO example docstrings to name the arguments the constructors take#21887
darkdi wants to merge 1 commit into
Lightning-AI:masterfrom
darkdi:fix/ppo-example-docstring-args

Conversation

@darkdi

@darkdi darkdi commented Aug 6, 2026

Copy link
Copy Markdown

What does this PR do?

The two policy-network constructors in the PPO domain template document arguments they do not take. Both say:

Args:
    input_shape: observation shape of the environment
    n_actions: number of discrete actions available in the environment

but ActorCategorical.__init__ takes only actor_net, and ActorContinuous.__init__ takes actor_net and act_dim. The entries are left over from a version that built the network inside the constructor — ExperienceSourceDataset above them still takes the network from the caller.

This is a template people copy, so the wrong names travel. Replaced the four entries with the arguments that are actually there. Docstrings only; nothing else in the file changes.

One related thing I left alone: LambdaCallback documents **kwargs, while its __init__ spells out every hook explicitly and has no **kwargs. Strictly it is the same defect, but the honest fix would mean listing fifty keyword arguments or rewording the entry, and that is your call rather than mine.

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes? — no behaviour change; ruff check and ruff format --check pass on the file with the pinned ruff==0.15.9
  • Did you list all the breaking changes introduced by this pull request? — none
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.

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.

1 participant