spells-mtg 0.6.0__tar.gz → 0.6.1__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spells-mtg
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: analaysis of 17Lands.com public datasets
5
5
  Author-Email: Joel Barnes <oelarnes@gmail.com>
6
6
  License: MIT
@@ -11,7 +11,7 @@ dependencies = [
11
11
  ]
12
12
  requires-python = ">=3.11"
13
13
  readme = "README.md"
14
- version = "0.6.0"
14
+ version = "0.6.1"
15
15
 
16
16
  [project.license]
17
17
  text = "MIT"
@@ -13,7 +13,7 @@ def print_ext(ext: dict[str, ColSpec]) -> None:
13
13
  print("\t" + key)
14
14
 
15
15
 
16
- def attr_cols(attr, silent=False) -> dict[str, ColSpec]:
16
+ def context_cols(attr, silent: bool = False) -> dict[str, ColSpec]:
17
17
  ext = {
18
18
  f"seen_{attr}": ColSpec(
19
19
  col_type=ColType.NAME_SUM,
@@ -108,6 +108,16 @@ def attr_cols(attr, silent=False) -> dict[str, ColSpec]:
108
108
  col_type=ColType.AGG,
109
109
  expr=pl.col(f"pick_{attr}") / pl.col(ColName.NUM_TAKEN),
110
110
  ),
111
+ }
112
+
113
+ if not silent:
114
+ print_ext(ext)
115
+
116
+ return ext
117
+
118
+
119
+ def stat_cols(attr: str, silent: bool = False) -> dict[str, ColSpec]:
120
+ ext = {
111
121
  f"{attr}_deck_weight_group": ColSpec(
112
122
  col_type=ColType.AGG, expr=pl.col(f"{attr}") * pl.col(ColName.DECK)
113
123
  ),
@@ -169,45 +179,3 @@ def attr_cols(attr, silent=False) -> dict[str, ColSpec]:
169
179
  print_ext(ext)
170
180
 
171
181
  return ext
172
-
173
-
174
- def more(silent=True):
175
- wr_bucket = pl.col(ColName.USER_GAME_WIN_RATE_BUCKET)
176
- gp_bucket = pl.col(ColName.USER_N_GAMES_BUCKET)
177
- ext = {
178
- "deq_base": ColSpec(
179
- col_type=ColType.AGG,
180
- expr=(pl.col("gp_wr_excess") + 0.03 * (1 - pl.col("ata") / 14).pow(2))
181
- * pl.col("pct_gp"),
182
- ),
183
- "cohorts_plus": ColSpec(
184
- col_type=ColType.GROUP_BY,
185
- expr=pl.when((wr_bucket > 0.65) & (gp_bucket >= 500))
186
- .then(pl.lit("1 Best"))
187
- .otherwise(
188
- pl.when(
189
- (wr_bucket > 0.61) & (gp_bucket >= 500)
190
- | (wr_bucket > 0.65) & (gp_bucket >= 100)
191
- )
192
- .then(pl.lit("2 Elite"))
193
- .otherwise(
194
- pl.when(
195
- (wr_bucket > 0.57) & (gp_bucket >= 100) | (wr_bucket > 0.61)
196
- )
197
- .then(pl.lit("3 Competitive"))
198
- .otherwise(
199
- pl.when(
200
- (wr_bucket > 0.53) & (gp_bucket >= 100) | (wr_bucket > 0.57)
201
- )
202
- .then(pl.lit("4 Solid"))
203
- .otherwise(pl.lit("5 None"))
204
- )
205
- )
206
- ),
207
- ),
208
- }
209
-
210
- if not silent:
211
- print_ext(ext)
212
-
213
- return ext
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