From e10f3a16dd092170e01f89428266c4326af29704 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 9 Jun 2025 10:35:47 -0400 Subject: [PATCH 1/2] Bump to (latest) `polars`, the `0.20.6x` series B) Since I was trying out the neat lookin `polars-fuzzy-match` (also added for now as a core dep here) which requires the new plugin sys, plus it's about time we synced with upstream! Adjust some column syntax to the new `.name` sub-field-space and the `uv` lock-file to match. Other, - add back `trio-typing` bc i guess something else needs it (debug tooling stuff in new `tractor`?) - flip back to the `tractor` pre-main pin since the new `main`-branch requires new `trio` stuff we haven't ported yet.. --- piker/tsp/_anal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piker/tsp/_anal.py b/piker/tsp/_anal.py index ea78c46a..42c3aa6c 100644 --- a/piker/tsp/_anal.py +++ b/piker/tsp/_anal.py @@ -517,7 +517,7 @@ def with_dts( ''' return df.with_columns([ - pl.col(time_col).shift(1).suffix('_prev'), + pl.col(time_col).shift(1).name.suffix('_prev'), pl.col(time_col).diff().alias('s_diff'), pl.from_epoch(pl.col(time_col)).alias('dt'), ]).with_columns([ @@ -623,7 +623,7 @@ def detect_vlm_gaps( ) -> pl.DataFrame: - vnull: pl.DataFrame = w_dts.filter( + vnull: pl.DataFrame = df.filter( pl.col(col) == 0 ) return vnull From 2ced05c4d5577d1c0483cc34c7cbf9eb8fca7d45 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 27 Sep 2025 12:24:11 -0400 Subject: [PATCH 2/2] `polars.cumsum()` is now `.cum_sum()` --- piker/accounting/calc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/piker/accounting/calc.py b/piker/accounting/calc.py index 5919c0d6..ff12c055 100644 --- a/piker/accounting/calc.py +++ b/piker/accounting/calc.py @@ -465,7 +465,7 @@ def ledger_to_dfs( df = dfs[key] = ldf.with_columns([ - pl.cumsum('size').alias('cumsize'), + pl.cum_sum('size').alias('cumsize'), # amount of source asset "sent" (via buy txns in # the market) to acquire the dst asset, PER txn. @@ -480,7 +480,7 @@ def ledger_to_dfs( ]).with_columns([ # rolling balance in src asset units - (pl.col('dst_bot').cumsum() * -1).alias('src_balance'), + (pl.col('dst_bot').cum_sum() * -1).alias('src_balance'), # "position operation type" in terms of increasing the # amount in the dst asset (entering) or decreasing the @@ -622,7 +622,7 @@ def ledger_to_dfs( # cost that was included in the least-recently # entered txn that is still part of the current CSi # set. - # => we look up the cost-per-unit cumsum and apply + # => we look up the cost-per-unit cum_sum and apply # if over the current txn size (by multiplication) # and then reverse that previusly applied cost on # the txn_cost for this record.