Error Handling

The following custom errors are defined in PyProp

class pyprop.MaxCurrentExceededError(component_type, component_name, I_max, I_drawn)

An error thrown when the max current that can be handled by one of the components is exceeded.

component_type

The type of component (“motor”, “ESC”, or “battery”).

Type:str
component_name

The name of the component.

Type:str
I_max

The maximum current allowed through the component.

Type:float
I_drawn

The amount of current trying to be drawn.

Type:float
class pyprop.ThrottleNotFoundError(error_type, v_cruise, T_req, final_val=None)

An error that occurs when the solver for the throttle value does not converge or the throttle value determined is not possible.

error_type

The type of error. Either “not_converged” or “throttle_invalid”.

Type:str
v_cruise

The cruise velocity in ft/s.

Type:float
T_req

Required thrust in lbf.

Type:float
final_val

The throttle value converged to (if “throttle_invalid”).

Type:float
class pyprop.TorquesNotMatchedError(v_cruise, throttle)

An error that occurs when the propeller and motor torques cannot be matched at a speed.

v_cruise

Cruise velocity in ft/s.

Type:float
throttle

Throttle value.

Type:float
class pyprop.InvalidRuntimeError(runtime)

An error that occurs when a negative runtime is predicted.

runtime

The predicted runtime in minutes.

Type:float
class pyprop.DatabaseRecordNotFoundError(command)

“An error which occurs when the user tries to pull a record from the database which does not exist.

command

The sql command which failed.

Type:str
class pyprop.PropDataBoundsError(prop, rpm, J)

“An error which occurs when the computation falls outside the range of the experimental data for the prop.

prop

The name of the prop.

Type:str
rpm

The rpm value which exceeded the data.

Type:float
J

The advance ratio which exceeded the data.

Type:float
class airfoil_db.DatabaseBoundsError(airfoil, exception_indices, inputs_dict)

An exception thrown when the inputs to the airfoil database fall outside the database bounds.

airfoil

The name of the airfoil for which this exception occurred.

Type:str
inputs_dict

The arguments passed to the airfoil.

Type:dict
exception_indices

The indices at which the arguments fell outside the database bounds.

Type:list
message

A message about the error.

Type:str