Skip to content

Commit

Permalink
Improve typing
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Feb 17, 2023
1 parent 1381785 commit 7e0e9d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion nautilus_trader/config/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def create(self):

class ImportableConfig(NautilusConfig, frozen=True):
"""
Represents an importable (typically live data or execution) client configuration.
Represents an importable (typically live data client or live execution client) configuration.
"""

path: str
Expand Down
5 changes: 2 additions & 3 deletions nautilus_trader/config/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ class TradingNodeConfig(NautilusKernelConfig, frozen=True):
The live execution engine configuration.
streaming : StreamingConfig, optional
The configuration for streaming to feather files.
data_clients : dict[str, ImportableConfig], optional
data_clients : dict[str, ImportableConfig | LiveDataClientConfig], optional
The data client configurations.
exec_clients : dict[str, ImportableConfig], optional
exec_clients : dict[str, ImportableConfig | LiveExecClientConfig], optional
The execution client configurations.
strategies : list[ImportableStrategyConfig]
The strategy configurations for the node.
Expand All @@ -178,7 +178,6 @@ class TradingNodeConfig(NautilusKernelConfig, frozen=True):
The timeout for all engine clients to disconnect.
timeout_post_stop : PositiveFloat (seconds)
The timeout after stopping the node to await residual events before final shutdown.
"""

environment: Environment = Environment.LIVE
Expand Down
4 changes: 2 additions & 2 deletions nautilus_trader/live/node_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def build_data_clients(self, config: dict[str, ImportableConfig]):
Parameters
----------
config : dict[str, object]
config : dict[str, ImportableConfig | LiveDataClientConfig]
The data clients configuration.
"""
Expand Down Expand Up @@ -191,7 +191,7 @@ def build_exec_clients(self, config: dict[str, ImportableConfig]):
Parameters
----------
config : dict[str, object]
config : dict[str, ImportableConfig | LiveExecClientConfig]
The execution clients configuration.
"""
Expand Down
2 changes: 1 addition & 1 deletion nautilus_trader/system/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def __init__( # noqa (too complex)

# Setup loop (if live)
if environment == Environment.LIVE:
self._loop: asyncio.AbstractEventLoop = loop or asyncio.get_event_loop()
self._loop: Optional[asyncio.AbstractEventLoop] = loop or asyncio.get_event_loop()
if loop is not None:
self._executor = concurrent.futures.ThreadPoolExecutor()
self._loop.set_default_executor(self.executor)
Expand Down

0 comments on commit 7e0e9d0

Please sign in to comment.