aiagents4pharma 1.22.1__py3-none-any.whl → 1.22.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,19 +58,24 @@ class BasicoModel(SysBioModel):
58
58
  # check if the param_name is not None
59
59
  if param_name is None:
60
60
  continue
61
- # if param is a kinetic parameter
61
+ # Extract all parameters and species from the model
62
62
  df_all_params = basico.model_info.get_parameters(model=self.copasi_model)
63
+ df_all_species = basico.model_info.get_species(model=self.copasi_model)
64
+ # if param is a kinetic parameter
63
65
  if param_name in df_all_params.index.tolist():
64
66
  basico.model_info.set_parameters(name=param_name,
65
67
  exact=True,
66
68
  initial_value=param_value,
67
69
  model=self.copasi_model)
68
70
  # if param is a species
69
- else:
71
+ elif param_name in df_all_species.index.tolist():
70
72
  basico.model_info.set_species(name=param_name,
71
73
  exact=True,
72
74
  initial_concentration=param_value,
73
75
  model=self.copasi_model)
76
+ else:
77
+ logger.error("Parameter/Species %s not found in the model.", param_name)
78
+ raise ValueError(f"Parameter/Species {param_name} not found in the model.")
74
79
 
75
80
  def simulate(self, duration: Union[int, float] = 10, interval: int = 10) -> pd.DataFrame:
76
81
  """
@@ -26,8 +26,15 @@ def test_with_biomodel_id(model):
26
26
  assert df_parameters.loc['KmPFKF6P', 'initial_value'] == 1.5
27
27
  # check if the simulation results are a pandas DataFrame object
28
28
  assert isinstance(model.simulate(duration=2, interval=2), pd.DataFrame)
29
+ # Pass a None value to the update_parameters method
30
+ # and it should not raise an error
29
31
  model.update_parameters(parameters={None: None})
32
+ # check if the model description is updated
30
33
  assert model.description == basico.biomodels.get_model_info(model.biomodel_id)["description"]
34
+ # check if an error is raised if an invalid species/parameter (`Pyruv`)
35
+ # is passed and it should raise a ValueError
36
+ with pytest.raises(ValueError):
37
+ model.update_parameters(parameters={'Pyruv': 0.5})
31
38
 
32
39
  def test_with_sbml_file():
33
40
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: aiagents4pharma
3
- Version: 1.22.1
3
+ Version: 1.22.2
4
4
  Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D.
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -19,14 +19,14 @@ aiagents4pharma/talk2biomodels/configs/tools/custom_plotter/default.yaml,sha256=
19
19
  aiagents4pharma/talk2biomodels/configs/tools/get_annotation/__init__.py,sha256=-fAORvyFmG2iSvFOFDixmt9OTQRR58y89uhhu2EgbA8,46
20
20
  aiagents4pharma/talk2biomodels/configs/tools/get_annotation/default.yaml,sha256=o5kqLJ5QGJsLMUhAqotudIMhxxNfPUVcDVH1tdRIutU,304
21
21
  aiagents4pharma/talk2biomodels/models/__init__.py,sha256=5fTHHm3PVloYPNKXbgNlcPgv3-u28ZquxGydFYDfhJA,122
22
- aiagents4pharma/talk2biomodels/models/basico_model.py,sha256=0vHS-wPZ3kHTMf1KLrcMTgqz67tgK9sswffSQjAs6vw,4851
22
+ aiagents4pharma/talk2biomodels/models/basico_model.py,sha256=4LjeHKGcXsdm1gFxs9SGVNDerajZ7REvCeNch0s2pDg,5242
23
23
  aiagents4pharma/talk2biomodels/models/sys_bio_model.py,sha256=JeoiGQAvQABHnG0wKR2XBmmxqQdtgO6kxaLDUTUmr1s,2001
24
24
  aiagents4pharma/talk2biomodels/states/__init__.py,sha256=YLg1-N0D9qyRRLRqwqfLCLAqZYDtMVZTfI8Y0b_4tbA,139
25
25
  aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py,sha256=S1UtXvocWR8Y9OVUp6pIDFnmaCcjbwmUbW8u79TuGcg,1508
26
26
  aiagents4pharma/talk2biomodels/tests/__init__.py,sha256=Jbw5tJxSrjGoaK5IX3pJWDCNzhrVQ10lkYq2oQ_KQD8,45
27
27
  aiagents4pharma/talk2biomodels/tests/test_api.py,sha256=7Kz2r5F5tjmn3F0LoM33oP-21W633936YHiyf5toGg0,1716
28
28
  aiagents4pharma/talk2biomodels/tests/test_ask_question.py,sha256=rdForKfj2zj2IXl6ntK9_I0AbgsCv8MXOZ2khBnaPms,1620
29
- aiagents4pharma/talk2biomodels/tests/test_basico_model.py,sha256=y82fpTJMPHwtXxlle1cGQ_2Bewwpxi0aJSVrVAYLhN0,2060
29
+ aiagents4pharma/talk2biomodels/tests/test_basico_model.py,sha256=-2g7HGHXsJeaE06FUI380Br3uh1Wb-JV51mgqcb3GJw,2423
30
30
  aiagents4pharma/talk2biomodels/tests/test_get_annotation.py,sha256=GbobfjtCAOV0HddM4pb2o3c49Q05fKIM0Ubnf8BRxHM,8273
31
31
  aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py,sha256=CIKeIm5FGTCyW-FR2nIo3Tr5AyAdxBelNngkdUd5-kk,3206
32
32
  aiagents4pharma/talk2biomodels/tests/test_integration.py,sha256=9nYRqpJ_OtmUypuHm4URzoHhcpKEldCEwKxLzh8jcZU,5193
@@ -162,8 +162,8 @@ aiagents4pharma/talk2scholars/tools/s2/query_results.py,sha256=EUfzRh5Qc_tMl5fDI
162
162
  aiagents4pharma/talk2scholars/tools/s2/retrieve_semantic_scholar_paper_id.py,sha256=Lg1L4HQCN2LaQEyWtLD73O67PMoXkPHi-Y8rCzHS0A4,2499
163
163
  aiagents4pharma/talk2scholars/tools/s2/search.py,sha256=mnBQWDuQ50UVw6B-bRuL8Ek1av-pEtdgzVMxpEA2BpI,4296
164
164
  aiagents4pharma/talk2scholars/tools/s2/single_paper_rec.py,sha256=xgnUj9W9JkeTvB2VJBJUAnia789GGNGqdqgJ_G16v2s,5120
165
- aiagents4pharma-1.22.1.dist-info/LICENSE,sha256=IcIbyB1Hyk5ZDah03VNQvJkbNk2hkBCDqQ8qtnCvB4Q,1077
166
- aiagents4pharma-1.22.1.dist-info/METADATA,sha256=5mWYXohM-eUXLQ8w_3ZpIEWE4jmr3YBKEJWj9bzbgxg,7789
167
- aiagents4pharma-1.22.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
168
- aiagents4pharma-1.22.1.dist-info/top_level.txt,sha256=-AH8rMmrSnJtq7HaAObS78UU-cTCwvX660dSxeM7a0A,16
169
- aiagents4pharma-1.22.1.dist-info/RECORD,,
165
+ aiagents4pharma-1.22.2.dist-info/LICENSE,sha256=IcIbyB1Hyk5ZDah03VNQvJkbNk2hkBCDqQ8qtnCvB4Q,1077
166
+ aiagents4pharma-1.22.2.dist-info/METADATA,sha256=OMtzAMhrSQiB7SpK7-waB0SLh8Je5i5HSHE5J9lY7xQ,7789
167
+ aiagents4pharma-1.22.2.dist-info/WHEEL,sha256=nn6H5-ilmfVryoAQl3ZQ2l8SH5imPWFpm1A5FgEuFV4,91
168
+ aiagents4pharma-1.22.2.dist-info/top_level.txt,sha256=-AH8rMmrSnJtq7HaAObS78UU-cTCwvX660dSxeM7a0A,16
169
+ aiagents4pharma-1.22.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5