Commit eeb3bfc2 authored by 桂秋月's avatar 桂秋月

1

parent 1b52af81
......@@ -6,7 +6,10 @@
<component name="ChangeListManager">
<list default="true" id="65ec9bc1-9334-4fb0-a73d-621c8e760de6" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/model_data_test/settings.py" beforeDir="false" afterPath="$PROJECT_DIR$/model_data_test/settings.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/2022-02-09.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/2022-02-09.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/model_data_api/handler/Automatic_Handler.py" beforeDir="false" afterPath="$PROJECT_DIR$/model_data_api/handler/Automatic_Handler.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/model_data_api/handler/logic.py" beforeDir="false" afterPath="$PROJECT_DIR$/model_data_api/handler/logic.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/model_data_api/model/base_model.py" beforeDir="false" afterPath="$PROJECT_DIR$/model_data_api/model/base_model.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......
This diff is collapsed.
......@@ -23,35 +23,35 @@ class AutomaticHandler(BaseHandler):
self.auto_feature = []
self.auto_dataset = {"data_basic":{"model_name":self.model_name,"count":self.user_count},
"data_detail":[]}
#try :
url = 'http://rc-model-exec.quantgroups.com/manage/features'
r = requests.post(url,data={'codes':self.model_name})
if r.status_code == 200:
response = r.json()
self.feature_name = response['data'][self.model_name]['new']+response['data'][self.model_name]['old']
print('获取模型新旧数据:',self.feature_name)
result = self.get_auto()
self.write(JsonUtil.build_json_data(code=result['code'],
message=result['message'],
result = result['result'],
json_path = result['json_path']
try :
url = 'http://rc-model-exec.quantgroups.com/manage/features'
r = requests.post(url,data={'codes':self.model_name})
if r.status_code == 200:
response = r.json()
self.feature_name = response['data'][self.model_name]['new']+response['data'][self.model_name]['old']
print('获取模型新旧数据:',self.feature_name)
result = self.get_auto()
self.write(JsonUtil.build_json_data(code=result['code'],
message=result['message'],
result = result['result'],
json_path = result['json_path']
))
self.flush()
self.finish()
except:
self.write(JsonUtil.build_json_data(code=500,
message="特征列表获取失败",
result = [],
json_path = ''
))
self.flush()
self.finish()
else:
self.write(JsonUtil.build_json_data(code=JsonUtil.Constants.Code_Param_Error,
message=JsonUtil.Constants.Msg_Param_Error
))
self.flush()
self.finish()
# except:
# self.write(JsonUtil.build_json_data(code=500,
# message="特征列表获取失败",
# result = [],
# json_path = ''
# ))
# self.flush()
# self.finish()
# else:
# self.write(JsonUtil.build_json_data(code=JsonUtil.Constants.Code_Param_Error,
# message=JsonUtil.Constants.Msg_Param_Error
# ))
# self.flush()
# self.finish()
def get_auto(self):
modelsData = ModelsDataManager()
......
......@@ -178,7 +178,7 @@ def add_userTest_logic(session,file_path,common,count,isTrue=True):
if not isTrue:
_df_result['batch_uuid'] = _df_result['batch_uuid'] .apply(lambda x : hashlib.md5(str(datetime.datetime.now()).encode(encoding='UTF-8')).hexdigest())
else:
uuid_path=get_path(common,'DATA','uuid1.csv')
uuid_path=get_path(common,'DATA','uuid.csv')
temp_uuid=pd.read_csv(uuid_path,encoding='utf-8')['uuid']
_df_result['batch_uuid']=temp_uuid[:int(count)]
# print('uuid==',_df_result['batch_uuid'])
......
......@@ -62,18 +62,18 @@ class BaseManager:
def get_json(self,result):
logging.info('base result:'+str(result)+str(type(result)))
#try:
if isinstance(result, Iterable):
tmp = [dict(zip(res.__dict__.keys(), res.__dict__.values())) for res in result]
for t in tmp:
t.pop('_sa_instance_state')
else:
tmp = dict(zip(result.__dict__.keys(), result.__dict__.values()))
tmp.pop('_sa_instance_state')
return tmp
# except BaseException as e:
# print(e.args)
# raise TypeError('Type error of parameter')
try:
if isinstance(result, Iterable):
tmp = [dict(zip(res.__dict__.keys(), res.__dict__.values())) for res in result]
for t in tmp:
t.pop('_sa_instance_state')
else:
tmp = dict(zip(result.__dict__.keys(), result.__dict__.values()))
tmp.pop('_sa_instance_state')
return tmp
except BaseException as e:
print(e.args)
raise TypeError('Type error of parameter')
# def __default__(self,obj):
# if isinstance(obj, datetime):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment