-
Notifications
You must be signed in to change notification settings - Fork 12
doc: Add documentation to the Result class in testplan.py #214
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,31 @@ | |
|
|
||
|
|
||
| class Result: | ||
| """The results for a single test.""" | ||
| """The results for a job.""" | ||
|
|
||
| def __init__(self, name, passing=0, total=0, job_runtime=None, simulated_time=None) -> None: | ||
| def __init__( | ||
| self, | ||
| name: str, | ||
| passing: int = 0, | ||
| total: int = 0, | ||
| job_runtime: float | None = None, | ||
| simulated_time: float | None = None, | ||
| ) -> None: | ||
| """Construct a Result with the given parameters. | ||
|
|
||
| Args: | ||
| name: The name of the test. | ||
|
|
||
| passing: The number of runs that passed (possibly different seeds). | ||
|
|
||
| total: The number of runs that happened (will be at least as large as | ||
| passing). | ||
|
Comment on lines
+36
to
+37
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another nice idea might be to add setters for |
||
|
|
||
| job_runtime: If not None, the number of seconds taken by the job. | ||
|
|
||
| simulated_time: If not None, the simulated time in microseconds. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't need to be changed in this PR (as I appreciate it would be a widespread change across the code base) - but IMO these parameters should be suffixed by their units (e.g. |
||
|
|
||
| """ | ||
| self.name = name | ||
| self.passing = passing | ||
| self.total = total | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion I might have would be to make most of the arguments here keyword-only:
This is because currently you can make a
Resultlike:which isn't particularly descriptive to read, so you need to search through the definition. This change would instead mean you need to write:
I'll leave it up to you whether you prefer that or not though.