Skip to content

Commit 4ca3706

Browse files
committed
fix typo, add docs
1 parent 3967210 commit 4ca3706

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,14 @@ print(syst.get_charge()) # return the total charge of the system
252252
```
253253

254254
If a valence of 3 is detected on carbon, the formal charge will be assigned to -1. Because for most cases (in alkynyl anion, isonitrile, cyclopentadienyl anion), the formal charge on 3-valence carbon is -1, and this is also consisent with the 8-electron rule.
255+
256+
# Plugins
257+
258+
One can follow [a simple example](plugin_example/) to add their own format by creating and installing plugins. It's crirical to add the [Format](dpdata/format.py) class to `entry_points['dpdata.plugins']` in `setup.py`:
259+
```py
260+
entry_points={
261+
'dpdata.plugins': [
262+
'random=dpdata_random:RandomFormat'
263+
]
264+
},
265+
```

dpdata/plugins/gromacs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@Format.register("gro")
66
@Format.register("gromacs/gro")
7-
class PwmatOutputFormat(Format):
7+
class GromacsGroFormat(Format):
88
def from_system(self, file_name, format_atom_name=True, **kwargs):
99
"""
1010
Load gromacs .gro file

dpdata/plugins/xyz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@Format.register("quip/gap/xyz")
66
@Format.register("quip/gap/xyz_file")
7-
class DeePMDRawFormat(Format):
7+
class QuipGapXYZFormat(Format):
88
def from_labeled_system(self, data, **kwargs):
99
return data
1010

plugin_example/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ print(dpdata.System(12, fmt="random"))
1111

1212
The output is
1313

14-
> Data Summary
15-
> Unlabeled System
16-
> -------------------
17-
> Frame Numbers : 12
18-
> Atom Numbers : 20
19-
> Element List :
20-
> -------------------
21-
> X
22-
> 20
14+
```
15+
Data Summary
16+
Unlabeled System
17+
-------------------
18+
Frame Numbers : 12
19+
Atom Numbers : 20
20+
Element List :
21+
-------------------
22+
X
23+
20
24+
```

0 commit comments

Comments
 (0)