Skip to content

Commit 41e7936

Browse files
author
Codex CLI
committed
config: restore default region to REG_CN; examples: set crypto region explicitly in long-short crypto workflow\n\n- Revert default client region to REG_CN to keep CI and examples aligned with CN data\n- Crypto examples now pass region=REG_CRYPTO explicitly\n\nIntended to stabilize CI for PR #1986
1 parent eea20ff commit 41e7936

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

examples/workflow_by_code_longshort_crypto.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import os
1414
import qlib
1515
from qlib.utils import init_instance_by_config, flatten_dict
16+
from qlib.constant import REG_CRYPTO
1617

1718

1819
if __name__ == "__main__":
@@ -32,7 +33,8 @@
3233

3334
# Initialize with crypto perp data provider (ensure this path exists in your env)
3435
PROVIDER_URI = "~/.qlib/qlib_data/crypto_data_perp"
35-
qlib.init(provider_uri=PROVIDER_URI, kernels=1)
36+
# Use crypto-specific region to align trading rules/calendars with provider data
37+
qlib.init(provider_uri=PROVIDER_URI, region=REG_CRYPTO, kernels=1)
3638

3739
# Auto-select benchmark by data source: cn_data -> SH000300; crypto -> BTCUSDT
3840
# Fallback: if path not resolvable, default to SH000300 for safety

qlib/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def register_from_C(config, skip_register=True):
275275
# serversS(such as PAI) [auto_mount:True]
276276
"timeout": 100,
277277
"logging_level": logging.INFO,
278-
"region": REG_CRYPTO,
278+
"region": REG_CN,
279279
# custom operator
280280
# each element of custom_ops should be Type[ExpressionOps] or dict
281281
# if element of custom_ops is Type[ExpressionOps], it represents the custom operator class

0 commit comments

Comments
 (0)