Skip to content

Commit 90f055f

Browse files
committed
Add fallback for legacy semiconductor lookback constant
1 parent 3e780c9 commit 90f055f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

application/runtime_broker_adapters.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
import pandas as pd
1111

1212
from quant_platform_kit.common.models import PricePoint, PriceSeries, QuoteSnapshot
13-
from quant_platform_kit.common.runtime_inputs import (
14-
DEFAULT_SEMICONDUCTOR_ROTATION_HISTORY_LOOKBACK,
15-
)
1613
from quant_platform_kit.common.port_adapters import (
1714
CallableExecutionPort,
1815
CallableMarketDataPort,
@@ -24,6 +21,13 @@
2421
build_portfolio_snapshot_from_account_state,
2522
)
2623

24+
try:
25+
from quant_platform_kit.common.runtime_inputs import (
26+
DEFAULT_SEMICONDUCTOR_ROTATION_HISTORY_LOOKBACK,
27+
)
28+
except ImportError: # pragma: no cover - compatibility with older packaged wheels
29+
DEFAULT_SEMICONDUCTOR_ROTATION_HISTORY_LOOKBACK = 420
30+
2731

2832
def _utcnow() -> datetime:
2933
return datetime.now(timezone.utc)

0 commit comments

Comments
 (0)