mxlpy 0.23.0__py3-none-any.whl → 0.24.0__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.
mxlpy/types.py CHANGED
@@ -33,6 +33,7 @@ from typing import (
33
33
  import numpy as np
34
34
  import pandas as pd
35
35
  from numpy.typing import NDArray
36
+ from wadler_lindig import pformat
36
37
 
37
38
  __all__ = [
38
39
  "AbstractEstimator",
@@ -182,6 +183,10 @@ class Variable:
182
183
  unit: sympy.Expr | None = None
183
184
  source: str | None = None
184
185
 
186
+ def __repr__(self) -> str:
187
+ """Return default representation."""
188
+ return pformat(self)
189
+
185
190
 
186
191
  @dataclass
187
192
  class Parameter:
@@ -191,6 +196,10 @@ class Parameter:
191
196
  unit: sympy.Expr | None = None
192
197
  source: str | None = None
193
198
 
199
+ def __repr__(self) -> str:
200
+ """Return default representation."""
201
+ return pformat(self)
202
+
194
203
 
195
204
  @dataclass(kw_only=True, slots=True)
196
205
  class Derived:
@@ -200,6 +209,10 @@ class Derived:
200
209
  args: list[str]
201
210
  unit: sympy.Expr | None = None
202
211
 
212
+ def __repr__(self) -> str:
213
+ """Return default representation."""
214
+ return pformat(self)
215
+
203
216
  def calculate(self, args: dict[str, Any]) -> float:
204
217
  """Calculate the derived value.
205
218
 
@@ -231,6 +244,10 @@ class InitialAssignment:
231
244
  args: list[str]
232
245
  unit: sympy.Expr | None = None
233
246
 
247
+ def __repr__(self) -> str:
248
+ """Return default representation."""
249
+ return pformat(self)
250
+
234
251
  def calculate(self, args: dict[str, Any]) -> float:
235
252
  """Calculate the derived value.
236
253
 
@@ -262,6 +279,10 @@ class Readout:
262
279
  args: list[str]
263
280
  unit: sympy.Expr | None = None
264
281
 
282
+ def __repr__(self) -> str:
283
+ """Return default representation."""
284
+ return pformat(self)
285
+
265
286
  def calculate(self, args: dict[str, Any]) -> float:
266
287
  """Calculate the derived value.
267
288
 
@@ -294,6 +315,10 @@ class Reaction:
294
315
  args: list[str]
295
316
  unit: sympy.Expr | None = None
296
317
 
318
+ def __repr__(self) -> str:
319
+ """Return default representation."""
320
+ return pformat(self)
321
+
297
322
  def get_modifiers(self, model: Model) -> list[str]:
298
323
  """Get the modifiers of the reaction."""
299
324
  include = set(model.get_variable_names())
@@ -341,6 +366,10 @@ class AbstractSurrogate:
341
366
  outputs: list[str]
342
367
  stoichiometries: dict[str, dict[str, float | Derived]] = field(default_factory=dict)
343
368
 
369
+ def __repr__(self) -> str:
370
+ """Return default representation."""
371
+ return pformat(self)
372
+
344
373
  @abstractmethod
345
374
  def predict(
346
375
  self, args: dict[str, float | pd.Series | pd.DataFrame]
@@ -382,6 +411,10 @@ class AbstractEstimator:
382
411
 
383
412
  parameter_names: list[str]
384
413
 
414
+ def __repr__(self) -> str:
415
+ """Return default representation."""
416
+ return pformat(self)
417
+
385
418
  @abstractmethod
386
419
  def predict(self, features: pd.Series | pd.DataFrame) -> pd.DataFrame:
387
420
  """Predict the target values for the given features."""
@@ -430,6 +463,10 @@ class Result:
430
463
  raw_parameters: list[dict[str, float]]
431
464
  raw_args: list[pd.DataFrame] = field(default_factory=list)
432
465
 
466
+ def __repr__(self) -> str:
467
+ """Return default representation."""
468
+ return pformat(self)
469
+
433
470
  @classmethod
434
471
  def default(cls, model: Model, time_points: Array) -> Result:
435
472
  """Get result filled with NaNs."""
@@ -453,6 +490,7 @@ class Result:
453
490
  """Simulation variables."""
454
491
  return self.get_variables(
455
492
  include_derived_variables=True,
493
+ include_surrogate_variables=True,
456
494
  include_readouts=True,
457
495
  concatenated=True,
458
496
  normalise=None,
@@ -461,7 +499,9 @@ class Result:
461
499
  @property
462
500
  def fluxes(self) -> pd.DataFrame:
463
501
  """Simulation fluxes."""
464
- return self.get_fluxes()
502
+ return self.get_fluxes(
503
+ include_surrogates=True,
504
+ )
465
505
 
466
506
  def _compute_args(self) -> list[pd.DataFrame]:
467
507
  # Already computed
@@ -618,6 +658,7 @@ class Result:
618
658
  *,
619
659
  include_derived_variables: bool = True,
620
660
  include_readouts: bool = True,
661
+ include_surrogate_variables: bool = True,
621
662
  concatenated: Literal[False],
622
663
  normalise: float | ArrayLike | None = None,
623
664
  ) -> list[pd.DataFrame]: ...
@@ -628,6 +669,7 @@ class Result:
628
669
  *,
629
670
  include_derived_variables: bool = True,
630
671
  include_readouts: bool = True,
672
+ include_surrogate_variables: bool = True,
631
673
  concatenated: Literal[True],
632
674
  normalise: float | ArrayLike | None = None,
633
675
  ) -> pd.DataFrame: ...
@@ -638,6 +680,7 @@ class Result:
638
680
  *,
639
681
  include_derived_variables: bool = True,
640
682
  include_readouts: bool = True,
683
+ include_surrogate_variables: bool = True,
641
684
  concatenated: bool = True,
642
685
  normalise: float | ArrayLike | None = None,
643
686
  ) -> pd.DataFrame: ...
@@ -647,6 +690,7 @@ class Result:
647
690
  *,
648
691
  include_derived_variables: bool = True,
649
692
  include_readouts: bool = True,
693
+ include_surrogate_variables: bool = True,
650
694
  concatenated: bool = True,
651
695
  normalise: float | ArrayLike | None = None,
652
696
  ) -> pd.DataFrame | list[pd.DataFrame]:
@@ -660,7 +704,9 @@ class Result:
660
704
  0.000200 0.999800 0.999800
661
705
 
662
706
  """
663
- if not include_derived_variables and not include_readouts:
707
+ if not (
708
+ include_derived_variables or include_readouts or include_surrogate_variables
709
+ ):
664
710
  return self._adjust_data(
665
711
  self.raw_variables,
666
712
  normalise=normalise,
@@ -671,6 +717,7 @@ class Result:
671
717
  self._compute_args(),
672
718
  include_variables=True,
673
719
  include_derived_variables=include_derived_variables,
720
+ include_surrogate_variables=include_surrogate_variables,
674
721
  include_readouts=include_readouts,
675
722
  )
676
723
  return self._adjust_data(
@@ -778,6 +825,10 @@ class ResponseCoefficients:
778
825
  variables: pd.DataFrame
779
826
  fluxes: pd.DataFrame
780
827
 
828
+ def __repr__(self) -> str:
829
+ """Return default representation."""
830
+ return pformat(self)
831
+
781
832
  @property
782
833
  def combined(self) -> pd.DataFrame:
783
834
  """Return the response coefficients as a DataFrame."""
@@ -796,6 +847,10 @@ class ResponseCoefficientsByPars:
796
847
  fluxes: pd.DataFrame
797
848
  parameters: pd.DataFrame
798
849
 
850
+ def __repr__(self) -> str:
851
+ """Return default representation."""
852
+ return pformat(self)
853
+
799
854
  @property
800
855
  def combined(self) -> pd.DataFrame:
801
856
  """Return the response coefficients as a DataFrame."""
@@ -814,6 +869,10 @@ class SteadyStateScan:
814
869
  raw_index: pd.Index | pd.MultiIndex
815
870
  raw_results: list[Result]
816
871
 
872
+ def __repr__(self) -> str:
873
+ """Return default representation."""
874
+ return pformat(self)
875
+
817
876
  @property
818
877
  def variables(self) -> pd.DataFrame:
819
878
  """Return steady-state variables by scan."""
@@ -874,6 +933,10 @@ class SteadyStateScan:
874
933
  class TimeCourseScan:
875
934
  """Container for time courses by scanned values."""
876
935
 
936
+ def __repr__(self) -> str:
937
+ """Return default representation."""
938
+ return pformat(self)
939
+
877
940
  to_scan: pd.DataFrame
878
941
  raw_results: dict[Hashable, Result]
879
942
 
@@ -953,6 +1016,10 @@ class ProtocolScan:
953
1016
  protocol: pd.DataFrame
954
1017
  raw_results: dict[Hashable, Result]
955
1018
 
1019
+ def __repr__(self) -> str:
1020
+ """Return default representation."""
1021
+ return pformat(self)
1022
+
956
1023
  @property
957
1024
  def variables(self) -> pd.DataFrame:
958
1025
  """Return all args of the time courses."""
@@ -1032,6 +1099,10 @@ class McSteadyStates:
1032
1099
  parameters: pd.DataFrame
1033
1100
  mc_to_scan: pd.DataFrame
1034
1101
 
1102
+ def __repr__(self) -> str:
1103
+ """Return default representation."""
1104
+ return pformat(self)
1105
+
1035
1106
  @property
1036
1107
  def combined(self) -> pd.DataFrame:
1037
1108
  """Return the steady states as a DataFrame."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mxlpy
3
- Version: 0.23.0
3
+ Version: 0.24.0
4
4
  Summary: A package to build metabolic models
5
5
  Author-email: Marvin van Aalst <marvin.vanaalst@gmail.com>
6
6
  Maintainer-email: Marvin van Aalst <marvin.vanaalst@gmail.com>
@@ -33,7 +33,7 @@ Requires-Dist: numpy>=2.1.2
33
33
  Requires-Dist: pandas>=2.2.3
34
34
  Requires-Dist: parameteriser>=0.1.0
35
35
  Requires-Dist: pebble>=5.0.7
36
- Requires-Dist: pysbml>=0.2.0
36
+ Requires-Dist: pysbml>=0.3.0
37
37
  Requires-Dist: python-libsbml>=5.20.4
38
38
  Requires-Dist: salib>=1.5.1
39
39
  Requires-Dist: scipy>=1.14.1
@@ -121,3 +121,6 @@ You have two choices here, using `uv` (pypi-only) or using `pixi` (conda-forge,
121
121
  - Run `pixi install --frozen`
122
122
 
123
123
 
124
+ ## LLMs
125
+
126
+ We support the [llms.txt](https://llmstxt.org/) convention for making documentation available to large language models and the applications that make use of them. It is located at [docs/llms.txt](https://github.com/Computational-Biology-Aachen/MxlPy/tree/main/docs/llms.txt)
@@ -1,37 +1,37 @@
1
- mxlpy/__init__.py,sha256=XQc1WNOxUzRbM8s7hO4p6r7dFsru0BCcedJITawqIo0,4574
2
- mxlpy/carousel.py,sha256=nYWEdxDd7lm5INfZjpwaEhYqysg9e4EH9Ubcl6bPca8,4721
3
- mxlpy/compare.py,sha256=o-tUxHJrzzVsQkiKPCFD_4bpqsWrvBMyOPoBQ1Dl420,7746
1
+ mxlpy/__init__.py,sha256=MzR_lZLel95RyWISsF16mDLscGoaw79oD976MFo5_TI,4453
2
+ mxlpy/carousel.py,sha256=3M2rqi2bx87y8D-oqEKTKZ6Q_clDQHbdLNdVjLJeO7c,6013
3
+ mxlpy/compare.py,sha256=rJPOXc-aX6I1EC3ERAAW5Jn04kMwrlqUqdBgbZa6LA4,8098
4
4
  mxlpy/distributions.py,sha256=ce6RTqn19YzMMec-u09fSIUA8A92M6rehCuHuXWcX7A,8734
5
- mxlpy/fit.py,sha256=3hGUqJ2tOOToZLMMaJw5M9b6_UlUJwT_MhUvfPmRBd8,22355
5
+ mxlpy/fit.py,sha256=UTNvbUcL9mg7NuH5qq3syqpXXqynT_lXmKQudxwWcsE,22880
6
6
  mxlpy/fns.py,sha256=NLxYwa3ylS7SkISBjw_TgQSKEm7WnkZF9wPigX_ZCAM,13915
7
7
  mxlpy/identify.py,sha256=G-Zyr_l-K2mDtIV1xGrQ52QJxoBYqRoNA5RW6GpbNjs,2213
8
8
  mxlpy/label_map.py,sha256=PwYanfg07hC0ayyOOP72RFlCQNvhCTbpOhW6kZZ2GUU,17826
9
9
  mxlpy/linear_label_map.py,sha256=6Ye6IziWGKkYD_5z3FmTVwnJ2T9SvVGN3U4CfXjXseo,10320
10
- mxlpy/mc.py,sha256=6n6VAuSVcXinqcWxNJAioMYpBmSAB40WItPloK1vmBM,17017
10
+ mxlpy/mc.py,sha256=uMHknTNHmK5b4REM3PtCpCjEr9LoSIBsGsCNU4_yHpg,18639
11
11
  mxlpy/mca.py,sha256=IoOHJbjPnAEDqKk64OjFjgRPX5K_aE9D4RrCJ1xFIkw,9457
12
- mxlpy/model.py,sha256=tAz_Rbe_S1Ho-k_14gBxmE9RMYo2xJUWYkdLYUyMKHg,79072
12
+ mxlpy/model.py,sha256=kjZTQo8yM62JX2GedwTCfxtTQpdprg8vJzgJvp_5XCI,79643
13
13
  mxlpy/parallel.py,sha256=yLQLw5O4vnPVp_Zmtw1UhPWtB3483foimxQB-TwFKPg,5016
14
14
  mxlpy/parameterise.py,sha256=IgbvfEnkmaqVq_5GgFjHqApGUN9CJrsVD3Fr7pg9iFA,758
15
15
  mxlpy/paths.py,sha256=TK2wO4N9lG-UV1JGfeB64q48JVDbwqIUj63rl55MKuQ,1022
16
- mxlpy/plot.py,sha256=oZq8NqycdiJwqEm7FVpNTBkjGYgPBEbqDqZxbrvUtDI,32662
16
+ mxlpy/plot.py,sha256=Dng9tyga8xagINQO_OZvjLRoaYGFR8crMljDHrzwEF8,33603
17
17
  mxlpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  mxlpy/report.py,sha256=v597yzKecgtoNmlNZ_nVhBCa3czNw0tksOK5mLtAQvE,10631
19
- mxlpy/scan.py,sha256=DI5R_xKEUV28FTXqxYz41lQFkAXHE41R_S-ztHPeCoM,13676
20
- mxlpy/simulator.py,sha256=NaD0UxvEqiRUp8dZqW4su1Xc9QzHwa9XqGGAIgGV6D0,16559
21
- mxlpy/types.py,sha256=FpNZT5ZkhFHYSVA1LS7eZ3ljpzK0_fHo5h48nregR6w,31440
19
+ mxlpy/scan.py,sha256=KXFdeWwgUBqJBCiOGDdMAGU5nS3PRVn7Cg0ISpzzK1U,17160
20
+ mxlpy/simulator.py,sha256=-jsSP1fEnJnHj1hcj37cAPUyyP57mP_ow2cL-xd9iw8,16699
21
+ mxlpy/types.py,sha256=Vg3ekCkhbH8HjqdDTA7vaAdFp9Diney3ARZZfbq0MoA,33475
22
22
  mxlpy/units.py,sha256=4bKXkCYsONUVWRdzV7aVcWFQSA6sxilebgXXFUEKw_c,2091
23
23
  mxlpy/experimental/__init__.py,sha256=kZTE-92OErpHzNRqmgSQYH4CGXrogGJ5EL35XGZQ81M,206
24
- mxlpy/experimental/diff.py,sha256=g5hKvFsEUdEk5OGQ_aQuCxLAnenD_jG4G__EcVfKsx4,9104
24
+ mxlpy/experimental/diff.py,sha256=fmsM53lH86TD2iglQILK-XeZnIAtwHAcGC3Afs8V-tc,9457
25
25
  mxlpy/integrators/__init__.py,sha256=TKo2dkJqdW3_n7YrmF6k3kEjr8_kr3-7MDaLu-zFWRg,533
26
26
  mxlpy/integrators/int_assimulo.py,sha256=1cvR8cOBdrl_DQs9v0o7wItSG5iyYqwZVh7EO0fg3ro,5021
27
27
  mxlpy/integrators/int_diffrax.py,sha256=q_8NZgIZ6T-SRRcI8kSjEb6l-DbXqPv6rjj9KApkQac,3326
28
28
  mxlpy/integrators/int_scipy.py,sha256=xKyisVN1jW5hxmVD2K_RpoQ2MwNrMxSGODsAEgEt6_I,4922
29
- mxlpy/meta/__init__.py,sha256=_Bec5aPJ6YyAkxUXlsQtAy_2VzX0tPGVSj-eGACqrXc,404
30
- mxlpy/meta/codegen_latex.py,sha256=i4tPvk2-toAYqtf4TynuE9sfUSHUp21AMUgjgFEB0uo,23215
31
- mxlpy/meta/codegen_model.py,sha256=mRpK7pTPYTIMmJAqno7TA6vg5poSQThGWP43_zHU7as,5124
32
- mxlpy/meta/codegen_mxlpy.py,sha256=asXGAY0fr5sUSRw7LlBUoFgTkXcJt9M6LZtVqsiF4RU,7869
33
- mxlpy/meta/source_tools.py,sha256=dqP2dP8OLloBY8pLPuQl2uVB6GfDDn52u8vhPOTei1M,22302
34
- mxlpy/meta/sympy_tools.py,sha256=XaRXdyXiiiOHBXatxoRTRKwy7BaM9I0lL6PE5HP33wE,3016
29
+ mxlpy/meta/__init__.py,sha256=8-UPZan2pT6RSuN65KC4vV9WPJiAzm2ZsXz3Zu_rmww,475
30
+ mxlpy/meta/codegen_latex.py,sha256=Owj5GKDFkiqks2mIDQIXV3M_5TysGwAZgKSq8C3KBIg,23461
31
+ mxlpy/meta/codegen_model.py,sha256=FkVrAS7HOyTQPNTItgyo8jjDEylkbETGnxJgRTBDAP4,6722
32
+ mxlpy/meta/codegen_mxlpy.py,sha256=FjBw37IqziB4dv5VBAvKenFODfxjJXdW6rQqx9CqYUk,8433
33
+ mxlpy/meta/source_tools.py,sha256=e6ufIsBjgde3QuQ9OsAYES0Lib4WALw4E-0wH_2cF6Y,22442
34
+ mxlpy/meta/sympy_tools.py,sha256=mWVn63OMeiTmVlV586pXxDa3l-_Pc1VcP1G39vYRGS4,3203
35
35
  mxlpy/nn/__init__.py,sha256=Qjr-ERsY2lbD75sFBOhCUwEasQDSJKcpBn_kReLZ6oA,633
36
36
  mxlpy/nn/_keras.py,sha256=-5zjHRu8OjSiZeuBSIZFyB63uBsNNH5o9y4kBcPnhx8,2263
37
37
  mxlpy/nn/_torch.py,sha256=GUJmLU282VU4O-fs3Sz90SEaAnfuXN2MPlBr_tHmvn4,5775
@@ -39,8 +39,8 @@ mxlpy/npe/__init__.py,sha256=hBHCUD2JYDBBGS2kTY8mTCfWB3u1R7m5l--wUupZt6o,1270
39
39
  mxlpy/npe/_keras.py,sha256=ytvXMPK9KUCGOzTQm08_SgafiMb-MOIUdZQV7JjAO40,9721
40
40
  mxlpy/npe/_torch.py,sha256=v3joh6lFJJxvYJj--wzmKXL9UMTaIN3h6hPNq0uX9NU,11250
41
41
  mxlpy/sbml/__init__.py,sha256=Mt97CddpLi3wIrA1b_5cagLmDdNxAVF_S7QV57Pzw8s,226
42
- mxlpy/sbml/_data.py,sha256=yYli7ZQ1_pnH9kt5EmcuHM0moQoa43rrFVdrseXlG0o,1136
43
- mxlpy/sbml/_export.py,sha256=0R34btB5COKD1gsWisdlWdEbJ-BUrjb78s6sWnm5Ph4,20945
42
+ mxlpy/sbml/_data.py,sha256=98w5vyhdOHilD5zjy21XFzam0FlvcW_cb1XRTsIgD_M,2019
43
+ mxlpy/sbml/_export.py,sha256=leKf7dFqpoYxO3xFu4j_mM5eAgo-lq__ywADXsmamRU,21008
44
44
  mxlpy/sbml/_import.py,sha256=_4MR54YyVkIh9eVAiSMd7yijhHC_ds-3v7M_C4Zn8BY,3565
45
45
  mxlpy/sbml/_name_conversion.py,sha256=93muW47M7qJoE227HKHmThWpPeWsXDN9eM8cRH2pqPs,1340
46
46
  mxlpy/surrogates/__init__.py,sha256=cz9qr0ToYSutIK45IvKrMe1mPP7Lj0I_V0HYGixfpZU,916
@@ -51,7 +51,7 @@ mxlpy/surrogates/_torch.py,sha256=gU0secuRBYgewhNqZmSo6_Xf804dSzwWwIYmdKA7y60,63
51
51
  mxlpy/symbolic/__init__.py,sha256=_vM5YM5I6OH0QDbFt9uGYKO8Z5Vly0wbGuvUScVrPRU,258
52
52
  mxlpy/symbolic/strikepy.py,sha256=tzo3uvPpXLDex09hWTuitVzuTNwbgl7jWGjD8g6a8iI,20033
53
53
  mxlpy/symbolic/symbolic_model.py,sha256=cKfWoktvFmXjuo8egE7gXKrKBq2iBUiy_BcIKIvvz8A,3026
54
- mxlpy-0.23.0.dist-info/METADATA,sha256=80ODNl3NCffUmuu_mJmvUmld7uNm390vMtlhNx2Soes,4696
55
- mxlpy-0.23.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
56
- mxlpy-0.23.0.dist-info/licenses/LICENSE,sha256=lHX9Eu70g3Iv1aOxXTWNHa3vq9vaVYSPQx4jOLYmDpw,1096
57
- mxlpy-0.23.0.dist-info/RECORD,,
54
+ mxlpy-0.24.0.dist-info/METADATA,sha256=Hqld-ntG-lfZey_b-aHgJo-T8KYylrC-iSf9CxMs-XA,4980
55
+ mxlpy-0.24.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
56
+ mxlpy-0.24.0.dist-info/licenses/LICENSE,sha256=lHX9Eu70g3Iv1aOxXTWNHa3vq9vaVYSPQx4jOLYmDpw,1096
57
+ mxlpy-0.24.0.dist-info/RECORD,,
File without changes