diff --git a/README.md b/README.md
index 8702166e8..3295bff03 100644
--- a/README.md
+++ b/README.md
@@ -82,6 +82,7 @@ The `System` or `LabeledSystem` can be constructed from the following file forma
| Gromacs | gro | True | False | System | 'gromacs/gro' |
| ABACUS | STRU | False | True | LabeledSystem | 'abacus/scf' |
| ABACUS | cif | True | True | LabeledSystem | 'abacus/md' |
+| ase | structure | True | True | MultiSystems | 'ase/structure' |
The Class `dpdata.MultiSystems` can read data from a dir which may contains many files of different systems, or from single xyz file which contains different systems.
@@ -89,7 +90,7 @@ The Class `dpdata.MultiSystems` can read data from a dir which may contains ma
Use `dpdata.MultiSystems.from_dir` to read from a directory, `dpdata.MultiSystems` will walk in the directory
Recursively and find all file with specific file_name. Supports all the file formats that `dpdata.LabeledSystem` supports.
-Use `dpdata.MultiSystems.from_file` to read from single file. Now only support quip/gap/xyz format file.
+Use `dpdata.MultiSystems.from_file` to read from single file. Single-file support is available for the `quip/gap/xyz` and `ase/structure` formats.
For example, for `quip/gap xyz` files, single .xyz file may contain many different configurations with different atom numbers and atom type.
diff --git a/dpdata/plugins/ase.py b/dpdata/plugins/ase.py
index a116e2162..891b2d90a 100644
--- a/dpdata/plugins/ase.py
+++ b/dpdata/plugins/ase.py
@@ -9,11 +9,20 @@
@Format.register("ase/structure")
class ASEStructureFormat(Format):
+ """Format for the `Atomic Simulation Environment `_ (ase).
+
+ ASE supports parsing a few dozen of data formats. As described in i
+ `the documentation `_,
+ many of these formats can be determined automatically.
+ Use the `ase_fmt` keyword argument to supply the format if
+ automatic detection fails.
+ """
+
def from_labeled_system(self, data, **kwargs):
return data
- def from_multi_systems(self, file_name, begin=None, end=None, step=None, fmt='traj', **kwargs):
- frames = ase.io.read(file_name, format=fmt, index=slice(begin, end, step))
+ def from_multi_systems(self, file_name, begin=None, end=None, step=None, ase_fmt=None, **kwargs):
+ frames = ase.io.read(file_name, format=ase_fmt, index=slice(begin, end, step))
for atoms in frames:
symbols = atoms.get_chemical_symbols()
atom_names = list(set(symbols))