def write(fn, a, **kwargs):
ext = fn[fn.rfind('<STR_LIT:.>'):].split('<STR_LIT:@>')<EOL>if ext[<NUM_LIT:0>] == '<STR_LIT>' or ext[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>return write_atoms(fn, a)<EOL><DEDENT>elif ext[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>return write_lammps_data(fn, a, velocities=True, **kwargs)<EOL><DEDENT>elif ext[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>return NetCDFTrajectory(fn, '<STR_LIT:w>').write(a)<EOL><DEDENT>else:<EOL><INDENT>return ase.io.write(fn, a, **kwargs)<EOL><DEDENT>
Convenience function: Detect file extension and write via Atomistica or ASE.
Has support for writing LAMMPS data files.