-
Notifications
You must be signed in to change notification settings - Fork 132
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
Improve snapshot api and document State #1079
Conversation
Some developers discussed in #819 that they expect methods that make in-place modifications to return the object. This enables chaining of modifications.
Per the discussion in #819, users find it confusing that the snapshot property access returns copies and does not allow direct modification. Make these explicit methods so that the intent of the design is clear as is the performance implications. Also, prevent the type names from changing when restoring snapshots. Allowing the names to change would lead to parameters for one type applying to another.
- Both files now pass cspell checks - Make a few clarifying statements
Give users a convenient shortcut to replicate a simulation state.
Make it clear to the user that the box property gives a copy and that setting the box is a separate operation.
sphinx formats properties with short docstrings side by side in a flowing layout. The layout is difficult to read as it makes an unevenly spaced grid of blocks. With this change, the `State` properties all render in a single column format.
Snapshot only offers brief descriptions of the particle properties. State gives a complete description.
for more information, see https://pre-commit.ci
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 think these access patterns make a lot of sense, and it seems like a well-reasoned improvement over the current design. I have only minor comments. (I did not verify that the Sphinx docs are rendering correctly.)
Co-authored-by: Bradley Dice <[email protected]>
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.
The documentation is awesome, this will be a big improvement from the current stub documentation and help answer a lot of user questions (assuming they read the documentation). I have a few minor comments, but nothing big.
Co-authored-by: Brandon Butler <[email protected]>
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.
LGTM 👍
Description
Implement the snapshot API improvements discussed in #819 . Also apply the same changes to the
State.box
property and add detailed documentation toState
to explain all of the data it stores.Motivation and context
See the extensive discussion in #819.
Resolves #819
How has this been tested?
The deprecated APIS are still present and use the new APIs.
Change log
Checklist:
sphinx-doc/credits.rst
) in the pull request source branch.