Log fsp registy entries in `cascade` startup
parent
9d9929fb89
commit
be93ded0e5
|
@ -26,7 +26,6 @@ FSP (financial signal processing) apis.
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from pprint import pformat
|
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
Callable,
|
Callable,
|
||||||
|
@ -56,7 +55,6 @@ def _load_builtins() -> dict[tuple, Callable]:
|
||||||
from . import _momo # noqa
|
from . import _momo # noqa
|
||||||
from . import _volume # noqa
|
from . import _volume # noqa
|
||||||
|
|
||||||
log.info(f'Registered FSP set:\n{pformat(_fsp_registry)}')
|
|
||||||
return _fsp_registry
|
return _fsp_registry
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,7 @@ from .. import data
|
||||||
from ..data import attach_shm_array
|
from ..data import attach_shm_array
|
||||||
from ..data.feed import Feed
|
from ..data.feed import Feed
|
||||||
from ..data._sharedmem import ShmArray
|
from ..data._sharedmem import ShmArray
|
||||||
# from ._momo import _rsi, _wma
|
from ._api import Fsp
|
||||||
# from ._volume import _tina_vwap, dolla_vlm
|
|
||||||
from ._api import _load_builtins
|
from ._api import _load_builtins
|
||||||
|
|
||||||
log = get_logger(__name__)
|
log = get_logger(__name__)
|
||||||
|
@ -78,7 +77,6 @@ async def fsp_compute(
|
||||||
src: ShmArray,
|
src: ShmArray,
|
||||||
dst: ShmArray,
|
dst: ShmArray,
|
||||||
|
|
||||||
# func_name: str,
|
|
||||||
func: Callable,
|
func: Callable,
|
||||||
|
|
||||||
attach_stream: bool = False,
|
attach_stream: bool = False,
|
||||||
|
@ -216,8 +214,12 @@ async def cascade(
|
||||||
src = attach_shm_array(token=src_shm_token)
|
src = attach_shm_array(token=src_shm_token)
|
||||||
dst = attach_shm_array(readonly=False, token=dst_shm_token)
|
dst = attach_shm_array(readonly=False, token=dst_shm_token)
|
||||||
|
|
||||||
# func: Callable = _fsp_builtins.get(tuple(ns_path))
|
reg = _load_builtins()
|
||||||
func: Fsp = _load_builtins().get(
|
lines = '\n'.join([f'{key.rpartition(":")[2]} => {key}' for key in reg])
|
||||||
|
log.info(
|
||||||
|
f'Registered FSP set:\n{lines}'
|
||||||
|
)
|
||||||
|
func: Fsp = reg.get(
|
||||||
NamespacePath(ns_path)
|
NamespacePath(ns_path)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue