autowisp.light_curves.hashable_array module
Class Inheritance Diagram

Define a Hashable wrapper for ndarray objects.
- class autowisp.light_curves.hashable_array.HashableArray(wrapped, tight=False)[source]
Bases:
object
Hashable wrapper for ndarray objects
Copied from: http://stackoverflow.com/questions/1939228/constructing-a-python-set-from-a-numpy-matrix
Instances of ndarray are not hashable, meaning they cannot be added to sets, nor used as keys in dictionaries. This is by design - ndarray objects are mutable, and therefore cannot reliably implement the __hash__() method.
The hashable class allows a way around this limitation. It implements the required methods for hashable objects in terms of an encapsulated ndarray object. This can be either a copied instance (which is safer) or the original object (which requires the user to be careful enough not to modify it).