cnhkmcp 2.3.2__py3-none-any.whl → 2.3.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cnhkmcp/__init__.py +1 -1
- cnhkmcp/untracked/AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221/BRAIN_AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221Mac_Linux/321/207/320/231/320/230/321/206/320/254/320/274.zip +0 -0
- cnhkmcp/untracked/AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221//321/205/320/237/320/234/321/205/320/227/342/225/227/321/205/320/276/320/231/321/210/320/263/320/225AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221_Windows/321/207/320/231/320/230/321/206/320/254/320/274.exe +0 -0
- cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/main.py +7 -0
- cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242//321/211/320/266/320/246/321/206/320/274/320/261/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +8 -0
- cnhkmcp/untracked/APP/ace_lib.py +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/ace.log +1 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/output_report/GLB_delay1_fundamental28_ideas.md +384 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/final_expressions.json +41 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874844124598400.json +7 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874844589448700.json +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874845048996700.json +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874845510819100.json +12 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874845978315000.json +10 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874846459411100.json +10 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874846924915700.json +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874847399137200.json +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874847858960800.json +10 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874848327921300.json +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874848810818000.json +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874849327754300.json +7 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874849795807500.json +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874850272279500.json +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874850757124200.json +7 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_1_idea_1769874851224506800.json +8 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental28_GLB_delay1/fundamental28_GLB_delay1.csv +930 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/ace.log +1 -0
- cnhkmcp/untracked/APP//321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +8 -0
- cnhkmcp/untracked/arxiv_api.py +7 -0
- cnhkmcp/untracked/back_up/forum_functions.py +8 -0
- cnhkmcp/untracked/forum_functions.py +8 -0
- cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/forum_functions.py +8 -0
- cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/platform_functions.py +8 -1
- cnhkmcp/untracked/platform_functions.py +7 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/.gitignore +14 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/SKILL.md +76 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/ace.log +0 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/ace_lib.py +1512 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/config.json +6 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/fundamental28_GLB_1_idea_1769874845978315000.json +10 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/helpful_functions.py +180 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/scripts/__init__.py +0 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/scripts/build_alpha_list.py +86 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/scripts/fetch_sim_options.py +51 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/scripts/load_credentials.py +93 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/scripts/parse_idea_file.py +85 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/scripts/process_template.py +80 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/scripts/resolve_settings.py +94 -0
- cnhkmcp/untracked/skills/brain-inspectTemplate-create-Setting/sim_options_snapshot.json +414 -0
- cnhkmcp/untracked//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +8 -0
- {cnhkmcp-2.3.2.dist-info → cnhkmcp-2.3.4.dist-info}/METADATA +1 -1
- {cnhkmcp-2.3.2.dist-info → cnhkmcp-2.3.4.dist-info}/RECORD +56 -22
- {cnhkmcp-2.3.2.dist-info → cnhkmcp-2.3.4.dist-info}/WHEEL +0 -0
- {cnhkmcp-2.3.2.dist-info → cnhkmcp-2.3.4.dist-info}/entry_points.txt +0 -0
- {cnhkmcp-2.3.2.dist-info → cnhkmcp-2.3.4.dist-info}/licenses/LICENSE +0 -0
- {cnhkmcp-2.3.2.dist-info → cnhkmcp-2.3.4.dist-info}/top_level.txt +0 -0
|
@@ -7,6 +7,14 @@ A complete web application for decoding string templates with WorldQuant BRAIN i
|
|
|
7
7
|
import subprocess
|
|
8
8
|
import sys
|
|
9
9
|
import os
|
|
10
|
+
import io
|
|
11
|
+
|
|
12
|
+
# try set gbk problem
|
|
13
|
+
try:
|
|
14
|
+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
15
|
+
except Exception as e:
|
|
16
|
+
print(e)
|
|
17
|
+
pass
|
|
10
18
|
|
|
11
19
|
def install_requirements():
|
|
12
20
|
"""Install required packages from requirements.txt if they're missing"""
|
cnhkmcp/untracked/arxiv_api.py
CHANGED
|
@@ -3,6 +3,13 @@ import xml.etree.ElementTree as ET
|
|
|
3
3
|
import os
|
|
4
4
|
import sys
|
|
5
5
|
import argparse
|
|
6
|
+
import io
|
|
7
|
+
# try set gbk problem
|
|
8
|
+
try:
|
|
9
|
+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
10
|
+
except Exception as e:
|
|
11
|
+
print(e)
|
|
12
|
+
pass
|
|
6
13
|
|
|
7
14
|
def search_arxiv(query, max_results=10):
|
|
8
15
|
"""Search arXiv for papers"""
|
|
@@ -22,6 +22,14 @@ from selenium.common.exceptions import TimeoutException, NoSuchElementException
|
|
|
22
22
|
import requests
|
|
23
23
|
import os
|
|
24
24
|
import shutil
|
|
25
|
+
import io
|
|
26
|
+
|
|
27
|
+
# try set gbk problem
|
|
28
|
+
try:
|
|
29
|
+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
30
|
+
except Exception as e:
|
|
31
|
+
print(e)
|
|
32
|
+
pass
|
|
25
33
|
|
|
26
34
|
# Initialize forum MCP server
|
|
27
35
|
try:
|
|
@@ -15,6 +15,14 @@ from bs4 import BeautifulSoup
|
|
|
15
15
|
from playwright.async_api import async_playwright
|
|
16
16
|
import requests
|
|
17
17
|
import os
|
|
18
|
+
import io
|
|
19
|
+
|
|
20
|
+
# try set gbk problem
|
|
21
|
+
try:
|
|
22
|
+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
23
|
+
except Exception as e:
|
|
24
|
+
print(e)
|
|
25
|
+
pass
|
|
18
26
|
|
|
19
27
|
def log(message: str, level: str = "INFO"):
|
|
20
28
|
"""Log message with timestamp."""
|
|
@@ -15,6 +15,14 @@ from bs4 import BeautifulSoup
|
|
|
15
15
|
from playwright.async_api import async_playwright
|
|
16
16
|
import requests
|
|
17
17
|
import os
|
|
18
|
+
import io
|
|
19
|
+
|
|
20
|
+
# try set gbk problem
|
|
21
|
+
try:
|
|
22
|
+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
23
|
+
except Exception as e:
|
|
24
|
+
print(e)
|
|
25
|
+
pass
|
|
18
26
|
|
|
19
27
|
def log(message: str, level: str = "INFO"):
|
|
20
28
|
"""Log message with timestamp."""
|
|
@@ -18,7 +18,7 @@ import os
|
|
|
18
18
|
import sys
|
|
19
19
|
import math
|
|
20
20
|
from time import sleep
|
|
21
|
-
|
|
21
|
+
import io
|
|
22
22
|
import requests
|
|
23
23
|
import pandas as pd
|
|
24
24
|
from mcp.server.fastmcp import FastMCP
|
|
@@ -29,6 +29,13 @@ from pathlib import Path
|
|
|
29
29
|
# Import the new forum client
|
|
30
30
|
from forum_functions import forum_client
|
|
31
31
|
|
|
32
|
+
# try set gbk problem
|
|
33
|
+
try:
|
|
34
|
+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
35
|
+
except Exception as e:
|
|
36
|
+
print(e)
|
|
37
|
+
pass
|
|
38
|
+
|
|
32
39
|
# Configure logging
|
|
33
40
|
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
34
41
|
logger = logging.getLogger(__name__)
|
|
@@ -18,6 +18,13 @@ import os
|
|
|
18
18
|
import sys
|
|
19
19
|
import math
|
|
20
20
|
from time import sleep
|
|
21
|
+
import io
|
|
22
|
+
# try set gbk problem
|
|
23
|
+
try:
|
|
24
|
+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
25
|
+
except Exception as e:
|
|
26
|
+
print(e)
|
|
27
|
+
pass
|
|
21
28
|
|
|
22
29
|
import requests
|
|
23
30
|
import pandas as pd
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brain-inspecttemplate-create-setting
|
|
3
|
+
description: >-
|
|
4
|
+
Reads a BRAIN template/idea JSON (template/idea/expression_list) like
|
|
5
|
+
fundamental28_GLB_1_idea_<timestamp>.json, fetches valid simulation setting options
|
|
6
|
+
via ace_lib.get_instrument_type_region_delay, resolves region/delay/universe/neutralization,
|
|
7
|
+
and builds an Alpha list JSON (one Alpha per expression) using ace_lib.generate_alpha.
|
|
8
|
+
Use when user asks to inspect template files, attach settings, create alpha list, or validate settings.
|
|
9
|
+
user-invocable: true
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# brain-inspectTemplate-create-Setting
|
|
13
|
+
|
|
14
|
+
This skill is designed for *stable, repeatable runs*.
|
|
15
|
+
|
|
16
|
+
## Deterministic vs AI responsibilities
|
|
17
|
+
|
|
18
|
+
Deterministic (scripts):
|
|
19
|
+
- **Entry Point**: `scripts/process_template.py` handles the initial flow (Part 1).
|
|
20
|
+
- **Part 1 Output**: `settings_candidates.json` containing valid platform options for the detected Region/Delay.
|
|
21
|
+
- **Part 2 Output**: `alpha_list.json` (generated iteratively by AI).
|
|
22
|
+
|
|
23
|
+
AI reasoning (Critical Step):
|
|
24
|
+
- **Input**: The AI must read `idea_context.json` (to understand intent) AND `settings_candidates.json` (to see valid options).
|
|
25
|
+
- **Loop**: The AI can decide on **multiple** setting combinations if the idea is ambiguous or worth testing broadly.
|
|
26
|
+
- e.g., Run 1: `Universe=TOP3000`, `Neutralization=INDUSTRY`
|
|
27
|
+
- e.g., Run 2: `Universe=TOPDIV3000`, `Neutralization=MARKET`
|
|
28
|
+
- **Action**: For EACH chosen setting, call `scripts/build_alpha_list.py` passing the settings as a JSON string.
|
|
29
|
+
- The script will **APPEND** to `alpha_list.json`, allowing comprehensive test coverage.
|
|
30
|
+
|
|
31
|
+
## Config / credentials check (startup)
|
|
32
|
+
|
|
33
|
+
To connect to BRAIN API (only needed for fetching sim options), provide credentials via one of:
|
|
34
|
+
1) Environment variables: `BRAIN_USERNAME` (or `BRAIN_EMAIL`) and `BRAIN_PASSWORD`
|
|
35
|
+
2) `config.json` next to this file (see `config.example.json`)
|
|
36
|
+
3) `~/secrets/platform-brain.json` (keys: `email`/`password`)
|
|
37
|
+
|
|
38
|
+
Never commit real credentials. Keep `config.json` local.
|
|
39
|
+
|
|
40
|
+
## Run steps
|
|
41
|
+
|
|
42
|
+
**Important**: Always navigate to the skill directory first, as scripts rely on relative paths.
|
|
43
|
+
|
|
44
|
+
### One-click Processing (Recommended)
|
|
45
|
+
1. **Navigate to skill folder**:
|
|
46
|
+
`cd "path/to/brain-inspectTemplate-create-Setting"`
|
|
47
|
+
|
|
48
|
+
2. **Run wrapper script**:
|
|
49
|
+
Use the wrapper script to generate all artifacts in a dedicated folder (e.g., `processed_templates/<filename>/`).
|
|
50
|
+
|
|
51
|
+
`C:/Python313/python.exe scripts/process_template.py --file <absolute_path_to_input_json>`
|
|
52
|
+
|
|
53
|
+
*Example*:
|
|
54
|
+
`C:/Python313/python.exe scripts/process_template.py --file "C:/Users/user/Downloads/fundamental28_GLB_1_idea_...json"`
|
|
55
|
+
|
|
56
|
+
This will:
|
|
57
|
+
1. Parse the idea file.
|
|
58
|
+
2. Fetch simulation options (if `sim_options_snapshot.json` missing in root).
|
|
59
|
+
3. Resolve settings.
|
|
60
|
+
4. Generate the Alpha list.
|
|
61
|
+
|
|
62
|
+
### Manual Steps (Debug)
|
|
63
|
+
|
|
64
|
+
From this folder:
|
|
65
|
+
|
|
66
|
+
1) Parse idea JSON
|
|
67
|
+
- `C:/Python313/python.exe scripts/parse_idea_file.py --input fundamental28_GLB_1_idea_1769874845978315000.json --out idea_context.json`
|
|
68
|
+
|
|
69
|
+
2) Fetch sim options snapshot (requires credentials)
|
|
70
|
+
- `C:/Python313/python.exe scripts/fetch_sim_options.py --out sim_options_snapshot.json`
|
|
71
|
+
|
|
72
|
+
3) Resolve settings
|
|
73
|
+
- `C:/Python313/python.exe scripts/resolve_settings.py --idea idea_context.json --options sim_options_snapshot.json --out resolved_settings.json`
|
|
74
|
+
|
|
75
|
+
4) Build alpha list
|
|
76
|
+
- `C:/Python313/python.exe scripts/build_alpha_list.py --idea idea_context.json --settings resolved_settings.json --out alpha_list.json`
|
|
File without changes
|