spells-mtg 0.11.3__tar.gz → 0.11.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.11.3 → spells_mtg-0.11.5}/PKG-INFO +1 -1
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/pyproject.toml +1 -1
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/card_data_files.py +37 -39
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/LICENSE +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/README.md +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/.ruff_cache/.gitignore +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/.ruff_cache/0.8.6/17785301476771359756 +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/.ruff_cache/CACHEDIR.TAG +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/__init__.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/cache.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/cards.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/columns.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/config.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/draft_data.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/enums.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/extension.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/external.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/filter.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/log.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/manifest.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/schema.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/spells/utils.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/tests/__init__.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/tests/filter_test.py +0 -0
- {spells_mtg-0.11.3 → spells_mtg-0.11.5}/tests/utils_test.py +0 -0
|
@@ -25,35 +25,34 @@ START_DATE_MAP = {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
ratings_col_defs = {
|
|
28
|
-
ColName.NAME: pl.col("name"),
|
|
29
|
-
ColName.COLOR: pl.col("color"),
|
|
30
|
-
ColName.RARITY: pl.col("rarity"),
|
|
31
|
-
ColName.
|
|
32
|
-
ColName.
|
|
33
|
-
ColName.
|
|
34
|
-
ColName.
|
|
35
|
-
ColName.
|
|
36
|
-
ColName.
|
|
37
|
-
ColName.
|
|
38
|
-
ColName.
|
|
39
|
-
ColName.
|
|
40
|
-
ColName.OPENING_HAND: pl.col("opening_hand_game_count"),
|
|
28
|
+
ColName.NAME: pl.col("name").cast(pl.String),
|
|
29
|
+
ColName.COLOR: pl.col("color").cast(pl.String),
|
|
30
|
+
ColName.RARITY: pl.col("rarity").cast(pl.String),
|
|
31
|
+
ColName.IMAGE_URL: pl.col("url").cast(pl.String),
|
|
32
|
+
ColName.NUM_SEEN: pl.col("seen_count").cast(pl.Int64),
|
|
33
|
+
ColName.LAST_SEEN: pl.col("seen_count") * pl.col("avg_seen").cast(pl.Float64),
|
|
34
|
+
ColName.NUM_TAKEN: pl.col("pick_count").cast(pl.Int64),
|
|
35
|
+
ColName.TAKEN_AT: pl.col("pick_count") * pl.col("avg_pick").cast(pl.Float64),
|
|
36
|
+
ColName.DECK: pl.col("game_count").cast(pl.Int64),
|
|
37
|
+
ColName.WON_DECK: pl.col("win_rate") * pl.col("game_count").cast(pl.Float64),
|
|
38
|
+
ColName.SIDEBOARD: (pl.col("pool_count") - pl.col("game_count")).cast(pl.Int64),
|
|
39
|
+
ColName.OPENING_HAND: pl.col("opening_hand_game_count").cast(pl.Int64),
|
|
41
40
|
ColName.WON_OPENING_HAND: pl.col("opening_hand_game_count")
|
|
42
|
-
* pl.col("opening_hand_win_rate"),
|
|
43
|
-
ColName.DRAWN: pl.col("drawn_game_count"),
|
|
44
|
-
ColName.WON_DRAWN: pl.col("drawn_win_rate") * pl.col("drawn_game_count"),
|
|
45
|
-
ColName.NUM_GIH: pl.col("ever_drawn_game_count"),
|
|
41
|
+
* pl.col("opening_hand_win_rate").cast(pl.Float64),
|
|
42
|
+
ColName.DRAWN: pl.col("drawn_game_count").cast(pl.Int64),
|
|
43
|
+
ColName.WON_DRAWN: pl.col("drawn_win_rate") * pl.col("drawn_game_count").cast(pl.Float64),
|
|
44
|
+
ColName.NUM_GIH: pl.col("ever_drawn_game_count").cast(pl.Int64),
|
|
46
45
|
ColName.NUM_GIH_WON: pl.col("ever_drawn_game_count")
|
|
47
|
-
* pl.col("ever_drawn_win_rate"),
|
|
48
|
-
ColName.NUM_GNS: pl.col("never_drawn_game_count"),
|
|
46
|
+
* pl.col("ever_drawn_win_rate").cast(pl.Float64),
|
|
47
|
+
ColName.NUM_GNS: pl.col("never_drawn_game_count").cast(pl.Int64),
|
|
49
48
|
ColName.WON_NUM_GNS: pl.col("never_drawn_game_count")
|
|
50
|
-
* pl.col("never_drawn_win_rate"),
|
|
49
|
+
* pl.col("never_drawn_win_rate").cast(pl.Float64),
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
deck_color_col_defs = {
|
|
54
|
-
ColName.MAIN_COLORS: pl.col("short_name"),
|
|
55
|
-
ColName.NUM_GAMES: pl.col("games"),
|
|
56
|
-
ColName.NUM_WON: pl.col("wins"),
|
|
53
|
+
ColName.MAIN_COLORS: pl.col("short_name").cast(pl.String),
|
|
54
|
+
ColName.NUM_GAMES: pl.col("games").cast(pl.Int64),
|
|
55
|
+
ColName.NUM_WON: pl.col("wins").cast(pl.Int64),
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
|
|
@@ -109,7 +108,7 @@ def deck_color_df(
|
|
|
109
108
|
pl.lit(format).alias(ColName.EVENT_TYPE),
|
|
110
109
|
(pl.lit("Top") if player_cohort == "top" else pl.lit(None)).alias(
|
|
111
110
|
ColName.PLAYER_COHORT
|
|
112
|
-
),
|
|
111
|
+
).cast(pl.String),
|
|
113
112
|
*[val.alias(key) for key, val in deck_color_col_defs.items()],
|
|
114
113
|
]
|
|
115
114
|
)
|
|
@@ -175,18 +174,17 @@ def base_ratings_df(
|
|
|
175
174
|
concat_list.append(pl.read_json(ratings_file_path).with_columns(
|
|
176
175
|
(pl.lit(deck_color) if deck_color != "any" else pl.lit(None)).alias(
|
|
177
176
|
ColName.MAIN_COLORS
|
|
178
|
-
)
|
|
179
|
-
)
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
)
|
|
177
|
+
).cast(pl.String)
|
|
178
|
+
).select(
|
|
179
|
+
[
|
|
180
|
+
pl.lit(set_code).alias(ColName.EXPANSION),
|
|
181
|
+
pl.lit(format).alias(ColName.EVENT_TYPE),
|
|
182
|
+
(pl.lit("Top") if player_cohort == "top" else pl.lit(None)).alias(
|
|
183
|
+
ColName.PLAYER_COHORT
|
|
184
|
+
).cast(pl.String),
|
|
185
|
+
ColName.MAIN_COLORS,
|
|
186
|
+
*[val.alias(key) for key, val in ratings_col_defs.items()],
|
|
187
|
+
]
|
|
188
|
+
))
|
|
189
|
+
|
|
190
|
+
return pl.concat(concat_list)
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|