Source code for epygram.fields.MiscField
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MiscField:
Contains the class to for Miscellaneous fields.
"""
from epygram.base import Field
[docs]class MiscField(Field):
"""
A miscellaneous field class.
Designed to handle data of various nature (bool, int, float, str...)
and various dimensions (scalar, 1D/2D).
"""
def __init__(self, *args, **kwargs):
"""
Constructor. See its footprint for arguments.
"""
super(MiscField, self).__init__(*args, **kwargs)
@property
[docs] def datatype(self):
"""
Returns the data type.
"""
return self.data.dtype
@property
[docs] def shape(self):
"""
Returns the data shape.
"""
return self.data.shape