HelikarLab / DeepGEMM

GNU General Public License v3.0
1 stars 1 forks source link

dict_from_list() missing 'values' #1

Open JoshLoecker opened 1 year ago

JoshLoecker commented 1 year ago

Description

Hey Achilles, I'm trying to run the sample notebook listed here, but I'm getting an error that 'values' are missing from the dict_from_list function

Screenshot

This is the code I'm running (copied from the docs/source/notebooks folder)

import cobra

from cobra.io.web import load_model
from dgemm.model import minimize_model
from tqdm.auto import tqdm

from bpyutils.log import get_logger

logger = get_logger("deepgem")

cobra_config = cobra.Configuration()
# cobra_config.solver = "cplex"
bigg_ids = ["e_coli_core"]  # "iML1515", "iJN1463", "iAM_Pv461", "iMM1415"]
for bigg_id in tqdm(bigg_ids, total=len(bigg_ids), desc="Generating minimized models..."):
    model = load_model(bigg_id)

    logger.info("Minimizing %s..." % bigg_id)

    min_rxns, minimized = minimize_model(model)

    print("Solution (org):", model.optimize())
    print("Solution (min):", minimized.optimize())

Console errors

Generating minimized models...:   0%|          | 0/1 [00:00<?, ?it/s]deepgem | 2022-11-14 12:22:36,224 | INFO | Minimizing e_coli_core...
Generating minimized models...:   0%|          | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/Users/joshl/PycharmProjects/DeepGEMM/main.py", line 19, in <module>
    min_rxns, minimized = minimize_model(model)
  File "/Users/joshl/PycharmProjects/DeepGEMM/venv/lib/python3.10/site-packages/dgemm/model/minimize.py", line 419, in minimize_model
    return algorithm["fn"](model, **kwargs)
  File "/Users/joshl/PycharmProjects/DeepGEMM/venv/lib/python3.10/site-packages/dgemm/model/minimize.py", line 253, in minreact
    maintain_map = dict_from_list(maintain)
TypeError: dict_from_list() missing 1 required positional argument: 'values'
achillesrasquinha commented 1 year ago

Hi @JoshLoecker, fixed the latest one on the develop branch.

achillesrasquinha commented 1 year ago

Let me know if it still persists.