def __init__(self, f, sub=slice(None), file_unit=angstrom):
SlicedReader.__init__(self, f, sub)<EOL>self.file_unit = file_unit<EOL>try:<EOL><INDENT>self.symbols = None<EOL>self._first = self._read_frame()<EOL>self.numbers = np.zeros(len(self.symbols), int)<EOL>for index, symbol in enumerate(self.symbols):<EOL><INDENT>try:<EOL><INDENT>number = int(symbol)<EOL>symbol = periodic[number].symbol<EOL>self.symbols[index] = symbol<EOL><DEDENT>except ValueError:<EOL><INDENT>atom_info = periodic[symbol]<EOL>if atom_info is not None:<EOL><INDENT>number = atom_info.number<EOL><DEDENT>else:<EOL><INDENT>number = <NUM_LIT:0><EOL><DEDENT><DEDENT>self.numbers[index] = number<EOL><DEDENT>self.symbols = tuple(self.symbols)<EOL>self._f.seek(<NUM_LIT:0>)<EOL><DEDENT>except StopIteration:<EOL><INDENT>raise FileFormatError("<STR_LIT>")<EOL><DEDENT>
Initialize an XYZ reader

           Arguments:
            | ``f``  --  a filename or a file-like object

           Optional arguments:
            | ``sub``  --  a slice indicating which frames to read/skip
            | ``file_unit``  --  the conversion constant to convert data into atomic
                                  units [default=angstrom]

           After initialization, the following attributes are defined:
            | ``symbols``  --  The atom symbols
            | ``numbers``  --  The atom numbers