spells-mtg 0.7.2__tar.gz → 0.7.4__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.7.2
3
+ Version: 0.7.4
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.7.2"
14
+ version = "0.7.4"
15
15
 
16
16
  [project.license]
17
17
  text = "MIT"
@@ -173,6 +173,9 @@ def _determine_expression(
173
173
  else:
174
174
  expr = spec.expr
175
175
  expr = expr.alias(col)
176
+
177
+ if spec.col_type == ColType.AGG:
178
+ expr = expr.fill_nan(None)
176
179
  else:
177
180
  expr = pl.col(col)
178
181
 
@@ -130,11 +130,11 @@ def stat_cols(attr: str, silent: bool = False) -> dict[str, ColSpec]:
130
130
  ),
131
131
  f"{attr}_dw_excess": ColSpec(
132
132
  col_type=ColType.AGG,
133
- expr=pl.col(f"{attr}_dw_mean") - pl.col(f"{attr}"),
133
+ expr=pl.col(f"{attr}") - pl.col(f"{attr}_dw_mean"),
134
134
  ),
135
135
  f"{attr}_dw_var": ColSpec(
136
136
  col_type=ColType.AGG,
137
- expr=(pl.col(f"{attr}_dw_excess").pow(2) * pl.col(ColName.DECK))
137
+ expr=(pl.col(f"{attr}_dw_excess").pow(2) * pl.col(ColName.DECK)).sum()
138
138
  / pl.col(ColName.DECK_TOTAL),
139
139
  ),
140
140
  f"{attr}_dw_stdev": ColSpec(
@@ -158,11 +158,13 @@ def stat_cols(attr: str, silent: bool = False) -> dict[str, ColSpec]:
158
158
  ),
159
159
  f"{attr}_pw_excess": ColSpec(
160
160
  col_type=ColType.AGG,
161
- expr=pl.col(f"{attr}_pw_mean") - pl.col(f"{attr}"),
161
+ expr=pl.col(f"{attr}") - pl.col(f"{attr}_pw_mean"),
162
162
  ),
163
163
  f"{attr}_pw_var": ColSpec(
164
164
  col_type=ColType.AGG,
165
- expr=(pl.col(f"{attr}_pw_excess").pow(2) * pl.col(ColName.NUM_IN_POOL))
165
+ expr=(
166
+ pl.col(f"{attr}_pw_excess").pow(2) * pl.col(ColName.NUM_IN_POOL)
167
+ ).sum()
166
168
  / pl.col(ColName.NUM_IN_POOL_TOTAL),
167
169
  ),
168
170
  f"{attr}_pw_stdev": ColSpec(
@@ -106,6 +106,7 @@ def _resolve_view_cols(
106
106
  view_resolution[View.DRAFT] = view_resolution.get(
107
107
  View.DRAFT, frozenset()
108
108
  ).union({ColName.PICK})
109
+ # now determine views and deps
109
110
  if cdef.col_type == ColType.CARD_ATTR:
110
111
  view_resolution[View.CARD] = view_resolution.get(
111
112
  View.CARD, frozenset()
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