Exemple #1
0
    def __do_the_stats(self):
        '''周期性调用'''

        file_list = program_top.utilities.my_dir.browse_dir(
            self._input_directory, '.csv')

        fail_file_filter = lambda x: (x.__contains__('fail') and x.
                                      __contains__('total'))
        pure_file_fileter = lambda x: (x.__contains__('reserve') and x.
                                       __contains__('total'))

        fail_file_list = filter(fail_file_filter, file_list)
        pure_file_list = filter(pure_file_fileter, file_list)

        self._clear_up_before_data_update()

        self._failure_total_data = DataFrame.from_csv(fail_file_list[0])
        self._reservation_total_data = DataFrame.from_csv(pure_file_list[0])
        self._total_reservation_count = self._reservation_total_data.sum(
            numeric_only=True).values.tolist()[0]

        keys_of_interest = ['supplier', 'channel', 'hotel_supplier']
        value_key = 'sum_count'
        total_supplier_lists = self._reservation_total_data['supplier'].unique(
        ).tolist()
        self._active_hotel_counts = hotel_searcher_ref.get_active_hotel_lists(
            total_supplier_lists)

        self._get_two_key_vs_failure_rate(keys_of_interest[0],
                                          keys_of_interest[1],
                                          value_key=value_key)
        self._get_two_key_vs_importance_panel(keys_of_interest[0],
                                              keys_of_interest[1],
                                              value_key=value_key)
        self._output_two_key_vs_caution_score(keys_of_interest[0],
                                              keys_of_interest[1],
                                              value_key=value_key)

        #self._output_altitude_plot(keys_of_interest[0], keys_of_interest[1], self._double_key_failure_rate_panels[keys_of_interest[0], keys_of_interest[1]])

        for each_key in keys_of_interest:
            self._output_failure_rate_of_each_key(each_key, keys_of_interest,
                                                  value_key)
            self._get_reservation_importance(each_key, keys_of_interest,
                                             value_key)
            self._output_caution_score_of_each_key(each_key, keys_of_interest,
                                                   value_key)
            pass

        #self._output_failure_rate_vs_reservation_scattered_point_plot(keys_of_interest[2])
        #self._output_caution_score_vs_reservation_importance_scattered_point_plot(keys_of_interest[2])
        #self._cut_data_into_categorical_group(keys_of_interest[2],'failure_rate',50,self._failure_rate_panels[keys_of_interest[2]])
        #self._cut_data_into_categorical_group(keys_of_interest[2],'caution_score',50,self._caution_score_panel[keys_of_interest[2]])
        self._write_logs('订单失误和警告分数统计完成')
        from program_top.utilities.process_and_main_function.my_engine import my_engine
        from components.standalone_working_class.working_type_base.backend_interface_base.s3_gate_uploader import s3_gate_uploader
        my_engine(s3_gate_uploader)  #创建一个s3上传数据的实例
        pass
Exemple #2
0
def main_function(running_class_def=None):
	'''主函数,传入开始执行的主函数,然后以指定的类作为起始工作实例,为单实例机器的程序入口'''
	a=my_engine(running_class_def)
	#b=my_engine(running_class_def)
	
	IOLoop.current().start()
	pass
Exemple #3
0
def load_instances(current_environment_pack):
    '''这里负责启动所有要工作的进程'''

    current_working_instances = {
        'ma_stupid_multi_contract':
        my_engine(ma_stupid_multi_contract, current_environment_pack)
    }

    return current_working_instances
	def __do_the_stats(self):
		'''周期性调用'''

		file_list=program_top.utilities.my_dir.browse_dir(self._input_directory, '.csv')

		fail_file_filter=lambda x: (x.__contains__('fail') and x.__contains__('total'))
		pure_file_fileter=lambda x: (x.__contains__('reserve') and x.__contains__('total'))

		fail_file_list=filter(fail_file_filter, file_list)
		pure_file_list=filter(pure_file_fileter, file_list)

		self._clear_up_before_data_update()

		self._failure_total_data=DataFrame.from_csv(fail_file_list[0])
		self._reservation_total_data=DataFrame.from_csv(pure_file_list[0])
		self._total_reservation_count=self._reservation_total_data.sum(numeric_only=True).values.tolist()[0]

		keys_of_interest=['supplier','channel','hotel_supplier']
		value_key='sum_count'
		total_supplier_lists=self._reservation_total_data['supplier'].unique().tolist()
		self._active_hotel_counts=hotel_searcher_ref.get_active_hotel_lists(total_supplier_lists)

		self._get_two_key_vs_failure_rate(keys_of_interest[0], keys_of_interest[1], value_key=value_key)
		self._get_two_key_vs_importance_panel(keys_of_interest[0], keys_of_interest[1], value_key=value_key)
		self._output_two_key_vs_caution_score(keys_of_interest[0], keys_of_interest[1], value_key=value_key)

		#self._output_altitude_plot(keys_of_interest[0], keys_of_interest[1], self._double_key_failure_rate_panels[keys_of_interest[0], keys_of_interest[1]])

		for each_key in keys_of_interest:
			self._output_failure_rate_of_each_key(each_key, keys_of_interest, value_key)
			self._get_reservation_importance(each_key,keys_of_interest,value_key)
			self._output_caution_score_of_each_key(each_key, keys_of_interest, value_key)
			pass

		#self._output_failure_rate_vs_reservation_scattered_point_plot(keys_of_interest[2])
		#self._output_caution_score_vs_reservation_importance_scattered_point_plot(keys_of_interest[2])
		#self._cut_data_into_categorical_group(keys_of_interest[2],'failure_rate',50,self._failure_rate_panels[keys_of_interest[2]])
		#self._cut_data_into_categorical_group(keys_of_interest[2],'caution_score',50,self._caution_score_panel[keys_of_interest[2]])
		self._write_logs('订单失误和警告分数统计完成')
		from program_top.utilities.process_and_main_function.my_engine import my_engine
		from program_top.components import s3_gate_uploader
		my_engine(s3_gate_uploader)#创建一个s3上传数据的实例
		pass