nifty7.domains.domain module#

class Domain[source]#

Bases: object

The abstract class repesenting a (structured or unstructured) domain.

__eq__(x)[source]#

Checks whether two domains are equal.

Parameters:

x (Domain) – The domain self is compared to.

Returns:

bool

Return type:

True iff self and x describe the same domain.

Notes

Only members that are explicitly added to _needed_for_hash will be used for comparison.

Subclasses of Domain should not re-define __eq__(), __ne__(), or __hash__(); they should instead add their relevant attributes’ names to _needed_for_hash.

__hash__()[source]#

Returns a hash value for the object.

Notes

Only members that are explicitly added to _needed_for_hash will be used for hashing.

__ne__(x)[source]#

Returns the opposite of __eq__()

property shape#

number of pixels along each axis

The shape of the array-like object required to store information defined on the domain.

Type:

tuple of int

property size#

total number of pixels.

Equivalent to the products over all entries in the domain’s shape.

Type:

int