{"Description":"实验创建于2017/8/26","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-539:input_1","SourceOutputPortId":"-185:data"},{"DestinationInputPortId":"-27:input_ds","SourceOutputPortId":"-185:data"}],"ModuleNodes":[{"Id":"-539","ModuleId":"BigQuantSpace.cached.cached-v3","ModuleParameters":[{"Name":"run","Value":"# 修改数据列名\ndef bigquant_run(input_ds, columns, keep_old_columns):\n # 解析列映射为dict, TODO: 验证输入是否有效\n columns = dict(c.split(':') for c in columns.split('|'))\n print('列名映射:', columns)\n # 输出数据源\n dataset_ds = DataSource()\n output_store = dataset_ds.open_df_store()\n\n for key, df in input_ds.iter_df():\n old_column_set = set(df.columns)\n for old_col, new_col in columns.items():\n if old_col not in old_column_set:\n print('警告:列 %s 不存在' % old_col)\n if keep_old_columns:\n for old_col, new_col in columns.items():\n if old_col in old_column_set:\n df[new_col] = df[old_col]\n else:\n df.columns = [columns.get(c, c) for c in df.columns]\n df.to_hdf(output_store, key)\n row_count = len(df)\n print('%s: %s' % (key, len(df)))\n\n dataset_ds.close_df_store()\n return Outputs(data=dataset_ds)\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"post_run","Value":"# 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。\ndef bigquant_run(outputs):\n return outputs\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"input_ports","Value":"input_ds","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"params","Value":"{\n 'columns': 'deal_number:new_deal_number|close:new_close',\n 'keep_old_columns': true\n}\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"output_ports","Value":"data","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_1","NodeId":"-539"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_2","NodeId":"-539"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_3","NodeId":"-539"}],"OutputPortsInternal":[{"Name":"data_1","NodeId":"-539","OutputType":null},{"Name":"data_2","NodeId":"-539","OutputType":null},{"Name":"data_3","NodeId":"-539","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":19,"Comment":"","CommentCollapsed":true},{"Id":"-185","ModuleId":"BigQuantSpace.use_datasource.use_datasource-v1","ModuleParameters":[{"Name":"datasource_id","Value":"bar1d_CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"start_date","Value":"2018-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2018-02-01","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-185"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-185"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-185","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":4,"Comment":"","CommentCollapsed":true},{"Id":"-27","ModuleId":"BigQuantSpace.rename_columns.rename_columns-v5","ModuleParameters":[{"Name":"columns","Value":"deal_number:new_deal_number|close:new_close","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"keep_old_columns","Value":"True","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_ds","NodeId":"-27"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-27","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"Comment":"","CommentCollapsed":true}],"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions><NodePosition Node='-539' Position='1354.393310546875,116.22413635253906,200,200'/><NodePosition Node='-185' Position='1235,-3,200,200'/><NodePosition Node='-27' Position='1143.0780639648438,236.81643676757812,200,200'/></NodePositions><NodeGroups /></DataV1>"},"IsDraft":true,"ParentExperimentId":null,"WebService":{"IsWebServiceExperiment":false,"Inputs":[],"Outputs":[],"Parameters":[{"Name":"交易日期","Value":"","ParameterDefinition":{"Name":"交易日期","FriendlyName":"交易日期","DefaultValue":"","ParameterType":"String","HasDefaultValue":true,"IsOptional":true,"ParameterRules":[],"HasRules":false,"MarkupType":0,"CredentialDescriptor":null}}],"WebServiceGroupId":null,"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions></NodePositions><NodeGroups /></DataV1>"},"DisableNodesUpdate":false,"Category":"user","Tags":[],"IsPartialRun":true}
[2018-08-03 23:51:05.884144] INFO: bigquant: use_datasource.v1 开始运行..
[2018-08-03 23:51:06.072156] INFO: bigquant: 命中缓存
[2018-08-03 23:51:06.082901] INFO: bigquant: use_datasource.v1 运行完成[0.198757s].
[2018-08-03 23:51:06.097946] INFO: bigquant: rename_columns.v5 开始运行..
列名映射: {'close': 'new_close', 'deal_number': 'new_deal_number'}
/data: 80837
[2018-08-03 23:51:06.563193] INFO: bigquant: rename_columns.v5 运行完成[0.465224s].