Skip to content

Commit aec7747

Browse files
authored
Correct the headers in README.md (#424)
1 parent d622c95 commit aec7747

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
dpdata only works with python 3.7 or above.
33

44

5-
# Installation
5+
## Installation
66
One can download the source code of dpdata by
77
```bash
88
git clone https://github.com/deepmodeling/dpdata.git dpdata
@@ -19,7 +19,7 @@ pip install dpdata
1919
```
2020

2121

22-
# Quick start
22+
## Quick start
2323

2424
This section gives some examples on how dpdata works. Firstly one needs to import the module in a python 3.x compatible code.
2525
```python
@@ -32,7 +32,7 @@ The typicall workflow of `dpdata` is
3232
3. Dump data to in a desired format
3333

3434

35-
## Load data
35+
### Load data
3636
```python
3737
d_poscar = dpdata.System("POSCAR", fmt="vasp/poscar")
3838
```
@@ -150,7 +150,7 @@ ms.to_deepmd_raw("deepmd")
150150
ms.to_deepmd_npy("deepmd")
151151
```
152152

153-
## Access data
153+
### Access data
154154
These properties stored in `System` and `LabeledSystem` can be accessed by operator `[]` with the key of the property supplied, for example
155155
```python
156156
coords = d_outcar["coords"]
@@ -169,7 +169,7 @@ Available properties are (nframe: number of frames in the system, natoms: total
169169
| 'virials' | np.ndarray | nframes x 3 x 3 | True | The virial tensor of each frame
170170

171171

172-
## Dump data
172+
### Dump data
173173
The data stored in `System` or `LabeledSystem` can be dumped in 'lammps/lmp' or 'vasp/poscar' format, for example:
174174
```python
175175
d_outcar.to("lammps/lmp", "conf.lmp", frame_idx=0)
@@ -195,7 +195,7 @@ dpdata.LabeledSystem("OUTCAR").sub_system([0, -1]).to("deepmd/raw", "dpmd_raw")
195195
by which only the first and last frames are dumped to `dpmd_raw`.
196196

197197

198-
## replicate
198+
### replicate
199199
dpdata will create a super cell of the current atom configuration.
200200
```python
201201
dpdata.System("./POSCAR").replicate(
@@ -209,7 +209,7 @@ dpdata.System("./POSCAR").replicate(
209209
tuple(1,2,3) means don't copy atom configuration in x direction, make 2 copys in y direction, make 3 copys in z direction.
210210

211211

212-
## perturb
212+
### perturb
213213
By the following example, each frame of the original system (`dpdata.System('./POSCAR')`) is perturbed to generate three new frames. For each frame, the cell is perturbed by 5% and the atom positions are perturbed by 0.6 Angstrom. `atom_pert_style` indicates that the perturbation to the atom positions is subject to normal distribution. Other available options to `atom_pert_style` are`uniform` (uniform in a ball), and `const` (uniform on a sphere).
214214
```python
215215
perturbed_system = dpdata.System("./POSCAR").perturb(
@@ -221,15 +221,15 @@ perturbed_system = dpdata.System("./POSCAR").perturb(
221221
print(perturbed_system.data)
222222
```
223223

224-
## replace
224+
### replace
225225
By the following example, Random 8 Hf atoms in the system will be replaced by Zr atoms with the atom postion unchanged.
226226
```python
227227
s = dpdata.System("tests/poscars/POSCAR.P42nmc", fmt="vasp/poscar")
228228
s.replace("Hf", "Zr", 8)
229229
s.to_vasp_poscar("POSCAR.P42nmc.replace")
230230
```
231231

232-
# BondOrderSystem
232+
## BondOrderSystem
233233
A new class `BondOrderSystem` which inherits from class `System` is introduced in dpdata. This new class contains information of chemical bonds and formal charges (stored in `BondOrderSystem.data['bonds']`, `BondOrderSystem.data['formal_charges']`). Now BondOrderSystem can only read from .mol/.sdf formats, because of its dependency on rdkit (which means rdkit must be installed if you want to use this function). Other formats, such as pdb, must be converted to .mol/.sdf format (maybe with software like open babel).
234234
```python
235235
import dpdata
@@ -254,7 +254,7 @@ AllChem.EmbedMultipleConfs(mol, 10)
254254
system = dpdata.BondOrderSystem(rdkit_mol=mol)
255255
```
256256

257-
## Bond Order Assignment
257+
### Bond Order Assignment
258258
The `BondOrderSystem` implements a more robust sanitize procedure for rdkit Mol, as defined in `dpdata.rdkit.santizie.Sanitizer`. This class defines 3 level of sanitization process by: low, medium and high. (default is medium).
259259
+ low: use `rdkit.Chem.SanitizeMol()` function to sanitize molecule.
260260
+ medium: before using rdkit, the programm will first assign formal charge of each atom to avoid inappropriate valence exceptions. However, this mode requires the rightness of the bond order information in the given molecule.
@@ -268,7 +268,7 @@ import dpdata
268268
for sdf_file in glob.glob("bond_order/refined-set-ligands/obabel/*sdf"):
269269
syst = dpdata.BondOrderSystem(sdf_file, sanitize_level="high", verbose=False)
270270
```
271-
## Formal Charge Assignment
271+
### Formal Charge Assignment
272272
BondOrderSystem implement a method to assign formal charge for each atom based on the 8-electron rule (see below). Note that it only supports common elements in bio-system: B,C,N,O,P,S,As
273273
```python
274274
import dpdata
@@ -304,7 +304,7 @@ import dpdata
304304
dpdata.MultiSystems().load_systems_from_file("mixed_dir", fmt="deepmd/npy/mixed")
305305
```
306306

307-
# Plugins
307+
## Plugins
308308

309309
One can follow [a simple example](plugin_example/) to add their own format by creating and installing plugins. It's critical to add the [Format](dpdata/format.py) class to `entry_points['dpdata.plugins']` in [`pyproject.toml`](plugin_example/pyproject.toml):
310310
```toml

0 commit comments

Comments
 (0)