GeomScale / dingo

A python library for metabolic networks sampling and analysis
GNU Lesser General Public License v3.0
41 stars 27 forks source link

Error with biomass index handling after parsing json files #19

Closed vissarion closed 2 years ago

vissarion commented 2 years ago

The following piece of code

import unittest
import os
import scipy
import numpy as np
from dingo import MetabolicNetwork, PolytopeSampler
from dingo.gurobi_based_implementations import fast_inner_ball

current_directory = os.getcwd()
input_file_json = current_directory + "/ext_data/iAB_RBC_283.json"

model = MetabolicNetwork.from_json(input_file_json)
model.set_fast_mode()

sampler = PolytopeSampler(model)
sampler.set_fast_mode()

steady_states = sampler.generate_steady_states()

returns

  File "tests/parallel.py", line 20, in <module>
    model = MetabolicNetwork.from_json(input_file_json)
  File "/home/workspace/dingo/dingo/MetabolicNetwork.py", line 74, in from_json
    return cls(tuple_args)
  File "/home/workspace/dingo/dingo/MetabolicNetwork.py", line 56, in __init__
    or (self._biomass_index < 0)
TypeError: '<' not supported between instances of 'NoneType' and 'int'

iAB_RBC_283.json is downloaded from http://bigg.ucsd.edu/

Desktop:

OS: Ubuntu 20.04.2 LTS
python: Python 3.8.5 [GCC 9.3.0]