# HG changeset patch # User francesco_lapi # Date 1761649480 0 # Node ID 5aef7b86070618e23247fdd38dd2a27444c8d837 # Parent 73f2f7e2be17fbee239c8a7b027f18b81efd3579 Uploaded diff -r 73f2f7e2be17 -r 5aef7b860706 COBRAxy/src/flux_simulation.py --- a/COBRAxy/src/flux_simulation.py Tue Oct 28 10:44:07 2025 +0000 +++ b/COBRAxy/src/flux_simulation.py Tue Oct 28 11:04:40 2025 +0000 @@ -378,11 +378,11 @@ model_input.reactions.get_by_id(rxn_index).upper_bound = row.upper_bound except KeyError: warning(f"Warning: Reaction {rxn_index} not found in model. Skipping.") - - return perform_sampling_and_analysis(model_input, cell_name) + + return perform_sampling_and_analysis(None, cell_name, model_input=model_input) -def perform_sampling_and_analysis(model_path: str, cell_name: str) -> List[pd.DataFrame]: +def perform_sampling_and_analysis(model_path: str, cell_name: str, model_input: cobra.Model=None) -> List[pd.DataFrame]: """ Common function to perform sampling and analysis on a prepared model. @@ -395,8 +395,9 @@ """ returnList = [] - - model_input = model_utils.build_cobra_model_from_csv(model_path) + + if model_input is None: + model_input = model_utils.build_cobra_model_from_csv(model_path) if ARGS.sampling_enabled == "true":