check_graph

menpofit.checks.check_graph(graph, graph_types, param_name, n_scales)[source]

Checks the provided graph per pyramidal level. The graph must be a subclass of graph_types or a list of those.

Parameters:
  • graph (graph or list of graph types) – The graph argument to check.
  • graph_types (graph or tuple of graphs) – The tuple of allowed graph types.
  • param_name (str) – The name of the graph parameter.
  • n_scales (int) – The number of pyramidal levels.
Returns:

graph (list of graph types) – The graph per scale in a list.

Raises:
  • ValueError – {param_name} must be a list of length equal to the number of scales.
  • ValueError – {param_name} must be a list of {graph_types_str}. {} given instead.