Add subsys log to new `.data._util`
parent
06b80ff9ed
commit
53a41ba93d
|
@ -25,7 +25,7 @@ sharing live streams over a network.
|
|||
import tractor
|
||||
import trio
|
||||
|
||||
from ..log import (
|
||||
from ._util import (
|
||||
get_console_log,
|
||||
)
|
||||
from ._normalize import iterticks
|
||||
|
|
|
@ -42,10 +42,7 @@ from numba import (
|
|||
# float64, optional, int64,
|
||||
)
|
||||
|
||||
from ..log import get_logger
|
||||
|
||||
|
||||
log = get_logger(__name__)
|
||||
from ._util import log
|
||||
|
||||
|
||||
def ds_m4(
|
||||
|
|
|
@ -38,8 +38,8 @@ from tractor.trionics import (
|
|||
import trio
|
||||
from trio_typing import TaskStatus
|
||||
|
||||
from ..log import (
|
||||
get_logger,
|
||||
from ._util import (
|
||||
log,
|
||||
get_console_log,
|
||||
)
|
||||
from ..service import maybe_spawn_daemon
|
||||
|
@ -50,8 +50,6 @@ if TYPE_CHECKING:
|
|||
)
|
||||
from .feed import _FeedsBus
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
||||
|
||||
# highest frequency sample step is 1 second by default, though in
|
||||
# the future we may want to support shorter periods or a dynamic style
|
||||
|
|
|
@ -32,14 +32,11 @@ import numpy as np
|
|||
from numpy.lib import recfunctions as rfn
|
||||
import tractor
|
||||
|
||||
from ..log import get_logger
|
||||
from ._util import log
|
||||
from ._source import base_iohlc_dtype
|
||||
from .types import Struct
|
||||
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
||||
|
||||
# how much is probably dependent on lifestyle
|
||||
_secs_in_day = int(60 * 60 * 24)
|
||||
# we try for a buncha times, but only on a run-every-other-day kinda week.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# piker: trading gear for hackers
|
||||
# Copyright (C) 2018-present Tyler Goodlet (in stewardship for piker0)
|
||||
# Copyright (C) 2018-present Tyler Goodlet (in stewardship for pikers)
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
|
@ -18,22 +18,10 @@
|
|||
numpy data source coversion helpers.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
from decimal import (
|
||||
Decimal,
|
||||
ROUND_HALF_EVEN,
|
||||
)
|
||||
from typing import Any
|
||||
|
||||
from bidict import bidict
|
||||
import numpy as np
|
||||
|
||||
from .types import Struct
|
||||
from ..accounting._mktinfo import (
|
||||
# mkfqsn,
|
||||
unpack_fqsn,
|
||||
# digits_to_dec,
|
||||
float_digits,
|
||||
)
|
||||
|
||||
ohlc_fields = [
|
||||
('time', float),
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# piker: trading gear for hackers
|
||||
# Copyright (C) Tyler Goodlet (in stewardship for pikers)
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
'''
|
||||
Data layer module commons.
|
||||
|
||||
'''
|
||||
from functools import partial
|
||||
|
||||
from ..log import (
|
||||
get_logger,
|
||||
get_console_log,
|
||||
)
|
||||
subsys: str = 'piker.data'
|
||||
|
||||
log = get_logger(subsys)
|
||||
|
||||
get_console_log = partial(
|
||||
get_console_log,
|
||||
name=subsys,
|
||||
)
|
|
@ -44,12 +44,9 @@ from trio_websocket._impl import (
|
|||
ConnectionTimeout,
|
||||
)
|
||||
|
||||
from ..log import get_logger
|
||||
|
||||
from ._util import log
|
||||
from .types import Struct
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
||||
|
||||
class NoBsWs:
|
||||
'''
|
||||
|
|
|
@ -32,14 +32,11 @@ from ..service.marketstore import (
|
|||
)
|
||||
from ..cli import cli
|
||||
from .. import watchlists as wl
|
||||
from ..log import (
|
||||
get_logger,
|
||||
from ._util import (
|
||||
log,
|
||||
)
|
||||
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
'--url',
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
abstractions for organizing, managing and generally operating-on
|
||||
Public abstractions for organizing, managing and generally operating-on
|
||||
real-time data processing data-structures.
|
||||
|
||||
"Streams, flumes, cascades and flows.."
|
||||
|
@ -35,8 +35,8 @@ from ..accounting._mktinfo import (
|
|||
MktPair,
|
||||
Symbol,
|
||||
)
|
||||
from ..log import (
|
||||
get_logger,
|
||||
from ._util import (
|
||||
log,
|
||||
)
|
||||
from .types import Struct
|
||||
from ._sharedmem import (
|
||||
|
@ -53,8 +53,6 @@ if TYPE_CHECKING:
|
|||
# from pyqtgraph import PlotItem
|
||||
from .feed import Feed
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
||||
|
||||
# TODO: ideas for further abstractions as per
|
||||
# https://github.com/pikers/piker/issues/216 and
|
||||
|
|
|
@ -23,7 +23,7 @@ Api layer likely in here...
|
|||
from types import ModuleType
|
||||
from importlib import import_module
|
||||
|
||||
from ..log import get_logger
|
||||
from ._util import get_logger
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
||||
|
|
Loading…
Reference in New Issue