phylogenie 1.0.2__py3-none-any.whl → 1.0.3__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.
- phylogenie/core/factories.py +10 -14
- {phylogenie-1.0.2.dist-info → phylogenie-1.0.3.dist-info}/METADATA +1 -1
- {phylogenie-1.0.2.dist-info → phylogenie-1.0.3.dist-info}/RECORD +6 -6
- {phylogenie-1.0.2.dist-info → phylogenie-1.0.3.dist-info}/LICENSE.txt +0 -0
- {phylogenie-1.0.2.dist-info → phylogenie-1.0.3.dist-info}/WHEEL +0 -0
- {phylogenie-1.0.2.dist-info → phylogenie-1.0.3.dist-info}/entry_points.txt +0 -0
phylogenie/core/factories.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any, overload
|
|
1
|
+
from typing import Any, Literal, overload
|
|
2
2
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
|
|
@@ -23,10 +23,9 @@ def _eval_expression(expression: str, data: pgt.Data) -> Any:
|
|
|
23
23
|
expression,
|
|
24
24
|
{
|
|
25
25
|
"__builtins__": __builtins__,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
"np": np,
|
|
27
|
+
**{k: np.array(v) for k, v in data.items()},
|
|
28
28
|
},
|
|
29
|
-
{k: np.array(v) for k, v in data.items()},
|
|
30
29
|
)
|
|
31
30
|
).tolist()
|
|
32
31
|
|
|
@@ -101,20 +100,17 @@ def skyline_parameter_like_factory(
|
|
|
101
100
|
)
|
|
102
101
|
|
|
103
102
|
|
|
104
|
-
from typing import Literal
|
|
105
|
-
|
|
106
|
-
|
|
107
103
|
@overload
|
|
108
104
|
def _parse_skyline_vector_value_model(
|
|
109
105
|
x: cfg.SkylineVectorValueModel, data: pgt.Data, coercible: Literal[True]
|
|
110
|
-
) ->
|
|
106
|
+
) -> SkylineVectorCoercible: ...
|
|
111
107
|
@overload
|
|
112
108
|
def _parse_skyline_vector_value_model(
|
|
113
109
|
x: cfg.SkylineVectorValueModel, data: pgt.Data, coercible: Literal[False]
|
|
114
|
-
) ->
|
|
110
|
+
) -> SkylineVectorLike: ...
|
|
115
111
|
def _parse_skyline_vector_value_model(
|
|
116
112
|
x: cfg.SkylineVectorValueModel, data: pgt.Data, coercible: bool
|
|
117
|
-
) ->
|
|
113
|
+
) -> SkylineVectorCoercible:
|
|
118
114
|
change_times = many_scalars_factory(x.change_times, data)
|
|
119
115
|
if isinstance(x.value, str):
|
|
120
116
|
e = _eval_expression(x.value, data)
|
|
@@ -132,13 +128,13 @@ def _parse_skyline_vector_value_model(
|
|
|
132
128
|
return SkylineParameter(value=value, change_times=change_times)
|
|
133
129
|
else:
|
|
134
130
|
raise ValueError(
|
|
135
|
-
f"Parsing SkylineVector
|
|
131
|
+
f"Parsing SkylineVector config {x.value} yielded a sequence of scalars {value} when a nested (2D) sequence of scalars was expected."
|
|
136
132
|
)
|
|
137
133
|
|
|
138
134
|
Ns = {len(elem) for elem in value if tg.is_many(elem)}
|
|
139
135
|
if len(Ns) > 1:
|
|
140
136
|
raise ValueError(
|
|
141
|
-
f"All elements in the value of a SkylineVector config must be scalars or have the same length (
|
|
137
|
+
f"All elements in the value of a SkylineVector config must be scalars or have the same length (config {x.value} yielded value={value} with inconsistent lengths {Ns})."
|
|
142
138
|
)
|
|
143
139
|
(N,) = Ns
|
|
144
140
|
value = [[p] * N if isinstance(p, pgt.Scalar) else p for p in value]
|
|
@@ -238,13 +234,13 @@ def skyline_matrix_coercible_factory(
|
|
|
238
234
|
n_rows = len(elem)
|
|
239
235
|
if any(len(row) != n_rows for row in elem):
|
|
240
236
|
raise ValueError(
|
|
241
|
-
f"All elements in the value of a SkylineMatrix config must be scalars or square matrices (
|
|
237
|
+
f"All elements in the value of a SkylineMatrix config must be scalars or square matrices (config {x.value} yeilded a non-square matrix: {elem})."
|
|
242
238
|
)
|
|
243
239
|
Ns.add(n_rows)
|
|
244
240
|
|
|
245
241
|
if len(Ns) > 1:
|
|
246
242
|
raise ValueError(
|
|
247
|
-
f"All elements in the value of a SkylineMatrix config must be scalars or have the same square shape (
|
|
243
|
+
f"All elements in the value of a SkylineMatrix config must be scalars or have the same square shape (config {x.value} yielded value={value} with inconsistent lengths {Ns})."
|
|
248
244
|
)
|
|
249
245
|
(N,) = Ns
|
|
250
246
|
value = [[[p] * N] * N if isinstance(p, pgt.Scalar) else p for p in value]
|
|
@@ -12,7 +12,7 @@ phylogenie/core/context/configs.py,sha256=zd-ADFzJbb6KPkol-tXxSdS8LUBeQYQq8fDzXo
|
|
|
12
12
|
phylogenie/core/context/distributions.py,sha256=QF14tM2ibjE7f6WK3s4hTaz_sLQBTNVr2ZBNe2refeE,3059
|
|
13
13
|
phylogenie/core/context/factories.py,sha256=QO96wZwrQbgX2Rkd0wY3qQDahiZ8fDg8Mg8KKY0lr2c,1390
|
|
14
14
|
phylogenie/core/dataset.py,sha256=mgPAexXTat6x7YB9-BI6d5HWwrAvt8xydmiWVzwVD3M,2431
|
|
15
|
-
phylogenie/core/factories.py,sha256=
|
|
15
|
+
phylogenie/core/factories.py,sha256=Ph9qlQ6AthVKbzQZvvzj6EQye5LS2nl6d_r2dFuBfEo,8881
|
|
16
16
|
phylogenie/core/msas/__init__.py,sha256=-2XjTmiTA6zAwiLs2ksKecCrSbNLheo7KKjDyvuLipg,207
|
|
17
17
|
phylogenie/core/msas/alisim.py,sha256=TG4LAHJaH3rGWa3cwXzX6MgaXuh2tLzhdoALyOkoiXY,1047
|
|
18
18
|
phylogenie/core/msas/base.py,sha256=cKH0FGALmObmOLZ2dJ3vrpb3jTLg2oeWJsIE6HznJ0Q,1803
|
|
@@ -32,8 +32,8 @@ phylogenie/skyline/parameter.py,sha256=wrtvQDho3OC5tzrMnnFTy95GXaYN20KN8P5Gwyf-r
|
|
|
32
32
|
phylogenie/skyline/vector.py,sha256=NgmVbWjWG_itZ9a57q9QqSybvG9-Cr9X264RGPVyp_Q,6399
|
|
33
33
|
phylogenie/typeguards.py,sha256=WBOSJSaOC8VDtrYoA2w_AYEXTpyKdCfmsM29KaKXl3A,1350
|
|
34
34
|
phylogenie/typings.py,sha256=93VRedBxrpzXkT4uaNu_1JiMzsOjp7fUy4kLv_eYxUE,565
|
|
35
|
-
phylogenie-1.0.
|
|
36
|
-
phylogenie-1.0.
|
|
37
|
-
phylogenie-1.0.
|
|
38
|
-
phylogenie-1.0.
|
|
39
|
-
phylogenie-1.0.
|
|
35
|
+
phylogenie-1.0.3.dist-info/LICENSE.txt,sha256=NUrDqElK-eD3I0WqC004CJsy6cs0JgsAoebDv_42-pw,1071
|
|
36
|
+
phylogenie-1.0.3.dist-info/METADATA,sha256=JVGcZNn6O2Wuuek_ZTQp5CBdw5_xoSHzvSyTmENmxNw,6251
|
|
37
|
+
phylogenie-1.0.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
38
|
+
phylogenie-1.0.3.dist-info/entry_points.txt,sha256=Rt6_usN0FkBX1ZfiqCirjMN9FKOgFLG8rydcQ8kugeE,51
|
|
39
|
+
phylogenie-1.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|