Skip to content

Commit

Permalink
Add docstring for new method
Browse files Browse the repository at this point in the history
  • Loading branch information
bgyori committed Jan 3, 2025
1 parent a2ba072 commit 59376f2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion mira/metamodel/template_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,22 @@ class TemplateModel(BaseModel):
)

def get_parameters_from_expression(self, expression) -> Set[str]:
"""Given a symbolic expression, find its elements that are model parameters.
Expressions such as rate laws consist of some combination of participants,
rate parameters and potentially other factors. This function finds those
elements of expressions that are rate parameters.
Parameters
----------
expression : sympy.Symbol | sympy.Expr
A sympy expression or symbol, whose parameters are extracted.
Returns
-------
:
A set of parameter names (as strings).
"""
if expression is None:
return set()
params = set()
Expand Down Expand Up @@ -401,7 +417,7 @@ def get_parameters_from_rate_law(self, rate_law) -> Set[str]:
Parameters
----------
rate_law : sympy.Symbol | sympy.Expr
A sympy expression or symbol, whose names are extracted.
A sympy expression or symbol, whose parameters are extracted.
Returns
-------
Expand Down

0 comments on commit 59376f2

Please sign in to comment.