oasislmf.lookup.base ==================== .. py:module:: oasislmf.lookup.base Classes ------- .. autoapisummary:: oasislmf.lookup.base.AbstractBasicKeyLookup oasislmf.lookup.base.MultiprocLookupMixin oasislmf.lookup.base.OasisBaseLookup Module Contents --------------- .. py:class:: AbstractBasicKeyLookup(config, config_dir=None, user_data_dir=None, output_dir=None) Basic abstract class for KeyLookup .. py:attribute:: interface_version :value: '1' .. py:attribute:: config .. py:attribute:: config_dir .. py:attribute:: user_data_dir .. py:attribute:: output_dir .. py:method:: process_locations(locations) :abstractmethod: Process location rows - passed in as a pandas dataframe. Results can be list, tuple, generator or a pandas dataframe. .. py:class:: MultiprocLookupMixin Simple mixin class for multiprocessing implement the process_locations_multiproc by transforming the result of process_locations into a pandas DataFrame .. py:method:: process_locations_multiproc(loc_df_part) .. py:class:: OasisBaseLookup(config=None, config_json=None, config_fp=None, config_dir=None, user_data_dir=None, output_dir=None) Bases: :py:obj:`AbstractBasicKeyLookup`, :py:obj:`MultiprocLookupMixin` Abstract class that help with the implementation of the KeyServerInterface. require lookup method to be implemented. Lookup will be call to create a key for each peril id and coverage type .. py:attribute:: multiproc_enabled :value: True .. py:attribute:: peril_ids .. py:attribute:: peril_id_col .. py:attribute:: coverage_types .. py:attribute:: coverage_type_col .. py:property:: config .. py:method:: lookup(loc, peril_id, coverage_type, **kwargs) :abstractmethod: Lookup for an individual location item, which could be a dict or a Pandas series object. .. py:method:: process_locations(locs) Bulk vulnerability lookup for a list, tuple, generator, pandas data frame or dict of location items, which can be dicts or Pandas series objects or any object which has as a dict-like interface. Generates results using ``yield``.