[ase-users] Converting old trajectory files does not work

Michael Walter Michael.Walter at fmf.uni-freiburg.de
Fri Nov 8 14:02:04 CET 2019


Dear Jens Jorgen,

Am Mi., 6. Nov. 2019 um 12:41 Uhr schrieb Jens Jørgen Mortensen <jjmo at dtu.dk
>:

> Den 04/11/2019 kl. 11.29 skrev Michael Walter via ase-users:
> > Dear all,
> >
> > If I try to use the attached (old) trajectory file, I get
> >
> > ase: error: DeprecationWarning: Please stop using old trajectory files!
> > Convert to the new future-proof format like this:
> >
> >      $ python -m ase.io.trajectory 64.rho_2.2-quench.final.traj
> >
> > To get a full traceback, use: ase -T gui ...
> >
> > That's all fine, except that python might be python2. But if I try to
> > follow the advice
>
> Does this MR work?
>
> https://gitlab.com/ase/ase/merge_requests/1472


yes, it works!

I get come warning, but I that's fine for me:

/home/mw/source/ase/upstream/ase/io/pickletrajectory.py:559: UserWarning:
Could not unpickle constraints!
  warnings.warn('Could not unpickle constraints!')

Thanks,
Michael


>
> Jens Jørgen
>
> >
> >  > python -m ase.io.trajectory 64.rho_2.2-quench.final.traj
> > /local_data/tmp/walt/anaconda3/lib/python3.6/runpy.py:125:
> > RuntimeWarning: 'ase.io.trajectory' found in sys.modules after import of
> > package 'ase.io <http://ase.io>', but prior to execution of
> > 'ase.io.trajectory'; this may result in unpredictable behaviour
> >    warn(RuntimeWarning(msg))
> > version 3
> > /local_data/tmp/walt/source/ase/trunk/ase/io/pickletrajectory.py:559:
> > UserWarning: Could not unpickle constraints!
> >    warnings.warn('Could not unpickle constraints!')
> > self.fd= <_io.BufferedReader name='64.rho_2.2-quench.final.traj'>
> > Traceback (most recent call last):
> >    File "/local_data/tmp/walt/anaconda3/lib/python3.6/runpy.py", line
> > 193, in _run_module_as_main
> >      "__main__", mod_spec)
> >    File "/local_data/tmp/walt/anaconda3/lib/python3.6/runpy.py", line
> > 85, in _run_code
> >      exec(code, run_globals)
> >    File "/local_data/tmp/walt/source/ase/trunk/ase/io/trajectory.py",
> > line 440, in <module>
> >      main()
> >    File "/local_data/tmp/walt/source/ase/trunk/ase/io/trajectory.py",
> > line 436, in main
> >      convert(name)
> >    File "/local_data/tmp/walt/source/ase/trunk/ase/io/trajectory.py",
> > line 420, in convert
> >      for atoms in PickleTrajectory(name, _warn=False):
> >    File
> > "/local_data/tmp/walt/source/ase/trunk/ase/io/pickletrajectory.py", line
> > 355, in next
> >      return self[len(self.offsets) - 1]
> >    File
> > "/local_data/tmp/walt/source/ase/trunk/ase/io/pickletrajectory.py", line
> > 293, in __getitem__
> >      d = pickle.load(self.fd)
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xaa in position 0:
> > ordinal not in range(128)
> >
> > I am not so much aware of the pickle format to fix this, so help would
> > be appreciated.
> >
> > Best,
> > Michael
> >
> > --
> > ------------------------------------------
> > PD Dr Michael Walter
> > Addresses:
> > - Fraunhofer IWM, Wöhlerstrasse 11, D-79108 Freiburg i. Br., Germany
> >    Tel.: +49 761 5142 296
> > - FIT Freiburg Centre for Interactive Materials and Bioinspired
> > Technologies, Georges-Köhler-Allee 105, 79110 Freiburg, Germany
> >    Tel: +49 761 203 95072
> > email: Michael.Walter at fmf.uni-freiburg.de
> > <mailto:Michael.Walter at fmf.uni-freiburg.de>
> > www:
> http://www.functional-nanosystems.uni-freiburg.de/People/PDWalter/group
> > publications:
> http://scholar.google.com/citations?user=vlmryKEAAAAJ&hl=en
> >
> > _______________________________________________
> > ase-users mailing list
> > ase-users at listserv.fysik.dtu.dk
> > https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
> >
>
>

-- 
------------------------------------------
PD Dr Michael Walter
Addresses:
- Fraunhofer IWM, Wöhlerstrasse 11, D-79108 Freiburg i. Br., Germany
  Tel.: +49 761 5142 296
- FIT Freiburg Centre for Interactive Materials and Bioinspired
Technologies, Georges-Köhler-Allee 105, 79110 Freiburg, Germany
  Tel: +49 761 203 95072
email: Michael.Walter at fmf.uni-freiburg.de
www: http://www.functional-nanosystems.uni-freiburg.de/People/PDWalter/group
publications: http://scholar.google.com/citations?user=vlmryKEAAAAJ&hl=en
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20191108/2077e464/attachment.html>


More information about the ase-users mailing list