phenopacket_mapper.preprocessing.preprocess_method module

phenopacket_mapper.preprocessing.preprocess_method.preprocess_method(value: Any, method: Callable, **kwargs) Any[source]

Takes a value and uses a method to preprocess it.

The method is called with the value as an argument. If the method raises an exception, the original value is returned.

If the method requires additional arguments, they can be passed as keyword arguments in kwargs.

Please write the method such that it is callable as method(value, **kwargs).

Parameters:
  • value – The value to preprocess.

  • method – The method to use for preprocessing.

  • kwargs – Additional arguments for the method.

Returns:

The preprocessed value.