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

speedup report generation by using class attribs instead of instantiating #707

Merged
merged 1 commit into from
May 29, 2024

Conversation

leondz
Copy link
Owner

@leondz leondz commented May 29, 2024

drop the () after the class accesses in report_digest to skip this slow, inefficient step

docstrings guaranteed to be in place through tests.test_docs.test_check_docstring

…ting. docstrings guaranteed to be in place through tests.test_docs.test_check_docstring
@leondz leondz added reporting Reporting, analysis, and other per-run result functions quality-speed This affects the speed of program use labels May 29, 2024
@leondz leondz requested a review from jmartin-tech May 29, 2024 06:51
Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

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

Looks good. This also points out a that during review we need to be aware that class doc first line needs to be an complete sentence.

g.description
'Generator wrapper using LiteLLM to allow access to different'

g.__class__.__doc__.split("\n")[0]
'Generator wrapper using LiteLLM to allow access to different'

@jmartin-tech jmartin-tech merged commit 680bdb4 into main May 29, 2024
6 checks passed
@jmartin-tech jmartin-tech deleted the bugfix/accelerate_report_digest branch May 29, 2024 13:31
@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2024
@leondz
Copy link
Owner Author

leondz commented May 29, 2024

Looks good. This also points out a that during review we need to be aware that class doc first line needs to be an complete sentence.

g.description
'Generator wrapper using LiteLLM to allow access to different'

g.__class__.__doc__.split("\n")[0]
'Generator wrapper using LiteLLM to allow access to different'

Good point - split("\n\n") makes better sense

@jmartin-tech
Copy link
Collaborator

While that would allow longer descriptions in our reports it would not align with the python docs PEP

Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. The summary line may be on the same line as the opening quotes or on the next line.

Let's stick with this as is and do a pass at ensuring existing doc strings conform.

@leondz
Copy link
Owner Author

leondz commented May 29, 2024

I think I'm missing where it doesn't align - I think end line plus blank line is \n\n in our file format

@leondz
Copy link
Owner Author

leondz commented Aug 31, 2024

this resolved #719

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
quality-speed This affects the speed of program use reporting Reporting, analysis, and other per-run result functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants