Skip to content

Commit

Permalink
Passing parameters to parents of RunnableModel (#205)
Browse files Browse the repository at this point in the history
Any additional parameters to the Model class are set as `params`. However, this is not the case for its child class RunnableModel, and therefore can't be used for child classes derived from it. To handle parameter input consistently they should be passed all the way up to the Model class. So, this PR adds `**params` to the RunnableModel init and to its super call.
  • Loading branch information
rgutzen committed Mar 9, 2022
1 parent bb4bfba commit 0c2b13b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sciunit/models/runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ def __init__(
name, # Name of the model
backend=None, # Backend to run the models
attrs=None, # Optional dictionary of model attributes
**params,
):
super(RunnableModel, self).__init__(name=name)
super(RunnableModel, self).__init__(name=name, **params)
self.skip_run = False # Backend can use this to skip simulation
self.run_params = {} # Should be reset between tests
self.print_run_params = False # Print the run parameters with each run
Expand Down

0 comments on commit 0c2b13b

Please sign in to comment.