Import `np2pl()` from `.data.tsp`

Also toss in todo for a timeseries search CLI cmd which can be handy
when doing offine store mgmt.
distribute_dis
Tyler Goodlet 2023-12-13 09:25:44 -05:00
parent b95932ea09
commit f274c3db3b
1 changed files with 17 additions and 6 deletions

View File

@ -99,6 +99,18 @@ def ls(
trio.run(query_all) trio.run(query_all)
# TODO: like ls but takes in a pattern and matches
# @store.command()
# def search(
# patt: str,
# backends: list[str] = typer.Argument(
# default=None,
# help='Storage backends to query, default is all.'
# ),
# ):
# ...
@store.command() @store.command()
def delete( def delete(
symbols: list[str], symbols: list[str],
@ -189,10 +201,10 @@ def anal(
df, df,
gaps, gaps,
deduped, deduped,
shortened, diff,
) = tsp.dedupe(shm_df) ) = tsp.dedupe(shm_df)
if shortened: if diff:
await client.write_ohlcv( await client.write_ohlcv(
fqme, fqme,
ohlcv=deduped, ohlcv=deduped,
@ -260,8 +272,8 @@ def iter_dfs_from_shms(fqme: str) -> Generator[
assert not opened assert not opened
ohlcv = shm.array ohlcv = shm.array
from .nativedb import np2pl from ..data import tsp
df: pl.DataFrame = np2pl(ohlcv) df: pl.DataFrame = tsp.np2pl(ohlcv)
yield ( yield (
shmfile, shmfile,
@ -273,7 +285,6 @@ def iter_dfs_from_shms(fqme: str) -> Generator[
@store.command() @store.command()
def ldshm( def ldshm(
fqme: str, fqme: str,
write_parquet: bool = False, write_parquet: bool = False,
) -> None: ) -> None:
@ -309,7 +320,7 @@ def ldshm(
df, df,
gaps, gaps,
deduped, deduped,
was_dded, diff,
) = tsp.dedupe(shm_df) ) = tsp.dedupe(shm_df)
# TODO: maybe only optionally enter this depending # TODO: maybe only optionally enter this depending