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

Function _load_fixture_prices

python/tests/test_bindings_contract.py:9–24  ·  view source on GitHub ↗
(max_rows: int = 64, symbols=("EEM", "EWG", "TIP"))

Source from the content-addressed store, hash-verified

7
8
9def _load_fixture_prices(max_rows: int = 64, symbols=("EEM", "EWG", "TIP")):
10 fixture_path = (
11 Path(__file__).resolve().parents[2]
12 / "tests"
13 / "fixtures"
14 / "portfolio_optimization"
15 / "stock_prices.csv"
16 )
17 rows = []
18 with fixture_path.open("r", newline="") as f:
19 reader = csv.DictReader(f)
20 for i, row in enumerate(reader):
21 rows.append([float(row[s]) for s in symbols])
22 if i + 1 >= max_rows:
23 break
24 return rows
25
26
27def test_risk_metrics_smoke():

Callers 1

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected