deepmd.common#
Attributes#
Functions#
| Build map of indices for element supplied element types from all atoms list. |
| Make mesh. |
| Load yaml or json settings file. |
| Recursively iterate over directories taking those that contain type.raw file. |
| Get numpy precision constant from string. |
Module Contents#
- deepmd.common.select_idx_map(atom_types: numpy.ndarray, select_types: numpy.ndarray) numpy.ndarray[source]#
Build map of indices for element supplied element types from all atoms list.
- Parameters:
- atom_types
np.ndarray array specifying type for each atoms as integer
- select_types
np.ndarray types of atoms you want to find indices for
- atom_types
- Returns:
np.ndarrayindices of types of atoms defined by select_types in atom_types array
Warning
select_types array will be sorted before finding indices in atom_types
- deepmd.common.make_default_mesh(pbc: bool, mixed_type: bool) numpy.ndarray[source]#
Make mesh.
Only the size of mesh matters, not the values: * 6 for PBC, no mixed types * 0 for no PBC, no mixed types * 7 for PBC, mixed types * 1 for no PBC, mixed types
- Parameters:
- Returns:
np.ndarraymesh
- deepmd.common.j_loader(filename: str | pathlib.Path) dict[str, Any][source]#
Load yaml or json settings file.
- deepmd.common.expand_sys_str(root_dir: str | pathlib.Path) list[str][source]#
Recursively iterate over directories taking those that contain type.raw file.
- deepmd.common.get_np_precision(precision: _PRECISION) numpy.dtype[source]#
Get numpy precision constant from string.
- Parameters:
- precision
_PRECISION string name of numpy constant or default
- precision
- Returns:
np.dtypenumpy precision constant
- Raises:
RuntimeErrorif string is invalid