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

class genplanner.errors.GenPlannerBaseError(message, run_name=None)[source]

Bases: Exception

Parameters:
  • message (str)

  • run_name (str | None)

Validation errors

class genplanner.errors.SplitPolygonValidationError(field, message, run_name=None)[source]

Bases: GenPlannerBaseError

Parameters:
  • field (str)

  • message (str)

  • run_name (str | None)

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: GenPlannerBaseError

Raised when GenPlanner initialization fails.

Parameters:
  • message (str)

  • run_name (str | None)

Raised during GenPlanner initialization when territory input or preprocessing validation fails.

Argument errors

class genplanner.errors.GenPlannerArgumentError(message, run_name=None)[source]

Bases: GenPlannerBaseError

Raised when invalid arguments are passed to GenPlanner methods.

Parameters:
  • message (str)

  • run_name (str | None)

Raised when invalid arguments are passed to public methods.

class genplanner.errors.FixPointsOutsideTerritoryError(message, run_name=None)[source]

Bases: GenPlannerArgumentError

Raised when fixed points are outside the territory polygon.

Parameters:
  • message (str)

  • run_name (str | None)

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: GenPlannerBaseError

Raised when there is an error in relation matrix construction or usage.

Parameters:
  • message (str)

  • run_name (str | None)

Raised when relation matrix construction or validation fails.

Optimization errors

class genplanner.errors.GenplannerInfeasibleMultiFeatureError(message, run_name=None)[source]

Bases: GenPlannerBaseError

Raised when multi-feature setup is infeasible.

Parameters:
  • message (str)

  • run_name (str | None)

Raised when a multi-feature zoning problem cannot be solved after repeated attempts.