odsbox.model_suggestions ======================== .. py:module:: odsbox.model_suggestions Classes ------- .. autoapisummary:: odsbox.model_suggestions.ModelSuggestions Module Contents --------------- .. py:class:: ModelSuggestions Provides fuzzy-match suggestions for ODS model names. Used to generate helpful error messages when an entity, attribute, relation, or enum value name is not found in the ODS application model. All methods return a suggestion string (e.g. " Did you mean 'AoMeasurement'?") or an empty string if no close match is found. .. py:method:: get(lower_case_dict, str_val) :staticmethod: Return a suggestion string from a lowercase-keyed lookup dict. :param lower_case_dict: Mapping of lowercase name → canonical name. :param str_val: The name that was not found, to find a suggestion for. :returns: A suggestion string like " Did you mean 'Name'?", or "" if no close match is found. .. py:method:: get_enum(enumeration, str_val) :staticmethod: Return a suggestion for an enum item name. :param enumeration: The ODS model enumeration to search. :param str_val: The enum item name that was not found. :returns: A suggestion string, or "" if no close match is found. .. py:method:: get_attribute(entity, attribute_or_relation_name) :staticmethod: Return a suggestion for an attribute or relation name (application or base name). :param entity: The ODS model entity to search within. :param attribute_or_relation_name: The name that was not found. :returns: A suggestion string, or "" if no close match is found. .. py:method:: get_attribute_by_base_name(entity, attribute_or_relation_name) :staticmethod: Return a suggestion for an attribute or relation base name only. :param entity: The ODS model entity to search within. :param attribute_or_relation_name: The base name that was not found. :returns: A suggestion string, or "" if no close match is found. .. py:method:: get_relation(entity, relation_name) :staticmethod: Return a suggestion for a relation name (application or base name). :param entity: The ODS model entity to search within. :param relation_name: The relation name that was not found. :returns: A suggestion string, or "" if no close match is found. .. py:method:: get_relation_by_base_name(entity, relation_name) :staticmethod: Return a suggestion for a relation base name only. :param entity: The ODS model entity to search within. :param relation_name: The relation base name that was not found. :returns: A suggestion string, or "" if no close match is found. .. py:method:: get_entity(model, entity_name) :staticmethod: Return a suggestion for an entity name (application or base name). :param model: The ODS application model to search within. :param entity_name: The entity name that was not found. :returns: A suggestion string, or "" if no close match is found. .. py:method:: get_entity_by_base_name(model, entity_name) :staticmethod: Return a suggestion for an entity base name only. :param model: The ODS application model to search within. :param entity_name: The entity base name that was not found. :returns: A suggestion string, or "" if no close match is found.