comparison COBRAxy/utils/general_utils.py @ 391:4e53b178031a draft

Uploaded
author luca_milaz
date Fri, 05 Sep 2025 10:50:12 +0000
parents 0a3ca20848f3
children f73d57641124
comparison
equal deleted inserted replaced
390:a2dee883176e 391:4e53b178031a
639 except Exception as e: raise DataErr(file_path, e.__str__()) 639 except Exception as e: raise DataErr(file_path, e.__str__())
640 raise DataErr(file_path, 640 raise DataErr(file_path,
641 f"Fomat \"{file_path.ext}\" is not recognized, only JSON, XML, MAT and YAML (.yml) files are supported.") 641 f"Fomat \"{file_path.ext}\" is not recognized, only JSON, XML, MAT and YAML (.yml) files are supported.")
642 642
643 643
644 def extract_model(file_path:FilePath, ext :FileFormat, model_encoding:Literal["json", "mat", "yml"]) -> cobra.Model: 644 def extract_model(self, file_path:FilePath, ext :FileFormat, model_encoding:Literal["json", "mat", "yml"]) -> cobra.Model:
645 """ 645 """
646 Extract JSON, MAT and YAML COBRA model from a compressed file (zip, gz, bz2). 646 Extract JSON, MAT and YAML COBRA model from a compressed file (zip, gz, bz2).
647 647
648 Args: 648 Args:
649 file_path: File path of the model 649 file_path: File path of the model