Skip to content

Commit 0ce53d3

Browse files
committed
style: apply ruff format to data/ and models/ modules
These files were committed without running ruff format via uv run, causing a version mismatch between the local venv ruff and CI's uv-managed ruff. Running uv run ruff format resolves all 41 files.
1 parent 42100b5 commit 0ce53d3

78 files changed

Lines changed: 1390 additions & 984 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
182 Bytes
Binary file not shown.
Binary file not shown.

packages/quant_pod/data/adapters/alpaca_ws.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ async def run(self, tick_queue: asyncio.Queue) -> None:
101101
self._running = True
102102
reconnect_wait = self._RECONNECT_BASE_SECONDS
103103

104-
logger.info(
105-
f"[AlpacaWS] Starting stream: feed={self._feed} "
106-
f"symbols={self.symbols}"
107-
)
104+
logger.info(f"[AlpacaWS] Starting stream: feed={self._feed} symbols={self.symbols}")
108105

109106
while self._running:
110107
try:
@@ -114,8 +111,7 @@ async def run(self, tick_queue: asyncio.Queue) -> None:
114111
if not self._running:
115112
break
116113
logger.warning(
117-
f"[AlpacaWS] Disconnected: {e} — "
118-
f"reconnecting in {reconnect_wait:.0f}s"
114+
f"[AlpacaWS] Disconnected: {e} — reconnecting in {reconnect_wait:.0f}s"
119115
)
120116
await asyncio.sleep(reconnect_wait)
121117
reconnect_wait = min(reconnect_wait * 2, self._RECONNECT_MAX_SECONDS)
@@ -139,16 +135,22 @@ async def _connect_and_stream(self, tick_queue: asyncio.Queue) -> None:
139135
ping_timeout=10,
140136
) as ws:
141137
# Auth
142-
await ws.send(json.dumps({"action": "auth", "key": self._api_key, "secret": self._api_secret}))
138+
await ws.send(
139+
json.dumps({"action": "auth", "key": self._api_key, "secret": self._api_secret})
140+
)
143141
auth_resp = json.loads(await ws.recv())
144142
self._check_auth(auth_resp)
145143

146144
# Subscribe to trades and quotes for all symbols
147-
await ws.send(json.dumps({
148-
"action": "subscribe",
149-
"trades": self.symbols,
150-
"quotes": self.symbols,
151-
}))
145+
await ws.send(
146+
json.dumps(
147+
{
148+
"action": "subscribe",
149+
"trades": self.symbols,
150+
"quotes": self.symbols,
151+
}
152+
)
153+
)
152154

153155
logger.info(f"[AlpacaWS] Subscribed to {self.symbols}")
154156

@@ -172,7 +174,7 @@ async def _connect_and_stream(self, tick_queue: asyncio.Queue) -> None:
172174

173175
def _check_auth(self, response: list) -> None:
174176
"""Raise if authentication failed."""
175-
for msg in (response if isinstance(response, list) else [response]):
177+
for msg in response if isinstance(response, list) else [response]:
176178
if msg.get("T") == "error":
177179
raise ConnectionError(f"Alpaca auth error: {msg.get('msg')}")
178180
if msg.get("T") == "success" and msg.get("msg") == "authenticated":

packages/quant_pod/data/market_data_bus.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,7 @@ def __init__(
125125
async def run(self, tick_queue: asyncio.Queue) -> None:
126126
self._running = True
127127
loop = asyncio.get_event_loop()
128-
logger.info(
129-
f"[RestPollingBus] Started: {self.symbols} "
130-
f"@ {self._interval:.0f}s interval"
131-
)
128+
logger.info(f"[RestPollingBus] Started: {self.symbols} @ {self._interval:.0f}s interval")
132129

133130
while self._running:
134131
for symbol in self.symbols:
@@ -156,14 +153,10 @@ async def run(self, tick_queue: asyncio.Queue) -> None:
156153
try:
157154
tick_queue.put_nowait(tick)
158155
except asyncio.QueueFull:
159-
logger.warning(
160-
f"[RestPollingBus] Tick queue full — dropping {symbol}"
161-
)
156+
logger.warning(f"[RestPollingBus] Tick queue full — dropping {symbol}")
162157

163158
except Exception as e:
164-
logger.warning(
165-
f"[RestPollingBus] Failed to fetch {symbol}: {e}"
166-
)
159+
logger.warning(f"[RestPollingBus] Failed to fetch {symbol}: {e}")
167160
await asyncio.sleep(self._error_sleep)
168161

169162
await asyncio.sleep(self._interval)

packages/quantcore/data/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@
2020
"set_provider",
2121
"DataValidator",
2222
]
23-
949 Bytes
Binary file not shown.
10.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
52.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)