oasislmf.pytools.common.data

Module Contents

Functions

load_as_ndarray(dir_path, name, _dtype[, must_exist, ...])

load a file as a numpy ndarray

load_as_array(dir_path, name, _dtype[, must_exist])

load file as a single numpy array,

almost_equal(a, b)

Attributes

oasislmf.pytools.common.data.oasis_int[source]
oasislmf.pytools.common.data.nb_oasis_int[source]
oasislmf.pytools.common.data.oasis_int_size[source]
oasislmf.pytools.common.data.oasis_float[source]
oasislmf.pytools.common.data.nb_oasis_float[source]
oasislmf.pytools.common.data.oasis_float_size[source]
oasislmf.pytools.common.data.areaperil_int[source]
oasislmf.pytools.common.data.nb_areaperil_int[source]
oasislmf.pytools.common.data.areaperil_int_size[source]
oasislmf.pytools.common.data.null_index[source]
oasislmf.pytools.common.data.summary_xref_dtype[source]
oasislmf.pytools.common.data.fm_programme_dtype[source]
oasislmf.pytools.common.data.fm_policytc_dtype[source]
oasislmf.pytools.common.data.fm_profile_dtype[source]
oasislmf.pytools.common.data.fm_profile_step_dtype[source]
oasislmf.pytools.common.data.fm_profile_csv_col_map[source]
oasislmf.pytools.common.data.fm_xref_dtype[source]
oasislmf.pytools.common.data.fm_xref_csv_col_map[source]
oasislmf.pytools.common.data.coverages_dtype[source]
oasislmf.pytools.common.data.items_dtype[source]
oasislmf.pytools.common.data.load_as_ndarray(dir_path, name, _dtype, must_exist=True, col_map=None)[source]

load a file as a numpy ndarray useful for multi-columns files Args:

dir_path: path to the directory where the binary or csv file is stored name: name of the file _dtype: np.dtype must_exist: raise FileNotFoundError if no file is present col_map: name re-mapping to change name of csv columns

Returns:

numpy ndarray

oasislmf.pytools.common.data.load_as_array(dir_path, name, _dtype, must_exist=True)[source]
load file as a single numpy array,

useful for files with a binary version with only one type of value where their index correspond to an id. For example coverage.bin only contains tiv value for each coverage id coverage_id n correspond to index n-1

Args:

dir_path: path to the directory where the binary or csv file is stored name: name of the file _dtype: numpy dtype of the required array must_exist: raise FileNotFoundError if no file is present

Returns:

numpy array of dtype type

oasislmf.pytools.common.data.float_equal_precision[source]
oasislmf.pytools.common.data.almost_equal(a, b)[source]