Docstring updates#316
Conversation
| """RNA sequence component with specified length. | ||
|
|
||
| An `RNA` component represents an RNA sequence with a given length in | ||
| base pairs. This is a basic component that produces no reactions on its |
There was a problem hiding this comment.
I think this line "produces no reactions on its own" is added to the docstrings of all components but it is slightly misleading. Components are not supposed to produce reaction by definition. For example, when the RBS component updates the reactions it calls on the mechanism to do it:
def update_reactions(self):
mech_tl = self.get_mechanism('translation')
reactions = []
if self.protein is not None:
reactions += mech_tl.update_reactions(
transcript=self.transcript,
protein=self.protein,
component=self,
part_id=self.name,
)
return reactions
I think I can go in and edit this to clarify in all such component docstrings..
There was a problem hiding this comment.
Suggestions for better wording for components that do not have an associated mechanism and hence don't cause reactions to be generated?
Perhaps "This component has no associated mechanism to generate species or reactions, but can be used to represent mRNA, tRNA, rRNA, or other RNA molecules."?
There was a problem hiding this comment.
Yes, that is a good re-wording.
| def update_reactions(self) -> List[Reaction]: | ||
| """Generate binding and unbinding reactions for the complex. | ||
|
|
||
| Uses the 'binding' mechanism to generate reactions for complex |
There was a problem hiding this comment.
Similar to the previous comment, I am not sure if the component "generates a reaction". The code below gets the mechanism to associate it with the component and then the mechanism generates the reactions. I understand that this is perhaps minor but it's also core to how biocrnpyler was designed.
There was a problem hiding this comment.
Is there better wording we can use? The description section of the docstring makes clear that it is the 'binding' mechanism that generates the reactions, but I agree that the summary line is misleading.
Summary lines are supposed to be short (65 characters or less, I think), so we have to keep the wording tight. Some possibilities:
- "Call 'binding' mechanism to generate component reactions." (55 chars)
- "Use 'binding' mechanism to create binding/unbinding reactions." (64 chars)
- "Apply 'binding' mechanism to generate complex reactions." (57 chars)
There was a problem hiding this comment.
Also: do we want to use similar wording for update_species?
There was a problem hiding this comment.
I like either the first or the second possibilities you listed out: ""Call 'binding' mechanism to generate component reactions." or "Use...."
and yes, we might similarly re-word update_species in the components.
| A ChemicalReactionNetwork (CRN) represents a biochemical system as a set | ||
| of species and reactions between them. CRNs can be compiled to SBML format | ||
| for simulation with various tools, or simulated directly with bioscrape or | ||
| roadrunner. |
There was a problem hiding this comment.
Do we want to add here that bioscrape simulation is built into biocrnpyler..
ayush9pandey
left a comment
There was a problem hiding this comment.
This is great. I skimmed through the docstrings and read some of the ones in core classes in detail. It looks good to me.
|
I've addressed @ayush9pandey's comments. I've got some more documentation updates coming (for the reference manual), so my plan is to merge this tomorrow (Sun) unless someone (e.g., @dr3y, @zjuradoq, or @WilliamIX) let me know they would like me to wait so that they can look through things (definitely not urgent; these are just docstrings and we can modify them later). |
|
@murrayrm I’ve reviewed the updates to the membrane components and mechanism, and everything looks correct. The updated docstrings are really well written and clearly described. |
ayush9pandey
left a comment
There was a problem hiding this comment.
Thank you for all the changes. Looks great!!
This PR provides updated docstrings for components, mechanisms, mixtures, and core classes and functions. Existing docstrings were converted to NumPy format (with numpydoc conventions) and missing docstrings were added, along with examples.
I used Claude to generate the docstrings and then checked them all to make sure they made sense and that the examples ran. Here is the prompt that was used for Claude (Opus 4.1 and Sonnet 4.5):
In addition, specialized prompts were used for DNA components, mechanisms, and mixtures:
In addition to the updated docstrings, a few changes were made to the code:
degredasekeyword in theDeg_Tagged_Degradationglobal mechanism was changed todegradase(corrected spelling)AnitDilutionConstiutiveCreationglobal mechanism was renamedAntiDilutionConstitutiveCreation(corrected spellings)Some requests: