# Path: kquant_data/processing/merge.py
# def merge_weight(rule, wind_code, dataset_name):
#     """
#     合并一级文件夹
#     :param rule:
#     :param sector_name:
#     :param dataset_name:
#     :return:
#     """
#     path = os.path.join(__CONFIG_H5_STK_DIR__, rule, 'Symbol.csv')
#     symbols = all_instruments(path)
# 
#     path = os.path.join(__CONFIG_H5_STK_DIR__, rule, 'DateTime.csv')
#     DateTime = get_datetime(path)
# 
#     df = merge_weight_internal(symbols, DateTime, wind_code)
# 
#     path = os.path.join(__CONFIG_H5_STK_DIR__, rule, "%s.h5" % dataset_name)
#     write_dataframe_set_dtype_remove_head(path, df, None, dataset_name)
# 
#     toc()


from kquant_data.processing.merge import merge_weight
﻿#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
全市场计算权重
"""



def merge_weight_000300():
    rule = '1day'
    wind_code = '000300.SH'
    merge_weight(rule, wind_code, 'weight')


def merge_weight_000016():
    rule = '1day'
    wind_code = '000016.SH'

# Path: kquant_data/processing/merge.py
# def merge_weight(rule, wind_code, dataset_name):
#     """
#     合并一级文件夹
#     :param rule:
#     :param sector_name:
#     :param dataset_name:
#     :return:
#     """
#     path = os.path.join(__CONFIG_H5_STK_DIR__, rule, 'Symbol.csv')
#     symbols = all_instruments(path)
# 
#     path = os.path.join(__CONFIG_H5_STK_DIR__, rule, 'DateTime.csv')
#     DateTime = get_datetime(path)
# 
#     df = merge_weight_internal(symbols, DateTime, wind_code)
# 
#     path = os.path.join(__CONFIG_H5_STK_DIR__, rule, "%s.h5" % dataset_name)
#     write_dataframe_set_dtype_remove_head(path, df, None, dataset_name)
# 
#     toc()


# Path: demo_stock/A_1day/E02_merge_indexconstituent.py
from kquant_data.processing.merge import merge_weight

﻿#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
全市场计算权重
"""



def merge_weight_000300():
    rule = '1day'
    wind_code = '000300.SH'
    merge_weight(rule, wind_code, 'weight')


def merge_weight_000016():
    rule = '1day'
    wind_code = '000016.SH'

    merge_weight(rule, wind_code, 'weight')