-
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
Changes from 17 commits
cdc39e8
9c8ff91
af7b95a
c865a37
68f3d1f
c5db8e9
0200ada
9309616
baf77d9
aee8cd3
5b8fd1a
23ac203
661f13c
192db01
dfe5e5d
daedb33
de55418
1c4d1ac
369ddc2
3d97c3e
cab21d6
ad8ab00
49c19c8
915eacc
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 | ||||
---|---|---|---|---|---|---|
|
@@ -183,7 +183,12 @@ def ws(self): | |||||
return self.workspace() | ||||||
|
||||||
def reset_statepoint(self, new_statepoint): | ||||||
"""Reset the state point of this job. | ||||||
"""Overwrite the state point of this job while preserving job data. | ||||||
|
||||||
This method will change the job id if the state point has been altered. | ||||||
|
||||||
For more information, see | ||||||
`Modifying the State Point <https://docs.signac.io/en/latest/jobs.html#modifying-the-state-point>`_. | ||||||
|
||||||
.. danger:: | ||||||
|
||||||
|
@@ -196,7 +201,7 @@ def reset_statepoint(self, new_statepoint): | |||||
new_statepoint : dict | ||||||
The job's new state point. | ||||||
|
||||||
""" | ||||||
""" # noqa: E501 | ||||||
dst = self._project.open_job(new_statepoint) | ||||||
if dst == self: | ||||||
return | ||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
This method will change the job id if the state point has been altered. | ||||||
|
||||||
For more information, see | ||||||
`Modifying the State Point <https://docs.signac.io/en/latest/jobs.html#modifying-the-state-point>`_. | ||||||
cbkerr marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
.. warning:: | ||||||
|
||||||
|
@@ -256,9 +266,10 @@ def update_statepoint(self, update, overwrite=False): | |||||
update : dict | ||||||
A mapping used for the state point update. | ||||||
overwrite : | ||||||
bdice marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
Set to true, to ignore whether this update overwrites parameters, | ||||||
which are currently part of the job's state point. | ||||||
Use with caution! (Default value = False) | ||||||
If True, this method will set all existing and new parameters | ||||||
to a job's statepoint, making it equivalent to | ||||||
:meth:`~.reset_statepoint`. Use with caution! | ||||||
(Default value = False) | ||||||
|
||||||
Raises | ||||||
------ | ||||||
|
@@ -270,7 +281,7 @@ def update_statepoint(self, update, overwrite=False): | |||||
OSError | ||||||
If the move failed due to an unknown system related error. | ||||||
|
||||||
""" | ||||||
""" # noqa: E501 | ||||||
statepoint = self.statepoint() | ||||||
if not overwrite: | ||||||
for key, value in update.items(): | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1408,7 +1408,9 @@ def create_linked_view(self, prefix=None, job_ids=None, index=None, path=None): | |||||
details="Use job.reset_statepoint() instead.", | ||||||
) | ||||||
def reset_statepoint(self, job, new_statepoint): | ||||||
"""Reset the state point of job. | ||||||
"""Overwrite the state point of this job while preserving job data. | ||||||
|
||||||
This method will change the job id if the state point has been altered. | ||||||
|
||||||
.. danger:: | ||||||
|
||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
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. There's another small issue here, which is that "without affecting existing parameters" is only true if 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. 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 commentThe 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 |
||||||
|
||||||
This method will change the job id if the state point has been altered. | ||||||
|
||||||
.. warning:: | ||||||
|
||||||
|
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