segrelab / cometspy

Python interface for running COMETS simulations and analyzing the results
GNU General Public License v3.0
11 stars 9 forks source link

Error when reading a model.cmd #9

Closed beacamara closed 3 years ago

beacamara commented 3 years ago

Hi! I would like to report an error when I run this code for reading a model. Could you help me ? I have included an screenshot of the code in my terminal. Thank you so much

Beatriz

Captura de pantalla de 2021-05-26 14-35-03

import cometspy as c
path_to_model = "./iJO1366.cmd" # this must actually exist
model = c.model()
model.read_comets_model(path_to_model)

Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/dist-packages/cometspy/model.py", line 597, in read_comets_model m_f_lines = [s for s in read_file(path).splitlines() if s] NameError: name '_modelread_file' is not defined

jeremymchacon commented 3 years ago

Thanks! We found the problem, there is a mangling of double-underscores which seems to be causing issues on some operating systems. Right now @djbajic is uploading a fix. If you don't want to wait, you can edit the model.py file directly and change the double-underscores in __read_file to single underscores.

djbajic commented 3 years ago

All set, thanks @beacamara for spotting the issue. It is fixed now, you can upgrade your cometspy using pip install cometspy --upgrade.

beacamara commented 3 years ago

Thank you so much.

beacamara commented 3 years ago

Hi again! I would like to report this error also in the script layout.py, lines 330 and 1429

File "/media/Backup/disk1/bcamara/portatil_acer/CNB_globachem/software/FLYCOP/FLYCOP-master/Scripts/ecoliLongTermFLYCOP.py", line 69, in initialize_layout layout=c.layout(file) File "/usr/local/lib/python3.8/dist-packages/cometspy/layout.py", line 132, in init self.read_comets_layout(input_obj) File "/usr/local/lib/python3.8/dist-packages/cometspy/layout.py", line 330, in read_comets_layout f_lines = [s for s in __read_file(input_obj).splitlines() if s] NameError: name '_layout__read_file' is not defined