raster_stats/__main__.py
def logger_callback(df_complete, _, p_progress_arg):
        """Argument names come from the GDAL API for callbacks."""
        try:
            current_time = time.time()
            if ((current_time - logger_callback.last_time) > 5.0 or
                    (df_complete == 1.0 and
                     logger_callback.total_time >= 5.0)):
                # In some multiprocess applications I was encountering a
                # ``p_progress_arg`` of None. This is unexpected and I suspect
                # was an issue for some kind of GDAL race condition. So I'm
                # guarding against it here and reporting an appropriate log
                # if it occurs.
                if p_progress_arg:
                    LOGGER.info(message, df_complete * 100, p_progress_arg[0])
                else:
                    LOGGER.info(
                        'p_progress_arg is None df_complete: %s, message: %s',
                        df_complete, message)
                logger_callback.last_time = current_time
                logger_callback.total_time += current_time
        except AttributeError:
            logger_callback.last_time = time.time()
            logger_callback.total_time = 0.0
Argument names come from the GDAL API for callbacks.
Argument names come from the GDAL API for callbacks.
Argument names come from the GDAL API for callbacks .
def logger_callback(df_complete, _, p_progress_arg):
        try:
            current_time = time.time()
            if ((current_time - logger_callback.last_time) > 5.0 or
                    (df_complete == 1.0 and
                     logger_callback.total_time >= 5.0)):
                if p_progress_arg:
                    LOGGER.info(message, df_complete * 100, p_progress_arg[0])
                else:
                    LOGGER.info(
                        'p_progress_arg is None df_complete: %s, message: %s',
                        df_complete, message)
                logger_callback.last_time = current_time
                logger_callback.total_time += current_time
        except AttributeError:
            logger_callback.last_time = time.time()
            logger_callback.total_time = 0.0
def logger_callback ( df_complete , _ , p_progress_arg ) : try : current_time = time . time ( ) if ( ( current_time - logger_callback . last_time ) > 5.0 or ( df_complete == 1.0 and logger_callback . total_time >= 5.0 ) ) : if p_progress_arg : LOGGER . info ( message , df_complete * 100 , p_progress_arg [ 0 ] ) else : LOGGER . info ( 'p_progress_arg is None df_complete: %s, message: %s' , df_complete , message ) logger_callback . last_time = current_time logger_callback . total_time += current_time except AttributeError : logger_callback . last_time = time . time ( ) logger_callback . total_time = 0.0
Argument names come from the GDAL API for callbacks.
Argument names come from the GDAL API for callbacks .
"""Argument names come from the GDAL API for callbacks.""" # In some multiprocess applications I was encountering a
 # ``p_progress_arg`` of None. This is unexpected and I suspect
 # was an issue for some kind of GDAL race condition. So I'm
 # guarding against it here and reporting an appropriate log
 # if it occurs.

df_complete
_
p_progress_arg