Skip to content

AttributeError: type object 'CLESolver' has no attribute 'model' #759

@briandrawert

Description

@briandrawert

While testing #754 the following code:

r3 = model.run(solver=CLESolver)
r3.plot()

Produced the error:

2022-03-28 17:19:43,272 - root - WARNING - model = gillespy2.model is deprecated. Future releases of GillesPy2 may not support this feature.
2022-03-28 17:19:43,272 - root - WARNING - model = gillespy2.model is deprecated. Future releases of GillesPy2 may not support this feature.
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~/Desktop/research/devils_dftd_modeling/../GillesPy2/gillespy2/core/model.py in run(self, solver, timeout, t, increment, show_labels, algorithm, **solver_args)
    992         try:
--> 993             return solver.run(model=self, t=t, increment=increment, timeout=timeout, **solver_args)
    994         except Exception as e:

~/Desktop/research/devils_dftd_modeling/../GillesPy2/gillespy2/solvers/numpy/CLE_solver.py in run(self, model, t, number_of_trajectories, increment, seed, debug, profile, live_output, live_output_options, timeout, resume, tau_tol, **kwargs)
    172                         'of GillesPy2 may not support this feature.')
--> 173         if self.model is None:
    174             if model is None:

AttributeError: type object 'CLESolver' has no attribute 'model'

The above exception was the direct cause of the following exception:

SimulationError                           Traceback (most recent call last)
<ipython-input-19-3eb83c44fd94> in <module>
----> 1 r3 = model.run(solver=CLESolver)
      2 r3.plot()

~/Desktop/research/devils_dftd_modeling/../GillesPy2/gillespy2/core/model.py in run(self, solver, timeout, t, increment, show_labels, algorithm, **solver_args)
    993             return solver.run(model=self, t=t, increment=increment, timeout=timeout, **solver_args)
    994         except Exception as e:
--> 995             raise SimulationError(
    996                 "argument 'solver={}' to run() failed.  Reason Given: {}".format(solver, e)
    997             ) from e

SimulationError: argument 'solver=<class 'gillespy2.solvers.numpy.CLE_solver.CLESolver'>' to run() failed.  Reason Given: type object 'CLESolver' has no attribute 'model'

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions