class PVGeo._helpers.errors.ErrorObserver[source]

Bases: object

A class for catching errors when processing on a VTK pipeline. The AlgorithmBase class handles setting up this observer on initialization.


>>> import PVGeo
>>> # Only use this observer on sub classes of the AlgorithmBase:
>>> f = PVGeo.AlgorithmBase()
>>> f.Update()
>>> if f.error_occurred():
>>>    print(f.get_error_message())
ERROR: ...

Ask self if an error has occured


Get the last set error message

Returns:the last set error message
Return type:str

Make this an observer of an algorithm


class PVGeo._helpers.errors.HiddenPrints[source]

Bases: object

Use this object to hide print statements when perfroming a task. This is used to suppress printed warnings from discretize on import:

Example: >>> with HiddenPrints(): … import discretize


class PVGeo._helpers.errors.PVGeoError(message)[source]

Bases: Exception

This is a custom error class for handling errors when proccessing on the VTK pipeline. It makes the error messages easy to decipher in ParaView and cleans the messages when used in Python outside of ParaView. When on the VTK pipeline, errors aren’t really raised but passed over and printed to the console. This class makes decipher the error streams a whole lot easier for human eyes.

QUALIFIER_L = '@@@@PVGeoError ---> '
QUALIFIER_R = ' <--- PVGeoError@@@@'
SEARCHER = re.compile('@@@@PVGeoError --->.+?<--- PVGeoError@@@@', re.MULTILINE|re.DOTALL)
static clean_message(message)[source]