spells-mtg 0.10.3__tar.gz → 0.10.5__tar.gz
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.
Potentially problematic release.
This version of spells-mtg might be problematic. Click here for more details.
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/PKG-INFO +1 -1
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/pyproject.toml +1 -1
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/extension.py +29 -3
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/LICENSE +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/README.md +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/__init__.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/cache.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/cards.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/columns.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/config.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/draft_data.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/enums.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/external.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/filter.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/log.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/manifest.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/schema.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/spells/utils.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/tests/__init__.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/tests/filter_test.py +0 -0
- {spells_mtg-0.10.3 → spells_mtg-0.10.5}/tests/utils_test.py +0 -0
|
@@ -25,10 +25,11 @@ def seen_greatest_name_fn(attr: str) -> Callable:
|
|
|
25
25
|
.otherwise(expr)
|
|
26
26
|
)
|
|
27
27
|
return expr
|
|
28
|
+
|
|
28
29
|
return inner
|
|
29
30
|
|
|
30
31
|
|
|
31
|
-
def context_cols(attr, silent: bool =
|
|
32
|
+
def context_cols(attr, silent: bool = True) -> dict[str, ColSpec]:
|
|
32
33
|
ext = {
|
|
33
34
|
f"seen_{attr}": ColSpec(
|
|
34
35
|
col_type=ColType.NAME_SUM,
|
|
@@ -49,7 +50,26 @@ def context_cols(attr, silent: bool = False) -> dict[str, ColSpec]:
|
|
|
49
50
|
else card_context[name][attr],
|
|
50
51
|
),
|
|
51
52
|
f"pick_{attr}": ColSpec(
|
|
52
|
-
col_type=ColType.
|
|
53
|
+
col_type=ColType.GROUP_BY, expr=pl.col(f"pick_{attr}_sum")
|
|
54
|
+
),
|
|
55
|
+
f"pool_{attr}": ColSpec(
|
|
56
|
+
col_type=ColType.NAME_SUM,
|
|
57
|
+
expr=(
|
|
58
|
+
lambda name, card_context: pl.lit(None)
|
|
59
|
+
if card_context[name].get(attr) is None
|
|
60
|
+
or math.isnan(card_context[name][attr])
|
|
61
|
+
else card_context[name][attr] * pl.col(f"pool_{name}")
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
f"pool_{attr}_sum": ColSpec(
|
|
65
|
+
col_type=ColType.PICK_SUM,
|
|
66
|
+
expr=lambda names: pl.sum_horizontal(
|
|
67
|
+
[pl.col(f"pool_{attr}_{name}") for name in names]
|
|
68
|
+
),
|
|
69
|
+
),
|
|
70
|
+
f"pool_pick_{attr}_sum": ColSpec(
|
|
71
|
+
col_type=ColType.PICK_SUM,
|
|
72
|
+
expr=pl.col(f"pick_{attr}_sum") + pl.col(f"pool_{attr}_sum"),
|
|
53
73
|
),
|
|
54
74
|
f"seen_{attr}_is_greatest": ColSpec(
|
|
55
75
|
col_type=ColType.NAME_SUM,
|
|
@@ -75,6 +95,12 @@ def context_cols(attr, silent: bool = False) -> dict[str, ColSpec]:
|
|
|
75
95
|
[pl.col(f"seen_{attr}_{name}") for name in names]
|
|
76
96
|
),
|
|
77
97
|
),
|
|
98
|
+
f"seen_{attr}_pack_sum": ColSpec(
|
|
99
|
+
col_type=ColType.PICK_SUM,
|
|
100
|
+
expr=lambda names: pl.sum_horizontal(
|
|
101
|
+
[pl.col(f"seen_{attr}_{name}") for name in names]
|
|
102
|
+
),
|
|
103
|
+
),
|
|
78
104
|
f"least_{attr}_seen": ColSpec(
|
|
79
105
|
col_type=ColType.PICK_SUM,
|
|
80
106
|
expr=lambda names: pl.min_horizontal(
|
|
@@ -145,7 +171,7 @@ def context_cols(attr, silent: bool = False) -> dict[str, ColSpec]:
|
|
|
145
171
|
return ext
|
|
146
172
|
|
|
147
173
|
|
|
148
|
-
def stat_cols(attr: str, silent: bool =
|
|
174
|
+
def stat_cols(attr: str, silent: bool = True) -> dict[str, ColSpec]:
|
|
149
175
|
ext = {
|
|
150
176
|
f"{attr}_deck_weight_group": ColSpec(
|
|
151
177
|
col_type=ColType.AGG, expr=pl.col(f"{attr}") * pl.col(ColName.DECK)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|