Skip to content

error

Classes:

Functions:

GeoKitVectorError

Marks an error that is specific to geokit behavior.

Parameters:

  • UTIL

    (_type_) –

    description

checkMultiProcessingAvailability

checkMultiProcessingAvailability(
    multiProcess: bool,
) -> bool

Multiprocessing is not available on all operating systems. If the user wants to to use multiprocessing on an unsupported operating system, multiprocessing will be deactivated and a warning appears.

Parameters:

  • multiProcess

    (bool) –

    A flag indicating whether multiprocessing should be used as indicated by the user. If multiprocessing is not available for the operating system, multiprocessing will be deactivated and a warning appears.

Returns:

  • bool

    The corrected value for multiprocessing availability.

Source code in geokit/error.py
def checkMultiProcessingAvailability(multiProcess: bool) -> bool:
    """Multiprocessing is not available on all operating systems. If the user wants to
    to use multiprocessing on an unsupported operating system, multiprocessing will be
    deactivated and a warning appears.

    Parameters
    ----------
    multiProcess : bool
        A flag indicating whether multiprocessing should be used as indicated by the user.
        If multiprocessing is not available for the operating system, multiprocessing will be deactivated and a warning appears.

    Returns
    -------
    bool
        The corrected value for multiprocessing availability.
    """
    if platform == "linux" or platform == "linux2":
        multiProcessCorrected = multiProcess
    elif platform == "darwin" and multiProcess is True:
        multiProcessCorrected = False
        warn(message=GeokitMultiProcessingWarning.multiProcessingWarningMessage, category=GeokitMultiProcessingWarning)
    elif platform == "win32" and multiProcess is True:
        multiProcessCorrected = False
        warn(message=GeokitMultiProcessingWarning.multiProcessingWarningMessage, category=GeokitMultiProcessingWarning)
    elif multiProcess is False:
        multiProcessCorrected = multiProcess
    else:
        multiProcessCorrected = False
        warn(message=GeokitMultiProcessingWarning.multiProcessingWarningMessage, category=GeokitMultiProcessingWarning)
    return multiProcessCorrected