Skip to content

Commit

Permalink
Add spaces between colons and variables in docstrings and rewrite dic…
Browse files Browse the repository at this point in the history
…t as Dict
  • Loading branch information
nanglo123 committed Dec 6, 2023
1 parent 755a01a commit 708de13
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 52 deletions.
12 changes: 6 additions & 6 deletions mira/metamodel/decapodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ def __init__(self, variables, op1s, op2s, summations, tangent_variables):
Parameters
----------
variables: Dict[int,Variable]
variables : Dict[int,Variable]
Mapping of Variables.
op1s: Dict[int,Op1]
op1s : Dict[int,Op1]
Mapping of Op1s (Operation 1s).
op2s: Dict[int,Op2]
op2s : Dict[int,Op2]
Mapping of Op2s (Operation 2s).
summations: Dict[int,Summation]
summations : Dict[int,Summation]
Mapping of Summations.
tangent_variables: Dict[int,TangentVariable]
tangent_variables : Dict[int,TangentVariable]
Mapping of TangentVariables.
"""
self.variables = variables
Expand Down Expand Up @@ -192,7 +192,7 @@ class TangentVariable:
Attributes
----------
id: int
id : int
The id of the tangent variable.
incl_var : Variable
The variable that is the result of a derivative operation associated
Expand Down
78 changes: 39 additions & 39 deletions mira/metamodel/template_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def from_json(cls, data: Dict[str, Any], locals_dict=None) -> "Initial":
Parameters
----------
data: dict[str,Any]
data : Dict[str,Any]
Mapping of Initial attributes to their values.
locals_dict: dict[str,Any]
locals_dict : Dict[str,Any]
Mapping of string symbols to their sympy equivalent.
Returns
Expand All @@ -73,9 +73,9 @@ def substitute_parameter(self, name, value):
Parameters
----------
name: str
name : str
The name of the parameter that will be substituted for.
value: Any
value : Any
The number value or expression to substitute for the parameter.
"""
self.expression = self.expression.subs(sympy.Symbol(name), value)
Expand All @@ -86,7 +86,7 @@ def get_parameter_names(self, known_param_names) -> Set[str]:
Parameters
----------
known_param_names: list[str]
known_param_names : list[str]
List of parameter names.
Returns
Expand Down Expand Up @@ -148,9 +148,9 @@ def substitute_parameter(self, name, value):
Parameters
----------
name: str
name : str
The name of the parameter that will be substituted for.
value: Any
value : Any
The number value or expression to substitute for the parameter.
"""
self.expression = self.expression.subs(sympy.Symbol(name), value)
Expand All @@ -161,7 +161,7 @@ def get_parameter_names(self, known_param_names) -> Set[str]:
Parameters
----------
known_param_names: list[str]
known_param_names : list[str]
List of parameter names.
Returns
Expand Down Expand Up @@ -410,7 +410,7 @@ def update_parameters(self, parameter_dict):
Parameters
----------
parameter_dict: dict[str,float]
parameter_dict : Dict[str,float]
Mapping of parameter name to value.
"""
Expand Down Expand Up @@ -445,9 +445,9 @@ def eliminate_duplicate_parameter(
Parameters
----------
redundant_parameter: str
redundant_parameter : str
The name of the parameter to remove.
preserved_parameter: str
preserved_parameter : str
The new name of the parameter to preserve.
"""
# Update the rate laws
Expand All @@ -463,7 +463,7 @@ def from_json(cls, data) -> "TemplateModel":
Parameters
----------
data: dict[str,Any]
data : Dict[str,Any]
Mapping of template model attributes to their values.
Returns
Expand Down Expand Up @@ -689,7 +689,7 @@ def get_concepts_map(self):
Returns
-------
: dict[str,Concept]
: Dict[str,Concept]
The mapping of concept keys to concepts that appear in this
template model's templates.
"""
Expand All @@ -702,7 +702,7 @@ def get_concepts_name_map(self):
Returns
-------
:dict[str,Concept]
: Dict[str,Concept]
Mapping of concept names to concepts that appear in this
template model's templates.
"""
Expand All @@ -714,7 +714,7 @@ def get_concept(self, name: str) -> Optional[Concept]:
Parameters
----------
name:
name :
The name to be queried for.
Returns
Expand Down Expand Up @@ -747,7 +747,7 @@ def get_concepts_by_name(self, name: str) -> List[Concept]:
Parameters
----------
name:
name :
The name to be queried for
Returns
Expand All @@ -774,11 +774,11 @@ def extend(
Parameters
----------
template_model:
template_model :
The template model to add
parameter_mapping:
parameter_mapping :
Mapping of parameter names to `Parameter`
initial_mapping:
initial_mapping :
Mapping of initial names to `Initial`
Returns
Expand Down Expand Up @@ -881,18 +881,18 @@ def add_transition(
Parameters
----------
transition_name:
transition_name :
Name of the new transition to be added.
subject_concept:
subject_concept :
The subject of the new transition.
outcome_concept:
outcome_concept :
The outcome of the new transition.
rate_law_sympy:
rate_law_sympy :
The rate law associated with the new transition.
params_dict:
params_dict :
Mapping of parameter attribute to their respective
values.
mass_action_parameter:
mass_action_parameter :
The mass action parameter that will be set to the transition's
mass action rate law if provided.
Returns
Expand Down Expand Up @@ -971,9 +971,9 @@ def substitute_parameter(self, name, value=None):
Parameters
----------
name: str
name : str
Name of the parameter to be substituted.
value:
value :
The value to substitute for the parameter.
Expand Down Expand Up @@ -1009,18 +1009,18 @@ def add_parameter(
Parameters
----------
parameter_id:
parameter_id :
The id of the parameter.
name:
name :
The name of the parameter.
description:
description :
The description of the parameter.
value:
value :
The value of the newly added parameter.
distribution: dict[str,Any]
distribution : Dict[str,Any]
Dictionary of distribution attributes to their values to be
passed into the `Distribution` constructor.
units_mathml:
units_mathml :
The unit of the parameter in mathml form.
"""
Expand Down Expand Up @@ -1053,7 +1053,7 @@ def eliminate_parameter(self, name):
Parameters
----------
name:str
name : str
The name of the parameter to be eliminated.
"""
self.substitute_parameter(name, value=0)
Expand All @@ -1064,7 +1064,7 @@ def set_parameters(self, param_dict):
Parameters
----------
param_dict: dict[str,float]
param_dict : Dict[str,float]
Mapping of parameter name to its new value.
"""
Expand All @@ -1078,7 +1078,7 @@ def set_initials(self, initial_dict):
Parameters
----------
initial_dict: dict[str,SympyExprStr]
initial_dict : Dict[str,SympyExprStr]
Mapping of initial name to its new expression.
"""
for name, expression in initial_dict.items():
Expand Down Expand Up @@ -1145,11 +1145,11 @@ def model_has_grounding(
Parameters
----------
template_model:
template_model :
The TemplateModel to query.
prefix:
prefix :
The prefix of the search curie.
identifier:
identifier :
The identifier of the search curie.
Returns
-------
Expand Down
14 changes: 7 additions & 7 deletions mira/sources/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ def transition_to_templates(
Parameters
----------
input_concepts: list[Concept]
input_concepts : list[Concept]
A list of Concepts serving as input to a transition.
output_concepts : list[Concept]
A list of Concepts serving as output to a transition.
controller_concepts: list[Concept]
controller_concepts : list[Concept]
A list of Concepts serving as controllers towards a transition.
transition_rate: sympy.Expr
transition_rate : sympy.Expr
The rate law associated with the transition.
transition_id: str
transition_id : str
The id of the transition.
transition_name: str
transition_name : str
The name of the transition.
Returns
-------
list[Template]
: list[Template]
A list containing Templates.
"""
if not controller_concepts:
Expand Down Expand Up @@ -128,7 +128,7 @@ def parameter_to_mira(parameter) -> Parameter:
Parameters
----------
parameter:Dict[str,Any]
parameter : Dict[str,Any]
A mapping containing MIRA Parameter attributes to values.
Returns
Expand Down

0 comments on commit 708de13

Please sign in to comment.