oasislmf.lookup.base¶
Classes¶
Basic abstract class for KeyLookup |
|
Simple mixin class for multiprocessing |
|
Abstract class that help with the implementation of the KeyServerInterface. |
Module Contents¶
- class oasislmf.lookup.base.AbstractBasicKeyLookup(config, config_dir=None, user_data_dir=None, output_dir=None)[source]¶
Basic abstract class for KeyLookup
- class oasislmf.lookup.base.MultiprocLookupMixin[source]¶
Simple mixin class for multiprocessing
implement the process_locations_multiproc by transforming the result of process_locations into a pandas DataFrame
- class oasislmf.lookup.base.OasisBaseLookup(config=None, config_json=None, config_fp=None, config_dir=None, user_data_dir=None, output_dir=None)[source]¶
Bases:
AbstractBasicKeyLookup,MultiprocLookupMixinAbstract 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
- abstract lookup(loc, peril_id, coverage_type, **kwargs)[source]¶
Lookup for an individual location item, which could be a dict or a Pandas series object.
- process_locations(locs)[source]¶
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.- Yields:
dict – the lookup result for each (location, peril_id, coverage_type) combination