oasislmf.lookup.interface ========================= .. py:module:: oasislmf.lookup.interface Classes ------- .. autoapisummary:: oasislmf.lookup.interface.KeyServerInterface oasislmf.lookup.interface.OasisLookupInterface Module Contents --------------- .. py:class:: KeyServerInterface(config, config_dir, user_data_dir, output_dir) Interface to implement to create a KeyServer It define the method to be implemented to be used correctly in lookup.factory.KeyServerFactory all classes must: - specify the version of the interface they use - implement the init method - implement the generate_key_files method .. py:attribute:: interface_version :value: '1' .. py:method:: generate_key_files(location_fp, successes_fp, errors_fp=None, output_format='oasis', keys_success_msg=False, multiproc_enabled=True, multiproc_num_cores=-1, multiproc_num_partitions=-1, **kwargs) :abstractmethod: Writes a keys file, and optionally a keys error file. :param location_fp: path to the locations file :type location_fp: str :param successes_fp: path to the success keys file :type successes_fp: str :param errors_fp: path to the error keys file (optional) :type errors_fp: str :param output_format: format of the keys files (oasis or json) :type output_format: str :param keys_success_msg: option to write msg for success key :type keys_success_msg: bool :param multiproc_enabled: option to run with multiple processor :type multiproc_enabled: bool :param multiproc_num_cores: number of cores to use in multiproc mode :type multiproc_num_cores: int :param multiproc_num_partitions: number of partition to create in multiproc mode :type multiproc_num_partitions: int If ``keys_errors_file_path`` is not present then the method returns a pair ``(p, n)`` where ``p`` is the keys file path and ``n`` is the number of "successful" keys records written to the keys file, otherwise it returns a quadruple ``(p1, n1, p2, n2)`` where ``p1`` is the keys file path, ``n1`` is the number of "successful" keys records written to the keys file, ``p2`` is the keys errors file path and ``n2`` is the number of "unsuccessful" keys records written to keys errors file. .. py:class:: OasisLookupInterface(keys_data_directory=None, supplier=None, model_name=None, model_version=None, complex_lookup_config_fp=None, output_directory=None) Old Oasis base class -deprecated If you were using this interface, you can make you class inherit from the new abstract class AbstractBasicKeyServer or implement the KeyServerInterface interface .. py:attribute:: interface_version :value: '0' .. py:attribute:: supplier .. py:attribute:: model_name .. py:attribute:: model_version .. py:attribute:: complex_lookup_config_fp .. py:attribute:: output_directory .. py:attribute:: UNKNOWN_ID .. py:method:: process_locations(loc_df) Process location rows - passed in as a pandas dataframe.