(kinds='biufMSUO')
| 223 | |
| 224 | |
| 225 | def array_supported_kinds(kinds='biufMSUO'): |
| 226 | def validator(trait, value): |
| 227 | if value.dtype.kind not in kinds: |
| 228 | raise TraitError('Array type not supported for trait %s of class %s: expected a \ |
| 229 | array of kind in list %r and got an array of type %s (kind %s)' % ( |
| 230 | trait.name, trait.this_class, list(kinds), value.dtype, value.dtype.kind)) |
| 231 | return value |
| 232 | return validator |
| 233 | |
| 234 | |
| 235 | # DataFrame |