opencobra / memote

memote – the genome-scale metabolic model test suite
https://memote.readthedocs.io/
Apache License 2.0
123 stars 26 forks source link

Anaconda Python 3.8 has an error using MEMOTE. #741

Closed wupeng1998 closed 9 months ago

wupeng1998 commented 1 year ago

Due to the instability of the MEMOTE network server, the E-coli iml1515 was used in jupyter notebook for testing, but the following errors were found:

AttributeError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_17456\1354652291.py in 14 15 with open(f"{model.id}.html", "w") as handle: ---> 16 handle.write(memote.snapshot_report(result))

~\Program\Anaconda3\envs\Tib_Models\lib\site-packages\memote\suite\api.py in snapshot_report(result, config, html) 158 if config is None: 159 config = ReportConfiguration.load() --> 160 report = SnapshotReport(result=result, configuration=config) 161 if html: 162 return report.render_html()

~\Program\Anaconda3\envs\Tib_Models\lib\site-packages\memote\suite\reporting\snapshot.py in init(self, kwargs) 45 super(SnapshotReport, self).init(kwargs) 46 self._report_type = "snapshot" ---> 47 self.determine_miscellaneous_tests() 48 self.compute_score() 49 self.result.update(self.config)

~\Program\Anaconda3\envs\Tib_Models\lib\site-packages\memote\suite\reporting\report.py in determine_miscellaneous_tests(self) 109 self.config["cards"]["misc"]["title"] = "Misc. Tests" 110 self.config["cards"]["misc"]["cases"] = list( --> 111 set(self.result.cases) - set(tests_on_cards) 112 ) 113

AttributeError: 'tuple' object has no attribute 'cases'

Midnighter commented 1 year ago

Can you please show your installed package versions as asked for in the issue template?

from memote import show_versions

show_versions()
wupeng1998 commented 1 year ago

System Information

OS Windows OS-release 10 Python 3.7.13

Package Versions

Jinja2 3.0.3 black ; extra == 'development' not installed click 8.1.3 click-configfile 0.2.3 click-log 0.4.0 cobra 0.25.0 cookiecutter 2.1.1 depinfo 1.7.0 future 0.18.2 gitpython 3.1.28 goodtables 2.5.4 importlib-resources 5.2.0 isort ; extra == 'development' not installed memote 0.13.0 numpydoc 1.5.0 pandas 1.3.5 pip 22.1.2 pylru 1.2.1 pytest 7.1.3 requests 2.28.1 ruamel.yaml 0.17.21 setuptools 61.2.0 six 1.16.0 sqlalchemy 1.4.41 sympy 1.10.1 tox ; extra == 'development' not installed travis-encrypt 1.1.2 wheel 0.37.1

wupeng1998 commented 1 year ago

import memote from cobra.io import load_model

model = cobra.io.read_sbml_model('/jupyternotebook/models/iML1515.xml')

result = memote.test_model( model, results=True, pytest_args=["-vv", "--tb", "long"], solver_timeout=20, skip=("test_inconsistent_min_stoichiometry",), )

with open(f"{model.id}.html", "w") as handle: handle.write(memote.snapshot_report(result))

this is my code,can you solve it? the Internet sever can not work now

JamesPino commented 1 year ago

test_model returns a tuple of error code and results dict (https://memote.readthedocs.io/en/latest/autoapi/memote/index.html?highlight=test_model%20#memote.test_model) . You should try print out result to see what it is. Try error_code, result = memote.test_model( ...)

Midnighter commented 9 months ago

This issue needs information or other forms of answers from you. Please feel free to re-open the issue when you are able to provide them.