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

Improve docstrings as needed for OpenFE #220

Merged
merged 8 commits into from
Aug 29, 2023
Merged

Conversation

Yoshanuikabundi
Copy link
Contributor

@Yoshanuikabundi Yoshanuikabundi commented Aug 22, 2023

This PR moves more docstrings out of attribute sections of docstrings and onto the corresponding object itself. This helps comprehensive API documentation in OpenFE. Required by OpenFreeEnergy/openfe#527

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ddd4ca4) 99.12% compared to head (6cb6c22) 99.12%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #220   +/-   ##
=======================================
  Coverage   99.12%   99.12%           
=======================================
  Files          36       36           
  Lines        1827     1827           
=======================================
  Hits         1811     1811           
  Misses         16       16           
Files Changed Coverage Δ
gufe/components/component.py 92.30% <ø> (ø)
gufe/components/proteincomponent.py 100.00% <ø> (ø)
gufe/components/smallmoleculecomponent.py 100.00% <ø> (ø)
gufe/components/solventcomponent.py 98.38% <ø> (ø)
gufe/mapping/ligandatommapping.py 100.00% <ø> (ø)
gufe/tokenization.py 98.10% <ø> (ø)
gufe/chemicalsystem.py 100.00% <100.00%> (ø)
gufe/network.py 100.00% <100.00%> (ø)
gufe/protocols/protocol.py 96.55% <100.00%> (ø)
gufe/protocols/protocoldag.py 100.00% <100.00%> (ø)
... and 1 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dwhswenson dwhswenson left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me. One section title that I think will be very misleading, and so needs to be renamed, and a tiny fix that is because @Yoshanuikabundi fixed half of someone else's mistake, otherwise it would have gone unnoticed.

docs/api/tokenization.rst Outdated Show resolved Hide resolved
gufe/tokenization.py Outdated Show resolved Hide resolved
@Yoshanuikabundi
Copy link
Contributor Author

I think this is ready to go!

@@ -56,7 +56,8 @@


class ProteinComponent(ExplicitMoleculeComponent):
"""Wrapper around a Protein representation.
"""
:class:`Component` representing a protein.
Copy link
Contributor

Choose a reason for hiding this comment

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

We really should rename this component - in reality this is just "a wrapper around something you placed in a PDB".

Not sure if we at least want to fix this in the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Copy link
Contributor

Choose a reason for hiding this comment

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

c.f. #139

Copy link
Member

@dwhswenson dwhswenson left a comment

Choose a reason for hiding this comment

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

Small change recommended: a couple of times we talk about the DAG dependency order; we should be very explicit in which order that is.

I think it is in the order that follows the arrow of time, is that correct, @dotsdl @richardjgowers? In the sense that a "parent" node will come before a "child" node, i.e., that this order is a possible execution order for the DAG.

I know @Yoshanuikabundi is mainly moving existing text around, but as long as we're taking a closer look, let's clarify things.

@@ -181,10 +152,18 @@ def _from_dict(cls, dct: dict):

@property
def result_graph(self) -> nx.DiGraph:
"""
DAG of `ProtocolUnitResult` nodes with edges denoting dependencies.
Copy link
Member

Choose a reason for hiding this comment

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

Can we clarify here the direction of dependencies? (I honestly don't remember if edges point to "previous" or to "next")

Copy link
Contributor

Choose a reason for hiding this comment

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

edges point to previous

"""
`ProtocolUnitResult`s for each `ProtocolUnit` used to compute this object.

Results are given in DAG-dependency order.
Copy link
Member

Choose a reason for hiding this comment

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

Again, better to clarify exactly what order is meant here.

@Yoshanuikabundi
Copy link
Contributor Author

@dwhswenson I completely agree that these docstrings are unclear, but can we leave it for another PR? It'll need input from someone who knows what is going on and this PR is currently holding up OpenFreeEnergy/openfe#527. I've raised an #223 as a reminder.

@dwhswenson
Copy link
Member

Yep... with #223 to remind, I think this is good. Sorry if this slows you down at all. I'm trying to take advantage of a new set of eyes on the docs as a chance to improve aspects that are unclear when we look at them with our own fresh eyes.

@richardjgowers richardjgowers merged commit 2ff5557 into main Aug 29, 2023
7 checks passed
@richardjgowers richardjgowers deleted the attribute_docstrings branch August 29, 2023 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants