Package pygeodesy :: Module errors
[frames] | no frames]

Module errors

Errors, exceptions and exception chaining.

Error, exception classes and functions to format PyGeodesy errors, including the setting of exception chaining in Python 3+.

By default, exception chaining is turned off. To enable exception chaining, use command line option python -X dev OR set env var PYTHONDEVMODE to 1 or any non-empyty string OR set env var PYGEODESY_EXCEPTION_CHAINING=std or any other non-empty string.


Version: 22.09.17

Classes
  CrossError
Error raised for zero or near-zero vectorial cross products, occurring for coincident or colinear points, paths or bearings.
  IntersectionError
Error raised for path or circle intersection issues.
  LenError
Error raised for mis-matching len values.
  LimitError
Error raised for lat- or longitudinal deltas exceeding the limit in functions pygeodesy.equirectangular and pygeodesy.equirectangular_ and several nearestOn* and simplify* functions or methods.
  MGRSError
Military Grid Reference System (MGRS) parse or other Mgrs issue.
  NumPyError
Error raised for NumPy issues.
  ParseError
Error parsing degrees, radians or several other formats.
  PointsError
Error for an insufficient number of points.
  RangeError
Error raised for lat- or longitude values outside the clip, clipLat, clipLon or limit range in function pygeodesy.clipDegrees, pygeodesy.clipRadians, pygeodesy.parse3llh, pygeodesy.parseDMS, pygeodesy.parseDMS2 or pygeodesy.parseRad.
  TriangleError
Error raised for triangle, inter- or resection issues.
  SciPyError
Error raised for SciPy issues.
  SciPyWarning
Error thrown for SciPy warnings.
  TRFError
Terrestrial Reference Frame (TRF), Epoch, RefFrame or RefFrame conversion issue.
  UnitError
Default exception for units issues.
  VectorError
Vector3d, Cartesian* or *Nvector issues.
Functions
 
crosserrors(raiser=None)
Report or ignore vectorial cross product errors.
 
exception_chaining(error=None)
Get the previous exception's or exception chaining setting.
 
itemsorted(adict, *args, **asorted_reverse)
Return the items of adict sorted alphabetically, case-insensitively and in ascending order.
 
limiterrors(raiser=None)
Get/set the throwing of LimitErrors.
 
rangerrors(raiser=None)
Get/set the throwing of RangeErrors.
Variables
  __all__ = _ALL_LAZY.errors
Function Details

crosserrors (raiser=None)

 

Report or ignore vectorial cross product errors.

Arguments:
  • raiser - Use True to throw or False to ignore CrossError exceptions. Use None to leave the setting unchanged.
Returns:
Previous setting (bool).

See Also: Property Vector3d[Base].crosserrors.

exception_chaining (error=None)

 

Get the previous exception's or exception chaining setting.

Arguments:
  • error - An error instance (Exception) or None.
Returns:
If error is None, return True if exception chaining is enabled for PyGeodesy errors, False if turned off and None if not available. If error is not None, return the previous, chained error or None otherwise.

Note: Set env var PYGEODESY_EXCEPTION_CHAINING to any non-empty value prior to import pygeodesy to enable exception chaining for pygeodesy errors.

itemsorted (adict, *args, **asorted_reverse)

 

Return the items of adict sorted alphabetically, case-insensitively and in ascending order.

Arguments:
  • args - Optional argument(s) for method adict.items(B*{args}).
  • asorted_reverse - Use keyword argument asorted=False for case-sensitive sorting and reverse=True for results in descending order.

limiterrors (raiser=None)

 

Get/set the throwing of LimitErrors.

Arguments:
  • raiser - Choose True to raise or False to ignore LimitError exceptions. Use None to leave the setting unchanged.
Returns:
Previous setting (bool).

rangerrors (raiser=None)

 

Get/set the throwing of RangeErrors.

Arguments:
  • raiser - Choose True to raise or False to ignore RangeError exceptions. Use None to leave the setting unchanged.
Returns:
Previous setting (bool).