Skip to content

Commit 27854e4

Browse files
authored
Merge pull request #1 from deepmodeling/master
master branch update
2 parents 9528a5a + 4002aa5 commit 27854e4

File tree

99 files changed

+5869
-3301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+5869
-3301
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ dist
2323
.eggs
2424
_version.py
2525
venv*
26+
.vscode/**
27+
_build
28+
_templates

.travis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,30 @@ jobs:
6666
env:
6767
- CC=gcc-5
6868
- CXX=g++-5
69-
- TENSORFLOW_VERSION=2.1
69+
- TENSORFLOW_VERSION=2.3
7070
- python: 3.7
7171
env:
7272
- CC=gcc-8
7373
- CXX=g++-8
74-
- TENSORFLOW_VERSION=2.1
74+
- TENSORFLOW_VERSION=2.3
7575
- stage: build whls
7676
services: docker
7777
env:
7878
- TWINE_USERNAME=__token__
7979
- CIBW_BUILD="cp36-* cp37-*"
80-
- CIBW_BEFORE_BUILD="pip install tensorflow && sed -i 's/libresolv.so.2\"/libresolv.so.2\", \"libtensorflow_framework.so.2\"/g' \$(find / -name policy.json)"
80+
- CIBW_BEFORE_BUILD="sed -i 's/libresolv.so.2\"/libresolv.so.2\", \"libtensorflow_framework.so.2\"/g' \$(find / -name policy.json)"
8181
- CIBW_SKIP="*-win32 *-manylinux_i686"
8282
- CC=gcc-7
8383
- CXX=g++-7
84-
- TENSORFLOW_VERSION=2.1
84+
- TENSORFLOW_VERSION=2.3
8585
install:
86-
- python -m pip install twine cibuildwheel==1.1.0 scikit-build setuptools_scm
86+
- python -m pip install twine cibuildwheel==1.6.3 scikit-build setuptools_scm
8787
script:
8888
- python -m cibuildwheel --output-dir wheelhouse
8989
- python setup.py sdist
9090
after_success:
9191
- if [[ $TRAVIS_TAG ]]; then python -m twine upload wheelhouse/*; python -m twine upload dist/*.tar.gz; fi
92-
before_install:
93-
#- pip install --upgrade pip
94-
- pip install --upgrade setuptools
95-
- pip install tensorflow==$TENSORFLOW_VERSION
9692
install:
97-
- pip install --verbose .[test]
93+
- pip install .[cpu,test]
9894
script:
9995
- cd source/tests && python -m unittest

README.md

Lines changed: 15 additions & 534 deletions
Large diffs are not rendered by default.

data/json/json2yaml.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env python3
2+
3+
import argparse
4+
import json
5+
from pathlib import Path
6+
from warnings import warn
7+
8+
import yaml
9+
10+
11+
def _main():
12+
parser = argparse.ArgumentParser(
13+
description="convert json config file to yaml",
14+
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
15+
16+
# get all json files in dir
17+
jsons = [p for p in Path.cwd().glob("*.json")]
18+
# use the newest as autosuggestion
19+
jsons.sort(key=lambda x: x.stat().st_mtime, reverse=True)
20+
jfile = jsons[0]
21+
yfile = jfile.with_suffix(".yaml")
22+
23+
parser.add_argument("INPUT", default=jfile, type=Path, nargs="?",
24+
help="input json file")
25+
parser.add_argument("OUTPUT", default=yfile, type=Path, nargs="?",
26+
help="output yaml file")
27+
args = parser.parse_args()
28+
29+
with args.INPUT.open("r") as infile, args.OUTPUT.open("w") as outfile:
30+
yaml.dump(json.load(infile), outfile, default_flow_style=False,
31+
sort_keys=False)
32+
33+
warn("The order of the keys won't be preserved!", SyntaxWarning)
34+
warn("_comment keys will also be lostt in the conversion")
35+
36+
if __name__ == "__main__":
37+
_main()

doc/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

doc/_static/css/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pre{
2+
overflow: auto;
3+
}

doc/api.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
DeePMD-kit API
2+
===============
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:caption: Contents:
7+
8+
.. automodule:: deepmd.Data
9+
:members:
10+
:undoc-members:
11+
12+
.. automodule:: deepmd.DataModifier
13+
:members:
14+
:undoc-members:
15+
16+
.. automodule:: deepmd.DataSystem
17+
:members:
18+
:undoc-members:
19+
20+
.. automodule:: deepmd.DeepDipole
21+
:members:
22+
:undoc-members:
23+
24+
.. automodule:: deepmd.DeepEval
25+
:members:
26+
:undoc-members:
27+
28+
.. automodule:: deepmd.DeepPolar
29+
:members:
30+
:undoc-members:
31+
32+
.. automodule:: deepmd.DeepPot
33+
:members:
34+
:undoc-members:
35+
36+
.. automodule:: deepmd.DeepWFC
37+
:members:
38+
:undoc-members:
39+
40+
.. automodule:: deepmd.DescrptLocFrame
41+
:members:
42+
:undoc-members:
43+
44+
.. automodule:: deepmd.DescrptSeA
45+
:members:
46+
:undoc-members:
47+
48+
.. automodule:: deepmd.DescrptSeAR
49+
:members:
50+
:undoc-members:
51+
52+
.. automodule:: deepmd.DescrptSeR
53+
:members:
54+
:undoc-members:
55+
56+
.. automodule:: deepmd.EwaldRecp
57+
:members:
58+
:undoc-members:
59+
60+
.. automodule:: deepmd.Fitting
61+
:members:
62+
:undoc-members:
63+
64+
.. automodule:: deepmd.LearningRate
65+
:members:
66+
:undoc-members:
67+
68+
.. automodule:: deepmd.Local
69+
:members:
70+
:undoc-members:
71+
72+
.. automodule:: deepmd.Loss
73+
:members:
74+
:undoc-members:
75+
76+
.. automodule:: deepmd.Model
77+
:members:
78+
:undoc-members:
79+
80+
.. automodule:: deepmd.Network
81+
:members:
82+
:undoc-members:
83+
84+
.. automodule:: deepmd.TabInter
85+
:members:
86+
:undoc-members:
87+
88+
.. automodule:: deepmd.Trainer
89+
:members:
90+
:undoc-members:
91+

doc/conf.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'DeePMD-kit'
21+
copyright = '2020, Deep Potential'
22+
author = 'Deep Potential'
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
30+
extensions = [
31+
'recommonmark',
32+
"sphinx_rtd_theme",
33+
'sphinx.ext.autosummary'
34+
]
35+
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ['_templates']
38+
39+
# List of patterns, relative to source directory, that match files and
40+
# directories to ignore when looking for source files.
41+
# This pattern also affects html_static_path and html_extra_path.
42+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
43+
44+
45+
# -- Options for HTML output -------------------------------------------------
46+
47+
# The theme to use for HTML and HTML Help pages. See the documentation for
48+
# a list of builtin themes.
49+
#
50+
html_theme = 'sphinx_rtd_theme'
51+
52+
# Add any paths that contain custom static files (such as style sheets) here,
53+
# relative to this directory. They are copied after the builtin static files,
54+
# so a file named "default.css" will overwrite the builtin "default.css".
55+
html_static_path = ['_static']
56+
html_css_files = ['css/custom.css']
57+
58+
autodoc_default_flags = ['members']
59+
autosummary_generate = True
60+
master_doc = 'index'

doc/index.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.. deepmd-kit documentation master file, created by
2+
sphinx-quickstart on Sat Nov 21 18:36:24 2020.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
DeePMD-kit's documentation
7+
======================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
14+
install
15+
use-deepmd-kit
16+
train-input
17+
lammps-pair-style-deepmd
18+
api
19+
20+
21+
Indices and tables
22+
==================
23+
24+
* :ref:`genindex`
25+
* :ref:`modindex`
26+
* :ref:`search`

0 commit comments

Comments
 (0)