-
Notifications
You must be signed in to change notification settings - Fork 36
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
doc/bettter document update and reset statepoint #444
Conversation
Codecov Report
@@ Coverage Diff @@
## master #444 +/- ##
=======================================
Coverage 77.18% 77.18%
=======================================
Files 42 42
Lines 5768 5768
Branches 1129 1129
=======================================
Hits 4452 4452
Misses 1030 1030
Partials 286 286
Continue to review full report at Codecov.
|
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.
Thanks for the PR @cbkerr! I agree these docs can be improved. I have a few suggestions for better clarity and usage of Sphinx features.
|
||
Change the job id if necessary. | ||
For more, see | ||
`Modifying the State Point <https://docs.signac.io/en/latest/jobs.html#modifying-the-state-point>`_. |
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.
This should use an intersphinx reference to _project-job-statepoint-modify
.
See this guide: https://github.com/glotzerlab/signac-docs/wiki/How-to-cross-reference-links-between-package-docs-and-signac-docs-using-intersphinx
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.
I'll make a new issue to add intersphinx because none of the files use it yet.
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.
made #452 to involve newer contributors
Co-authored-by: Bradley Dice <[email protected]>
@cbkerr feel free to ping me if you would like me to weigh in on any discussions, but I'll refrain from commenting too much otherwise since I think you've summarized (and expanded upon!) our discussion very nicely in glotzerlab/signac-docs#108 and here. |
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.
This is a good improvement. We need to make the same changes for Project.update_statepoint
and Project.reset_statepoint
. Those methods are deprecated but documentation improvements should still be applied. I would have preferred to start using intersphinx references in this PR rather than deferring that to #452, to set a good example for the future, but I understand if you wish to skip that for now.
not ready to merge yet! |
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.
figuring out best way to address @Charlottez112's comment. One option is to add to the first sentence which is good for completeness.
Another could be adding a wholely new sentence.
signac/contrib/project.py
Outdated
@@ -1440,7 +1442,9 @@ def reset_statepoint(self, job, new_statepoint): | |||
details="Use job.update_statepoint() instead.", | |||
) | |||
def update_statepoint(self, job, update, overwrite=False): | |||
"""Update the state point of this job. | |||
"""Change the state point of this job without affecting existing parameters. |
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.
"""Change the state point of this job without affecting existing parameters. | |
"""Change the state point of this job without affecting existing parameters while preserving job data. |
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.
There's another small issue here, which is that "without affecting existing parameters" is only true if overwrite=False
, so that might be misleading.
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.
I agree with @vyasr that this suggestion is potentially misleading. The summary line of a docstring must be short. It doesn't have to fully explain the behavior or how various parameters affect its behavior - that's better to put in the description after the first line and the "Parameters" sections.
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.
I made a separate sentence to address @Vyas's point. I left in "while preserving job data" in both to resolve my confusion and @Charlottez112 's suggestion
signac/contrib/job.py
Outdated
@@ -243,7 +248,12 @@ def _reset_sp(self, new_statepoint=None): | |||
self.reset_statepoint(new_statepoint) | |||
|
|||
def update_statepoint(self, update, overwrite=False): | |||
"""Update the state point of this job. | |||
"""Change the state point of this job without affecting existing parameters. |
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.
"""Change the state point of this job without affecting existing parameters. | |
"""Change the state point of this job without affecting existing parameters while preserving job data. |
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.
This PR is waiting on @cbkerr to make some additional wording changes.
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.
This PR is waiting on @cbkerr to make some wording changes.
Some error from when I merged in the master branch on the windows build. Maybe from the recent CI changes?
|
Ignore this, it's a random failure. It's been happening a fair amount in the last couple days for no apparent reason. |
@cbkerr I fixed up some places where |
I think my problem was that I made the changes before merging and didn't check when the merge just worked... |
Description
The docstrings for
job.update_statepoint()
andjob.reset_statepoint()
are confusing because they are too short and use the same words in the definition.Here, I propose an update for them to be able to stand on their own.
I also linked them to the relevant part of signac docs (no intersphinx because the other link in the file didn't use it.)
Note: preview the changes live here: https://signac--444.org.readthedocs.build/projects/core/en/444/api.html#the-job-class
Motivation and Context
See a bigger write-up about the confusion here: glotzerlab/signac-docs#108
In an offline discussion with @vyasr last week, we also realized that the main documentation states that these functions change the job id while the docstrings do not. Here, I also propose we add that notice to the docstrings.
Types of Changes
1The change breaks (or has the potential to break) existing functionality.
Checklist:
If necessary: