safe.utilities.memory_checker module

InaSAFE Disaster risk assessment tool developed by AusAid - Memory Checker.

Contact : ole.moller.nielsen@gmail.com

Note

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

safe.utilities.memory_checker.check_memory_usage(buffered_geo_extent, cell_size)[source]

Helper to check if analysis is feasible when extents change.

For simplicity, we will do all our calculations in geocrs.

Parameters:
  • buffered_geo_extent (list) – An extent in the for [xmin, ymin, xmax, ymax]
  • cell_size (float) – The size of a cell (assumes in the X direction).
Returns:

True if it appears we have enough memory (or we can’t compute it), False if it appears we do not have enough.

Return type:

bool

Raises:

A Message containing notes about how much memory is needed for a single raster and if this is likely to result in an error.

Returns:

True if it is supposed that there is sufficient memory, False if it is supposed that too little memory exists.

Return type:

bool

safe.utilities.memory_checker.send_message(message)[source]

Send a message using the dispatcher.

Parameters:message (Message) – A Message object to be sent to a message viewer.
safe.utilities.memory_checker.tr(string)[source]

We implement this ourselves since we do not inherit QObject.

Parameters:string (str) – The string for translation.
Returns:Translated version of string.
Return type:str