def __init__(self, classid, array=None, type=None, typequote='<STR_LIT:">',<EOL>**kwargs):
if array is None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>self.id = classid<EOL>self.name = '<STR_LIT>'<EOL>self.component = '<STR_LIT:data>'<EOL>if type is None:<EOL><INDENT>self.array = numpy.asarray(array)<EOL>try:<EOL><INDENT>self.type = self.np_types[self.array.dtype.name]<EOL><DEDENT>except KeyError:<EOL><INDENT>warnings.warn(("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>").format(<EOL>self.array.dtype.name))<EOL>self.type = self.array.dtype.name  <EOL><DEDENT><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>self.array = numpy.asarray(array, dtype=self.dx_types[type])<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ValueError(("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(type,<EOL>list(self.dx_types.values()))))<EOL><DEDENT>self.type = type<EOL><DEDENT>self.typequote = typequote<EOL>
Parameters
----------
classid : int
array : array_like
type : str (optional)
     Set the DX type in the output file and cast `array` to
     the closest numpy dtype.  `type` must be one of the
     allowed types in DX files as defined under `Array
     Objects`_.  The default ``None`` tries to set the type
     from the :class:`numpy.dtype` of `array`.

     .. versionadded:: 0.4.0

Raises
------
ValueError
     if `array` is not provided; or if `type` is not of the correct
     DX type