Skip to content

Commit

Permalink
Add model parameters to safe parse of distribution parameters
Browse files Browse the repository at this point in the history
Sympy expressions of distribution parameters may contain model parameters as free variables.

This PR passes  `param_symbols` to the safe parse of distribution parameter expressions.  This will support the representation of multi-level models.

```python
processed_distr_parameters[param_key] = \
                    safe_parse_expr(param_value, local_dict=param_symbols)
```
  • Loading branch information
djinnome authored Oct 23, 2024
1 parent e559f46 commit 451345e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mira/sources/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def parameter_to_mira(parameter, param_symbols=None) -> Parameter:
processed_distr_parameters[param_key] = float(param_value)
elif isinstance(param_value, str):
processed_distr_parameters[param_key] = \
safe_parse_expr(param_value)
safe_parse_expr(param_value, local_dict=param_symbols)
else:
raise ValueError(f"Parameter {param_key} is neither a float, "
f"int, or str")
Expand Down

0 comments on commit 451345e

Please sign in to comment.