def then_one_hr_t(result: dict, note: str): """ check the relative error of the a hour fire size""" check_metric('1 HR Size t', result['fuel_type'], result['python'].sixty_minute_fire_size_t, result['expected']['area'], fire_size_acceptable_margin_of_error, note)
def then_hfi_t(result: dict, note: str): """ check the relative error of the ros """ check_metric('HFI_t', result['fuel_type'], result['python'].hfi_t, result['expected']['hfi'], acceptable_margin_of_error, note)
def then_cfb_good(results: list, cfb_margin_of_error: float): """ check the relative error of HFI """ for index, result in enumerate(results): error = check_metric('CFB', result['fuel_type'], result['python'].cfb * 100.0, result['java'].cfb, cfb_margin_of_error, f'({index})') result['error']['cfb_margin_of_error'] = error
def then_hfi_good(results: list, hfi_margin_of_error: float): """ check the relative error of HFI """ for index, result in enumerate(results): error = check_metric('HFI', result['fuel_type'], result['python'].hfi, result['java'].hfi, hfi_margin_of_error, f'({index})') result['error']['hfi_margin_of_error'] = error
def then_1_hour_spread_good(results: list, one_hour_spread_margin_of_error: float): """ check the relative error of HFI """ for index, result in enumerate(results): error = check_metric('one_hour_size', result['fuel_type'], result['python'].sixty_minute_fire_size, result['java'].area, one_hour_spread_margin_of_error, f'({index})') result['error']['one_hour_spread_margin_of_error'] = error
def then_one_hr(result: dict, one_hr_em: float, note: str): """ check the relative error of the a hour fire size""" error = check_metric('1 HR Size', result['fuel_type'], result['python'].sixty_minute_fire_size, result['expected']['area'], one_hr_em, note) result['error']['one_hr_em'] = error
def then_hfi(result: dict, hfi_em: float, note: str): """ check the relative error of the hfi """ error = check_metric('HFI', result['fuel_type'], result['python'].hfi, result['expected']['hfi'], hfi_em, note) result['error']['hfi_em'] = error
def then_cfb(result: dict, cfb_em: float, note: str): """ check the relative error of the cfb """ error = check_metric('CFB', result['fuel_type'], result['python'].cfb, result['expected']['cfb'], cfb_em, note) result['error']['cfb_em'] = error
def then_ros(result: dict, ros_em: float, note: str): """ check the relative error of the ros """ error = check_metric('ROS', result['fuel_type'], result['python'].ros, result['expected']['ros'], ros_em, note) result['error']['ros_em'] = error
def then_ros_good(results: list, ros_margin_of_error: float): """ check the relative error of ROS """ for index, result in enumerate(results): wind_speed = result['input']['wind_speed'] ffmc = result['input']['ffmc'] isi = result['input']['isi'] bui = result['input']['bui'] java_isi = result['java'].isi # assumptions: # ros_eq == ROScalc # ros_t == ROStcalc error = check_metric( 'ROS', result['fuel_type'], result['python'].ros, result['java'].ros_eq, ros_margin_of_error, f"""({index}) input- isi:{isi}; bui:{bui}; wind_speed:{wind_speed}; ffmc:{ffmc}; """ f"""java - isi:{java_isi}""") result['error']['ros_margin_of_error'] = error
def then_one_hour_size_t(results: list): """ check the relative error of the ros """ for result in results: check_metric('1 HR Size t', result['fuel_type'], result['python'].sixty_minute_fire_size_t, result['java'].area, fire_size_acceptable_margin_of_error)
def then_cfb_t(results: list): """ check the relative error of the ros """ for result in results: check_metric('CFB_t', result['fuel_type'], result['python'].cfb_t * 100.0, result['java'].cfb, acceptable_margin_of_error)
def then_hfi_t(results: list): """ check the relative error of the ros """ for result in results: check_metric('HFI_t', result['fuel_type'], result['python'].hfi_t, result['java'].hfi, acceptable_margin_of_error)