spells-mtg 0.10.4__py3-none-any.whl → 0.10.6__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.
Potentially problematic release.
This version of spells-mtg might be problematic. Click here for more details.
- spells/extension.py +27 -1
- spells/external.py +2 -2
- {spells_mtg-0.10.4.dist-info → spells_mtg-0.10.6.dist-info}/METADATA +1 -1
- {spells_mtg-0.10.4.dist-info → spells_mtg-0.10.6.dist-info}/RECORD +7 -7
- {spells_mtg-0.10.4.dist-info → spells_mtg-0.10.6.dist-info}/WHEEL +0 -0
- {spells_mtg-0.10.4.dist-info → spells_mtg-0.10.6.dist-info}/entry_points.txt +0 -0
- {spells_mtg-0.10.4.dist-info → spells_mtg-0.10.6.dist-info}/licenses/LICENSE +0 -0
spells/extension.py
CHANGED
|
@@ -25,6 +25,7 @@ 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
|
|
|
@@ -49,7 +50,26 @@ def context_cols(attr, silent: bool = True) -> 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 = True) -> 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(
|
spells/external.py
CHANGED
|
@@ -345,11 +345,11 @@ def get_set_context(set_code: str, force_download=False) -> int:
|
|
|
345
345
|
|
|
346
346
|
df = summon(
|
|
347
347
|
set_code,
|
|
348
|
-
columns=[ColName.
|
|
348
|
+
columns=[ColName.NUM_TAKEN],
|
|
349
349
|
group_by=[ColName.DRAFT_DATE, ColName.PICK_NUM],
|
|
350
350
|
)
|
|
351
351
|
|
|
352
|
-
context_df = df.filter(pl.col(ColName.
|
|
352
|
+
context_df = df.filter(pl.col(ColName.NUM_TAKEN) > 1000).select(
|
|
353
353
|
[
|
|
354
354
|
pl.col(ColName.DRAFT_DATE).min().alias("release_date"),
|
|
355
355
|
pl.col(ColName.PICK_NUM).max().alias("picks_per_pack"),
|
|
@@ -5,15 +5,15 @@ spells/columns.py,sha256=tQPhFpG4vOMIjV111p8DK4V-d_8634xoE-csBzou_sw,18008
|
|
|
5
5
|
spells/config.py,sha256=_t98dc_uY3Wp3d5tsU3CJgVcWOD3wVlwMo98-tN2KRY,213
|
|
6
6
|
spells/draft_data.py,sha256=xoL82NTgTJWxZK1p-6LjxnYzkeYOr-Dc9-_T0m-WZ1Y,19946
|
|
7
7
|
spells/enums.py,sha256=MwJ9694AVoaKE22WlFjzHPcRfrU0DKI2_mrWC6_YjhE,4931
|
|
8
|
-
spells/extension.py,sha256=
|
|
9
|
-
spells/external.py,sha256=
|
|
8
|
+
spells/extension.py,sha256=LBqGbJbe7iSRQkxJK7npkADCfzhdnIwwVvlmTn8xvjQ,8454
|
|
9
|
+
spells/external.py,sha256=USqOtOVY7Mn39rdUPhmIeGm08s6TDnEV8-N3D14qJzE,11844
|
|
10
10
|
spells/filter.py,sha256=J-YTOOAzOQpvIX29tviYL04RVoOUlfsbjBXoQBDCEdQ,3380
|
|
11
11
|
spells/log.py,sha256=3avmg65hru8K9npKLvPp1wWWxq-hoEYDUCbxqhPkKUw,2175
|
|
12
12
|
spells/manifest.py,sha256=iOmhxIVMHu_Av3nd23zGjmUwLvZ2hAM0oc1ErPzZ_oE,8341
|
|
13
13
|
spells/schema.py,sha256=DbMvV8PIThJTp0Xzp_XIorlW6JhE1ud1kWRGf5SQ4_c,6406
|
|
14
14
|
spells/utils.py,sha256=IO3brrXVvZla0LRTEB5v6NgGqZb_rYA46XtKBURGMNk,1944
|
|
15
|
-
spells_mtg-0.10.
|
|
16
|
-
spells_mtg-0.10.
|
|
17
|
-
spells_mtg-0.10.
|
|
18
|
-
spells_mtg-0.10.
|
|
19
|
-
spells_mtg-0.10.
|
|
15
|
+
spells_mtg-0.10.6.dist-info/METADATA,sha256=i7ytLK-0f8OpDOtwjfTRKK1XCJMTQoIzYFUFOlPFKhI,47227
|
|
16
|
+
spells_mtg-0.10.6.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
|
17
|
+
spells_mtg-0.10.6.dist-info/entry_points.txt,sha256=a9Y1omdl9MdnKuIj3aOodgrp-zZII6OCdvqwgP6BFvI,63
|
|
18
|
+
spells_mtg-0.10.6.dist-info/licenses/LICENSE,sha256=tS54XYbJSgmq5zuHhbsQGbNQLJPVgXqhF5nu2CSRMig,1068
|
|
19
|
+
spells_mtg-0.10.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|