hyperspy.misc.model_tools module

hyperspy.misc.model_tools._is_iter(val)

Checks if value is a list or tuple

hyperspy.misc.model_tools._iter_join(val)

Joins values of iterable parameters for the fancy view, unless it equals None, then blank

hyperspy.misc.model_tools._non_iter(val)

Returns formatted string for a value unless it equals None, then blank

class hyperspy.misc.model_tools.current_component_values(component, only_free=False, only_active=False)

Bases: object

Convenience class that makes use of __repr__ methods for nice printing in the notebook of the properties of parameters of a component

Parameters
  • component (hyperspy component instance) –

  • only_free (bool, default False) – If True: Only include the free parameters in the view

  • only_active (bool, default False) – If True: Helper for current_model_values. Only include active components in the view. Always shows values if used on an individual component.

class hyperspy.misc.model_tools.current_model_values(model, only_free=False, only_active=False, component_list=None)

Bases: object

Convenience class that makes use of __repr__ methods for nice printing in the notebook of the properties of parameters in components in a model

Parameters
  • component (hyperspy component instance) –

  • only_free (bool, default False) – If True: Only include the free parameters in the view

  • only_active (bool, default False) – If True: Only include active parameters in the view