From 58c096bfad2c299fba45b80c77973e85dc8a0082 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 19 Jun 2023 13:36:06 -0400 Subject: [PATCH] Bleh go back to using pdbp for REPL in anal --- piker/storage/cli.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/piker/storage/cli.py b/piker/storage/cli.py index f7deb92d..8cb39440 100644 --- a/piker/storage/cli.py +++ b/piker/storage/cli.py @@ -132,10 +132,16 @@ def anal( ) -> np.ndarray: - # import tractor + import tractor async def main(): - async with open_storage_client() as (mod, client): + async with ( + open_piker_runtime( + 'tsdb_polars_anal', + # enable_modules=['piker.service._ahab'] + ), + open_storage_client() as (mod, client), + ): syms: list[str] = await client.list_keys() print(f'{len(syms)} FOUND for {mod.name}') @@ -154,14 +160,13 @@ def anal( df = tsmod.with_dts(src_df) gaps: pl.DataFrame = tsmod.detect_time_gaps(df) + if gaps: + print(f'Gaps found:\n{gaps}') + # TODO: something better with tab completion.. # is there something more minimal but nearly as # functional as ipython? - import code - code.interact( - f'df: {df}\ngaps: {gaps}\n', - local=locals() - ) + await tractor.breakpoint() trio.run(main)