ndshapecheck package
Submodules
ndshapecheck.has_shape module
ndshapecheck.shape_check module
ndshapecheck.shape_rule module
Contains code for checking a shape rule which is expressed as a string of symbols and literals.
- class ndshapecheck.shape_rule.ShapeRule(context, shape_str)
Bases:
objectEncapsulates a rule for a multidimensional array’s shape expressed as symbols and literals.
- check(shape)
- Has side-effects upon the context passed to the __init__ constructor by assigning
shape values to provided symbols.
- Parameters:
shape – A multidimensional array’s shape as a tuple of integers.
- Returns:
True if the provided shape matches the rule.