RMG-Py icon indicating copy to clipboard operation
RMG-Py copied to clipboard

Assertion error -6 (Graphviz on macOS)

Open mbprend opened this issue 3 years ago • 4 comments

Bug Description

This issue was found to be with graphviz version 2.38.0 on macOS Big Sur (version 11.4), as outlined in an issue opened on PyDot. Using graphviz version 2.38.0 to generate Flux diagrams on macOS Big Sur (version 11.4) results in an assertion error -6.

In a fresh conda environment with graphviz version 2.47.3, I was able to successfully generate a flux diagram using the following command: dot -v -Tpng:gd:gd offending-dot-string.dot >output-gd-gd.png where offending-dot-string.dot is the DOT string saved to a .dot file (refer to the comment linked here for instructions on capturing the DOT string).

It appears that updating to graphviz version 2.47.3 in rmg_env will address this issue, which can be initialized using conda install graphviz=2.47.3

How To Reproduce

Inside the conda environment rmg_env with graphviz version 2.38.0 on macOS Big Sur (version 11.4), run the BASH script run.sh in ~/.../RMG/RMG-Py/examples/scripts/generateFluxDiagram.

Expected Behavior

Using the conda environment rmg_env with earlier versions of macOS, running the BASH script run.sh in ~/.../RMG/RMG-Py/examples/scripts/generateFluxDiagram does generate an .avi file that shows the flux with time for the example case.

Installation Information

  • OS: macOS Big Sur (version 11.4).
  • Installation method: RMG was cloned from GitHub and environment was build with Anaconda, which was installed as a package with a GUI interface
  • RMG version information:
    • RMG-Py: Master with regular pulls
    • RMG-database: Master with regular pulls

mbprend avatar Jul 15 '21 19:07 mbprend

After experiencing issues updating GraphViz previously, I reinitialized the update with a better connection using: conda install graphviz=2.47.3 inside rmg_env

Note that both a frozen and flexible solve did fail for me and Conda succeeded using the next repodata source. This takes time.

mbprend avatar Jul 15 '21 19:07 mbprend

I'm not clear from a cursory reading - is this something we can address by updating our environment.yml file?

rwest avatar Jul 15 '21 21:07 rwest

We can force this version in the environment file. I wonder why it does not fetch this version when creating a new environment by default though

amarkpayne avatar Jul 15 '21 22:07 amarkpayne

Just installed miniconda and rmg-py on a fresh MacOS. Based on the current environment.yml conda chose

# Name                    Version                   Build  Channel
graphviz                  2.38.0                        3    rmg

though there are much newer versions in conda-forge. Running make test failed with a couple of graphviz errors:

======================================================================
ERROR: test suite for <class 'rmgpy.rmg.mainTest.TestProfiling'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/miniconda3/envs/rmg_env/lib/python3.7/site-packages/nose/suite.py", line 228, in run
    self.tearDown()
  File "/opt/miniconda3/envs/rmg_env/lib/python3.7/site-packages/nose/suite.py", line 351, in tearDown
    self.teardownContext(ancestor)
  File "/opt/miniconda3/envs/rmg_env/lib/python3.7/site-packages/nose/suite.py", line 367, in teardownContext
    try_run(context, names)
  File "/opt/miniconda3/envs/rmg_env/lib/python3.7/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/Users/rwest/Code/RMG-Py/rmgpy/rmg/mainTest.py", line 350, in tearDownClass
    os.remove(os.path.join(cls.test_dir, 'RMG.profile.dot.pdf'))
FileNotFoundError: [Errno 2] No such file or directory: '/Users/rwest/Code/RMG-Py/rmgpy/rmg/test_data/mainTest/RMG.profile.dot.pdf'

======================================================================
FAIL: Test that `make_profile_graph` function behaves properly given the current display state
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/miniconda3/envs/rmg_env/lib/python3.7/unittest/mock.py", line 1256, in patched
    return func(*args, **keywargs)
  File "/Users/rwest/Code/RMG-Py/rmgpy/rmg/mainTest.py", line 332, in test_make_profile_graph
    self.assertTrue(os.path.exists(os.path.join(self.test_dir, 'RMG.profile.dot.pdf')))
AssertionError: False is not true

rwest avatar Sep 15 '21 13:09 rwest

This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.

github-actions[bot] avatar Jun 21 '23 22:06 github-actions[bot]