artemis.externals.physt.util

Various utility functions to support physt implementation.

These functions are mostly general Python functions, not specific for numerical computing, histogramming, etc.

Module Contents

artemis.externals.physt.util.all_subclasses(cls: type) → Tuple[type, ...]

All subclasses of a class.

From: http://stackoverflow.com/a/17246726/2692780

artemis.externals.physt.util.find_subclass(base: type, name: str) → type

Find a named subclass of a base class.

Uses only the class name without namespace.

artemis.externals.physt.util.pop_many(a_dict: Dict[str, Any], *args: str, **kwargs) → Dict[str, Any]

Pop multiple items from a dictionary.

Parameters
  • a_dict (Dictionary from which the items will popped) –

  • args (Keys which will be popped (and not included if not present)) –

  • kwargs (Keys + default value pairs) –

  • key not found, this default is included) ((if) –

Returns

Return type

A dictionary of collected items.