Errors¶
GenPlanner defines a small hierarchy of custom exceptions.
All errors inherit from GenPlannerBaseError.
The base class supports an optional run_name attribute,
which is included in the error message when present.
Example:
try:
...
except Exception as e:
print(e)
If a run name is set, the message format becomes:
[gp_240226_14_32] error message here
Error hierarchy¶
Base class¶
Validation errors¶
- class genplanner.errors.SplitPolygonValidationError(field, message, run_name=None)[source]¶
Bases:
GenPlannerBaseError
Raised when arguments passed to the internal polygon splitter are invalid (wrong types, missing zones, malformed pairs, etc.).
Initialization errors¶
- class genplanner.errors.GenPlannerInitError(message, run_name=None)[source]¶
Bases:
GenPlannerBaseErrorRaised when GenPlanner initialization fails.
Raised during GenPlanner initialization
when territory input or preprocessing validation fails.
Argument errors¶
- class genplanner.errors.GenPlannerArgumentError(message, run_name=None)[source]¶
Bases:
GenPlannerBaseErrorRaised when invalid arguments are passed to GenPlanner methods.
Raised when invalid arguments are passed to public methods.
- class genplanner.errors.FixPointsOutsideTerritoryError(message, run_name=None)[source]¶
Bases:
GenPlannerArgumentErrorRaised when fixed points are outside the territory polygon.
Special case of GenPlannerArgumentError raised when fixed
anchor points lie outside the working territory.
Relation matrix errors¶
- class genplanner.errors.RelationMatrixError(message, run_name=None)[source]¶
Bases:
GenPlannerBaseErrorRaised when there is an error in relation matrix construction or usage.
Raised when relation matrix construction or validation fails.
Optimization errors¶
- class genplanner.errors.GenplannerInfeasibleMultiFeatureError(message, run_name=None)[source]¶
Bases:
GenPlannerBaseErrorRaised when multi-feature setup is infeasible.
Raised when a multi-feature zoning problem cannot be solved after repeated attempts.