curr version

main
yz 2 years ago
parent b94beef451
commit 1c2b234d66

File diff suppressed because it is too large Load Diff

@ -477,12 +477,92 @@
"len(all_init)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"WS\n",
"RO\n",
"WT\n",
"ER\n",
"TC\n",
"ME\n"
]
}
],
"source": [
"for ci in ci_all:\n",
" if ci not in all_init:\n",
" print(ci)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"import code_list_all_pkl"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": []
"source": [
"from src.code_list_all_pkl import code_list as code_list_pickel_from_file\n",
"ci_all = set([c[:-4] for c in code_list_pickel_from_file])"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"77"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(ci_all)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'LR', 'TF', 'cu', 'nr', 'zn', 'zn2310 on 20200323 in TickPartiti'}"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cl=\"LR2003+LR2005+LR2007+LR2011+LR2101+LR2103+LR2105+LR2107+LR2109+LR2111+LR2201+LR2203+LR2205+LR2207+LR2209+LR2211+LR2301+LR2303+LR2305+LR2307+LR2309+LR2311+TF2003+TF2006+TF2009+TF2012+TF2103+TF2106+TF2109+TF2112+TF2203+TF2206+TF2209+TF2212+TF2303+TF2306+cu2002+cu2003+cu2004+cu2005+cu2006+cu2007+cu2008+cu2009+cu2010+cu2011+cu2012+cu2101+cu2102+cu2103+cu2104+cu2105+cu2106+cu2107+cu2108+cu2109+cu2110+cu2111+cu2112+cu2201+cu2202+cu2203+cu2204+cu2205+cu2206+cu2207+cu2208+cu2209+cu2210+cu2211+cu2212+cu2301+cu2302+cu2303+cu2304+cu2305+cu2306+cu2307+cu2308+cu2309+cu2310+nr2002+nr2003+nr2004+nr2005+nr2006+nr2007+nr2008+nr2009+nr2010+nr2011+nr2012+nr2101+nr2102+nr2103+nr2104+nr2105+nr2106+nr2107+nr2108+nr2109+nr2110+nr2111+nr2112+nr2201+nr2202+nr2203+nr2204+nr2205+nr2206+nr2207+nr2208+nr2209+nr2210+nr2211+nr2212+nr2301+nr2302+nr2303+nr2304+nr2305+nr2306+nr2307+nr2308+nr2309+nr2310+zn2002+zn2003+zn2004+zn2005+zn2006+zn2007+zn2008+zn2009+zn2010+zn2011+zn2012+zn2101+zn2102+zn2103+zn2104+zn2105+zn2106+zn2107+zn2108+zn2109+zn2110+zn2111+zn2112+zn2201+zn2202+zn2203+zn2204+zn2205+zn2206+zn2207+zn2208+zn2209+zn2210+zn2211+zn2212+zn2301+zn2302+zn2303+zn2304+zn2305+zn2306+zn2307+zn2308+zn2309+zn2310 on 20200323 in TickPartitioned\"\n",
"set([c[:-4] for c in cl.split(\"+\")])\n"
]
},
{
"cell_type": "code",
@ -3018,7 +3098,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.9.2"
},
"orig_nbformat": 4,
"vscode": {

@ -143,9 +143,15 @@ def run():
run_add_1day_code_init_minKline(date, code_list)
def run_pool_dates_by_code_init_n_group(typ='mink', code_gp_amt=10, date_gp_amt=10, start_date='20220101', end_date='20221031', if_check=1, code_dict_by='init'):
def run_pool_dates_by_code_init_n_group(typ='mink', code_gp_amt=10, date_gp_amt=10, start_date='20220101', end_date='20221031', if_check=1, code_dict_by='init',keep_code_init_list=[]):
logger.info("Running run_pool_dates_by_group")
code_list_pickel=code_list_pickel_from_file
code_list_pickel_raw=code_list_pickel_from_file
code_list_pickel=code_list_pickel_raw
if len(keep_code_init_list)>0:
code_list_pickel = []
for i in code_list_pickel_raw:
if i[:2] in keep_code_init_list:
code_list_pickel.append(i)
code_list_pickel=sorted(list(set(code_list_pickel)))
all_code_dict_by_init = {}
for c in code_list_pickel:
@ -223,22 +229,24 @@ if __name__ == '__main__':
if_check=int(if_check)
split_code_into_howmany_groups_no = int(split_code_into_howmany_groups_no)
split_date_into_howmany_groups=int(split_date_into_howmany_groups)
keep_code_init_list=[]
else:
typ = 'tick'
st_d = '20211201'
en_d = '20211231'
st_d = '20200401'
en_d = '20200531'
if_check = 1
split_code_into_howmany_groups_no = 20
split_date_into_howmany_groups = 5
split_code_into_howmany_groups_no = 15
split_date_into_howmany_groups = 15
keep_code_init_list = ['PF', 'WH', 'fb', 'pg']
logger.add(ROOT_DIR+"/logs/{time:YYYYMMDD-HHmmss}"+f"_{running_which_env}_{typ}_{st_d}_{en_d}_{if_check}_{split_code_into_howmany_groups_no}_{split_date_into_howmany_groups}.log",
rotation="10 MB", compression="zip", level="INFO")
logger.warning(
f"Going to run *{typ}* from {st_d} to {en_d} with if_check dupliactes={if_check} in *{running_which_env}*, plz check if this info is correct.\n\n\n\n")
f"Going to run {'+'.join(keep_code_init_list)} *{typ}* from {st_d} to {en_d} with if_check dupliactes={if_check} in *{running_which_env}*, plz check if this info is correct.\n\n\n\n")
run_pool_dates_by_code_init_n_group(typ=typ, code_gp_amt=split_code_into_howmany_groups_no,
date_gp_amt=split_date_into_howmany_groups, start_date=st_d, end_date=en_d, if_check=if_check, code_dict_by='group')
date_gp_amt=split_date_into_howmany_groups, start_date=st_d, end_date=en_d, if_check=if_check, code_dict_by='group',keep_code_init_list=keep_code_init_list)
# run_pool_dates_by_code_init_n_group(typ='mink',group_amount=5)
toc = time.perf_counter()

Loading…
Cancel
Save