Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dimerization example #774

Closed
GFP-akers opened this issue Apr 12, 2022 · 1 comment · Fixed by #731
Closed

Dimerization example #774

GFP-akers opened this issue Apr 12, 2022 · 1 comment · Fixed by #731
Assignees
Labels
bug Something isn't working ✔️​ Issue / PR has been resolved
Milestone

Comments

@GFP-akers
Copy link

GFP-akers commented Apr 12, 2022

If the code for the Dimerization() example is ran (direct copy and paste), the program throws an error "Circular reference detected".
raise SimulationError(
SimulationError: argument 'solver=<class 'gillespy2.solvers.numpy.ssa_solver.NumPySSASolver'>' to run() failed. Reason Given: Circular reference detected

Re-produced on main using the SSACSolver and is present in all solvers. Full trace below:

2022-04-13 09:39:25,855 - root - WARNING - Please install/configure 'g++' and 'make' on your system, to ensure that GillesPy2 C solvers will run properly.
2022-04-13 09:39:25,855 - root - WARNING - Please install/configure 'g++' and 'make' on your system, to ensure that GillesPy2 C solvers will run properly.
Traceback (most recent call last):
  File "/Users/bryanrumsey/Documents/GillesPy2/gillespy2/core/model.py", line 1011, in run
    return solver.run(model=self, t=t, increment=increment, timeout=timeout, **solver_args)
  File "/Users/bryanrumsey/Documents/GillesPy2/gillespy2/solvers/cpp/ssa_c_solver.py", line 49, in run
    if model is not None and model.get_json_hash() != self.model.get_json_hash():
  File "/Users/bryanrumsey/Documents/GillesPy2/gillespy2/core/jsonify.py", line 158, in get_json_hash
    model_json = self.to_json(encode_private=hash_private_vals)
  File "/Users/bryanrumsey/Documents/GillesPy2/gillespy2/core/jsonify.py", line 49, in to_json
    return json.dumps(copy.deepcopy(self), indent=4, sort_keys=True, default=encoder.default)
  File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 234, in dumps
    return cls(
  File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 439, in _iterencode
    yield from _iterencode(o, _current_indent_level)
  File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 436, in _iterencode
    raise ValueError("Circular reference detected")
ValueError: Circular reference detected

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/Users/bryanrumsey/Documents/GillesPy2/examples/ExtraModels/dimer_example.py", line 119, in <module>
    output = model.run(number_of_trajectories=10)
  File "/Users/bryanrumsey/Documents/GillesPy2/gillespy2/core/model.py", line 1022, in run
    raise SimulationError(
gillespy2.core.gillespyError.SimulationError: argument 'solver=<class 'gillespy2.solvers.cpp.ssa_c_solver.SSACSolver'>' to run() failed.  Reason Given: Circular reference detected

This error doesn't occur in the Jupyter Notebook environment

@BryanRumsey BryanRumsey self-assigned this Apr 13, 2022
@BryanRumsey BryanRumsey added the bug Something isn't working label Apr 13, 2022
@BryanRumsey BryanRumsey added this to the 1.6.9 milestone Apr 13, 2022
@BryanRumsey BryanRumsey added the ✔️​ Issue / PR has been resolved label Apr 13, 2022
@BryanRumsey
Copy link
Contributor

BryanRumsey commented Apr 13, 2022

Thank you for you feedback, this issue will be resolved with the release of v1.6.9.

We have confirmed that this will run correctly in a Jupyter Notebook environment, see #775.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ✔️​ Issue / PR has been resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants