File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ from importlib import import_module
4+ from typing import TYPE_CHECKING
5+
36from .bond_order_system import BondOrderSystem
47from .formats import lammps , md , vasp
58from .system import LabeledSystem , MultiSystems , System
912except ImportError :
1013 from .__about__ import __version__
1114
15+ if TYPE_CHECKING :
16+ from . import cp2k , gaussian , qe
17+
18+ _FORMAT_MODULES = {"cp2k" , "gaussian" , "qe" }
19+
20+
21+ def __getattr__ (name : str ):
22+ if name in _FORMAT_MODULES :
23+ module = import_module (f"dpdata.formats.{ name } " )
24+ globals ()[name ] = module
25+ return module
26+ raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
27+
28+
1229__all__ = [
1330 "__version__" ,
31+ "cp2k" ,
32+ "gaussian" ,
1433 "lammps" ,
1534 "md" ,
35+ "qe" ,
1636 "vasp" ,
1737 "System" ,
1838 "LabeledSystem" ,
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ from . import cell , output
4+
5+ __all__ = ["cell" , "output" ]
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ from . import fchk , gjf , log
4+
5+ __all__ = ["fchk" , "gjf" , "log" ]
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ from . import scf , traj
4+
5+ __all__ = ["scf" , "traj" ]
You can’t perform that action at this time.
0 commit comments