def create_test_model(model_name="salmonella"): """Returns a cobra model for testing model_name: str One of 'ecoli', 'textbook', or 'salmonella', or the path to a pickled cobra.Model """ if model_name == "ecoli": return read_sbml_model(ecoli_sbml) elif model_name == "textbook": return read_sbml_model(textbook_sbml) elif model_name == "mini": return read_sbml_model(mini_sbml) if model_name == "salmonella": model_name = salmonella_pickle with open(model_name, "rb") as infile: return _load(infile)
def create_test_model(model_name="salmonella"): """Returns a cobra model for testing model_name: str One of 'ecoli', 'textbook', or 'salmonella', or the path to a pickled cobra.Model """ if model_name == "ecoli": ecoli_sbml = join(data_dir, "iJO1366.xml") return read_sbml_model(ecoli_sbml) elif model_name == "textbook": textbook_sbml = join(data_dir, "textbook.xml.gz") return read_sbml_model(textbook_sbml) elif model_name == "mini": mini_sbml = join(data_dir, "mini_fbc2.xml") return read_sbml_model(mini_sbml) elif model_name == "salmonella": salmonella_pickle = join(data_dir, "salmonella.pickle") model_name = salmonella_pickle with open(model_name, "rb") as infile: return _load(infile)
def load(f, **kwargs): return _load(f)
def solved_model(data_directory): model = create_test_model("textbook") with open(join(data_directory, "textbook_solution.pickle"), "rb") as infile: solution = _load(infile) return solution, model
def solved_model(data_directory): model = create_test_model("textbook") with open(join(data_directory, "textbook_solution.pickle"), "rb") as infile: model.solution = _load(infile) return model
def load(f, **kwargs): return _load(f) def loads(s, **kwargs): return _loads(s)