You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Paths from pathlib should be supported in file/model loading.
Currently, only strings and file handles are supported.
/home/mkoenig/envs/fbc_curation_py37/lib/python3.7/site-packages/cameo/visualization/plotting/__init__.py:52 UserWarning: Cannot import any plotting library. Please install one of 'plotly', 'bokeh' or 'ggplot' if you want to use any plotting function.
Traceback (most recent call last):
File "/home/mkoenig/git/fbc_curation/fbc_curation/cameo_solver.py", line 20, in <module>
model = load_model(model_path)
File "/home/mkoenig/envs/fbc_curation_py37/lib/python3.7/site-packages/cameo/io.py", line 66, in load_model
raise ValueError('Provided argument %s has to be either a string or a file handle' % path_or_handle)
ValueError: Provided argument /home/mkoenig/git/fbc_curation/fbc_curation/examples/models/e_coli_core.xml has to be either a string or a file handle
On loading model via path
from fbc_curation import EXAMPLE_PATH
model_path = EXAMPLE_PATH / "models" / "e_coli_core.xml"
# 01 objective value
from cameo import load_model
model = load_model(model_path)
The modern way of handling paths is using pathlib. It can be used as a replacement for file handles in the open statements, so pretty easy to support by just allowing pathlib Path in addition to file handles. https://docs.python.org/3/library/pathlib.html
Best Matthias
The text was updated successfully, but these errors were encountered:
Paths from pathlib should be supported in file/model loading.
Currently, only strings and file handles are supported.
On loading model via path
The modern way of handling paths is using pathlib. It can be used as a replacement for file handles in the
open
statements, so pretty easy to support by just allowing pathlib Path in addition to file handles.https://docs.python.org/3/library/pathlib.html
Best Matthias
The text was updated successfully, but these errors were encountered: