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

Use functools for codeTiming decorator. #1466

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

mgjarrett
Copy link
Contributor

@mgjarrett mgjarrett commented Nov 8, 2023

What is the change?

Use the @functools.wraps() decorator to transfer attributes from the wrapped function to the wrapper function created by @codeTiming.timed.

Why is the change being made?

The codeTiming.timed decorator was interfering with the API docs. See interactBOL and interactBOC under the LatticePhysicsInterface, where the docstrings did not make it into the docs.

image

This update will get the docstrings to render correctly in the API docs:

image


Checklist

  • The release notes (location doc/release/0.X.rst) are up-to-date with any important changes.
  • The documentation is still up-to-date in the doc folder.
  • No requirements were altered.
  • The dependencies are still up-to-date in pyproject.toml.

@mgjarrett mgjarrett added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 8, 2023
Copy link
Member

@opotowsky opotowsky left a comment

Choose a reason for hiding this comment

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

Nice sleuthing! 🕵️

@mgjarrett mgjarrett merged commit d803a71 into terrapower:main Nov 8, 2023
13 checks passed
@mgjarrett mgjarrett deleted the codeTimingFix branch November 8, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants