more uniform behaviour of IO formats (e.g. slicing)
Each io format does its own slicing (or not).
This causes surprising things like:
askhl@jormungandr:~$ ase-gui opt.traj@-1 # Everything goes fine
Please use "ase gui" instead of "ase-gui"
askhl@jormungandr:~$ ase-gui H2O.json@-1
Please use "ase gui" instead of "ase-gui"
ValueError: max() arg is an empty sequence
To get a full traceback, use: ase -T gui ...
Meanwhile, the json file can be loaded fine when no slice is specified.
We should have a common framework for IO formats so slicing works uniformly instead of having to be implemented for each format.
Also, the common framework could handle questions like filename versus file-object.
This common framework could be based on inheriting from a class, or by combining the functions with a common wrapper (e.g. a property).
Things are slightly more complicated because of two-level loading: For example iread_xyz identifies which chunk of text belongs to each image (this is fast) before converting them to atoms objects (which is slow), in case not all of them are going to be converted in the first place.