def write(self, file):
if self.type not in self.dx_types:<EOL><INDENT>raise ValueError(("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>").format(<EOL>self.type, list(self.dx_types.keys())))<EOL><DEDENT>typelabel = (self.typequote+self.type+self.typequote)<EOL>DXclass.write(self,file,<EOL>'<STR_LIT>'.format(<EOL>typelabel, self.array.size))<EOL>fmt_string = "<STR_LIT>"<EOL>if (self.array.dtype.kind == '<STR_LIT:f>' or self.array.dtype.kind == '<STR_LIT:c>'):<EOL><INDENT>precision = numpy.finfo(self.array.dtype).precision<EOL>fmt_string = "<STR_LIT>"+"<STR_LIT>".format(precision)+"<STR_LIT>"<EOL><DEDENT>values_per_line = <NUM_LIT:3><EOL>values = self.array.flat<EOL>while <NUM_LIT:1>:<EOL><INDENT>try:<EOL><INDENT>for i in range(values_per_line):<EOL><INDENT>file.write(fmt_string.format(next(values)) + "<STR_LIT:\t>")<EOL><DEDENT>file.write('<STR_LIT:\n>')<EOL><DEDENT>except StopIteration:<EOL><INDENT>file.write('<STR_LIT:\n>')<EOL>break<EOL><DEDENT><DEDENT>file.write('<STR_LIT>')<EOL>
Write the *class array* section.

        Parameters
        ----------
        file : file

        Raises
        ------
        ValueError
             If the `dxtype` is not a valid type, :exc:`ValueError` is
             raised.