Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve typing and doc for physics engines #1981

Draft
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

pushfoo
Copy link
Member

@pushfoo pushfoo commented Feb 22, 2024

A follow-up to #1973 after reading through it.

Changes

  • Add missing type hints to physics engines
  • Rewrite existing docstrings for clarity
  • Fix style and clarity issues in code
  • Add comments to clarify actions in some places
  • Fix copy and pasted docstring comments in pymunk physics engine docstrings

Why

The physics engines are part of the most popular tutorial users interact with. Their doc and type annotations should live up to that to improve first-timer experience.

* Add link target for spatial hashing heading in performance tips

* Use the top directive for the tip

* Remove the types from the engine's docstrings

* Initial cross-referencing with links to tutorials and example code

* Clean up formatting
* Add missing return annotations

* Rewrite docstring for is_on_ladder
* Use directives and clarity in docstring

* Add cross-references

* Split a gnarly if statement into an elif for readability

* Add comments in function body
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.

None yet

1 participant