(*dimensions)
| 47 | |
| 48 | # Shape constraint for array-types |
| 49 | def shape(*dimensions): |
| 50 | def validator(trait, value): |
| 51 | err_msg_tmpl = 'Expected an array of shape {} ' + \ |
| 52 | 'but got an array of shape {}' |
| 53 | if value.shape != dimensions: |
| 54 | raise TraitError(err_msg_tmpl.format(dimensions, value.shape)) |
| 55 | else: |
| 56 | return value |
| 57 | return validator |
| 58 | |
| 59 | |
| 60 | class Mark(Widget): |
no outgoing calls
no test coverage detected
searching dependent graphs…