Skip to content

Commit 94b3e32

Browse files
committed
update
1 parent 343fd5a commit 94b3e32

41 files changed

Lines changed: 2671 additions & 45 deletions

Some content is hidden

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

bt_api_py/containers/bars/gemini_bar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _parse_single_bar(self, bar_data: Any) -> "GeminiRequestBarData | None":
105105
"""
106106
if len(bar_data) >= 6:
107107
bar = GeminiRequestBarData(
108-
data=bar_data,
108+
data=None,
109109
symbol=self.symbol,
110110
asset_type=self.asset_type,
111111
time_frame=self.time_frame,

bt_api_py/containers/bars/kucoin_bar.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ def init_data(self):
205205
data = self.bar_data["data"]
206206
candles = data.get("candles", [])
207207
if candles:
208-
self.server_time = from_dict_get_float(candles, 0) * 1000
209-
self.open = from_dict_get_float(candles, 1)
210-
self.close = from_dict_get_float(candles, 2)
211-
self.high = from_dict_get_float(candles, 3)
212-
self.low = from_dict_get_float(candles, 4)
213-
self.volume = from_dict_get_float(candles, 5)
214-
self.turnover = from_dict_get_float(candles, 6)
208+
self.server_time = float(candles[0]) * 1000
209+
self.open = float(candles[1])
210+
self.close = float(candles[2])
211+
self.high = float(candles[3])
212+
self.low = float(candles[4])
213+
self.volume = float(candles[5])
214+
self.turnover = float(candles[6]) if len(candles) > 6 else 0.0
215215
self.bar_symbol_name = from_dict_get_string(data, "symbol")
216216

217217
self.period = None # Could extract from topic string

bt_api_py/monitoring/prometheus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def _server_loop(self) -> None:
244244
# Handle server shutdown gracefully
245245
break
246246
except Exception as e:
247-
_logger.debug("Prometheus server loop error, continuing: %s", e, exc_info=True)
247+
_logger.debug(f"Prometheus server loop error, continuing: {e}")
248248
continue
249249

250250
def is_running(self) -> bool:

coverage.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

coverage_analysis.md

Lines changed: 341 additions & 0 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Repository = "https://github.com/cloudQuant/bt_api_py"
4545
[tool.pytest.ini_options]
4646
addopts = [
4747
"--dist=loadgroup",
48+
"--import-mode=importlib",
4849
"--strict-markers",
4950
"--tb=short",
5051
]

scripts/analyze_coverage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ def run_coverage_analysis(self) -> dict:
9797
finally:
9898
os.chdir(previous_cwd)
9999

100-
if result == 0 and coverage_json.exists():
100+
if coverage_json.exists():
101101
with coverage_json.open() as f:
102102
coverage_data = json.load(f)
103+
if result != 0:
104+
print(f"Pytest exited with status {result}, using partial coverage data")
103105
return coverage_data
104106
except Exception as e:
105107
print(f"Error running coverage: {e}")

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
- Shared test utilities and hooks
88
"""
99

10-
pytest_plugins = ["conftest_test_data"]
10+
pytest_plugins = ["tests.conftest_test_data"]

0 commit comments

Comments
 (0)