MCPcopy Create free account
hub / github.com/Open-Quant/openquant / test_pipeline_run_frames

Function test_pipeline_run_frames

python/tests/test_pipeline_api.py:58–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57
58def test_pipeline_run_frames():
59 timestamps, close, probabilities, sides, asset_prices, asset_names = _toy_pipeline_input()
60 out = openquant.pipeline.run_mid_frequency_pipeline_frames(
61 timestamps=timestamps,
62 close=close,
63 model_probabilities=probabilities,
64 model_sides=sides,
65 asset_prices=asset_prices,
66 asset_names=asset_names,
67 cusum_threshold=0.0005,
68 )
69 frames = out["frames"]
70 assert isinstance(frames["signals"], pl.DataFrame)
71 assert isinstance(frames["events"], pl.DataFrame)
72 assert isinstance(frames["backtest"], pl.DataFrame)
73 assert isinstance(frames["weights"], pl.DataFrame)
74 assert frames["signals"].height == len(timestamps)
75 assert frames["backtest"].height == len(timestamps)
76 assert frames["weights"]["weight"].sum() == pytest.approx(1.0, abs=1e-6)
77
78
79def test_pipeline_summary_frame():

Callers

nothing calls this directly

Calls 1

_toy_pipeline_inputFunction · 0.85

Tested by

no test coverage detected