mt_metadata.helper_functions
This module has some general helper functions that it isn’t yet clear where they should live.
These may not be needed at all after the pydantic upgrade is fully integrated.
Functions
|
Takes a setter's input and makes it a list if it not. |
|
Module Contents
- mt_metadata.helper_functions.validate_setter_input(value, expected_class)
Takes a setter’s input and makes it a list if it not. Then asserts that every list element is of permissible type (dict or expected class)
- mt_metadata.helper_functions.cast_to_class_if_dict(obj, cls)
- Parameters:
obj (Union[Dict, MetadataBase]) – Either an mt_metadata object or its dict representaiton
cls (MetadataBase) – Some mt_metadata object that we want to get back
- Return type:
either the input or the input dict cast to an mt_metadata object.