Skip to content

Commit

Permalink
git ignore
Browse files Browse the repository at this point in the history
fix more

workflow

python 3.7

flake8

static typing

more

badges

fix

more

docs

fix

fix

fix

fix

more

badge

add

fix

more

fix

fix

Fix

more

try

fix

fix

fix

fix

fix

fix

more

more

fix

more

tests

fix

fix

fix

fix

fix
  • Loading branch information
zasdfgbnm committed Nov 15, 2019
1 parent fef7226 commit 5be3ca8
Show file tree
Hide file tree
Showing 25 changed files with 653 additions and 97 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: deploy-docs

on:
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme matplotlib pillow sphinx-gallery
pip install -r optional_requirements.txt
pip install .
# build docs
- name: Build documents
run: sphinx-build docs build
# try deploying
- name: Set up environments
run: |
mkdir -p ~/.ssh
echo ${{secrets.zasdfgbnm_bot_private_key}} | base64 -d > ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
echo ${{secrets.zasdfgbnm_bot_public_key}} > ~/.ssh/id_rsa.pub
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git config --global user.email "[email protected]"
git config --global user.name "zasdfgbnm-bot"
- name: Deploy
run: |
git clone [email protected]:aiqm/nnp.git deploy_dir -b gh-pages
rm -rf deploy_dir/*
touch deploy_dir/.nojekyll
cp -r build/* deploy_dir
cd deploy_dir
git add .
git commit -m "update"
git push
27 changes: 27 additions & 0 deletions .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: deploy-pypi

on:
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Deploy
run: |
python -m pip install --upgrade pip twine wheel
rm -rf dist/*
python setup.py bdist bdist_wheel
twine upload -u zasdfgbnm-bot -p ${{secrets.zasdfgbnm_bot_pypi_password}} dist/*
32 changes: 32 additions & 0 deletions .github/workflows/deploy-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: deploy-test-pypi

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Deploy
run: |
python -m pip install --upgrade pip twine wheel
rm -rf dist/*
git tag $(date +'v%Y.%m.%d.%H.%M.%S')
python setup.py bdist bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ -u zasdfgbnm-bot -p ${{secrets.zasdfgbnm_bot_test_pypi_password}} dist/*
53 changes: 53 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: docs

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme matplotlib pillow sphinx-gallery
pip install -r optional_requirements.txt
pip install .
# build docs
- name: Build documents
run: sphinx-build docs build
# try deploying to aiqm/nnp-test-docs
- name: Set up environments
run: |
mkdir -p ~/.ssh
echo ${{secrets.zasdfgbnm_bot_private_key}} | base64 -d > ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
echo ${{secrets.zasdfgbnm_bot_public_key}} > ~/.ssh/id_rsa.pub
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git config --global user.email "[email protected]"
git config --global user.name "zasdfgbnm-bot"
- name: Deploy
run: |
git clone [email protected]:aiqm/nnp-test-docs.git deploy_dir -b gh-pages
rm -rf deploy_dir/*
touch deploy_dir/.nojekyll
cp -r build/* deploy_dir
cd deploy_dir
git add .
git commit -m "update"
git push --force || true
30 changes: 30 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: flake8

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
run: |
pip install --upgrade pip flake8
pip install .
flake8 .
30 changes: 30 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: mypy

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Type checking with mypy
run: |
pip install --upgrade pip mypy
pip install .
mypy --ignore-missing-imports .
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: test

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Run tests
run: |
pip install -r optional_requirements.txt
pip install .
pytest
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/dist
/.eggs
/nnp.egg-info
/.mypy_cache
/.vscode
/build
/docs/examples
/docs/code
*.pyc
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2018- Xiang Gao and other ANI developers

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Still WIP

Status:

[![Actions Status](https://github.com/aiqm/nnp/workflows/flake8/badge.svg)](https://github.com/aiqm/nnp/actions)
[![Actions Status](https://github.com/aiqm/nnp/workflows/mypy/badge.svg)](https://github.com/aiqm/nnp/actions)
[![Actions Status](https://github.com/aiqm/nnp/workflows/docs/badge.svg)](https://github.com/aiqm/nnp/actions)
[![Actions Status](https://github.com/aiqm/nnp/workflows/test/badge.svg)](https://github.com/aiqm/nnp/actions)
[![Actions Status](https://github.com/aiqm/nnp/workflows/deploy-test-pypi/badge.svg)](https://github.com/aiqm/nnp/actions)
[![Actions Status](https://github.com/aiqm/nnp/workflows/deploy-pypi/badge.svg)](https://github.com/aiqm/nnp/actions)
[![Actions Status](https://github.com/aiqm/nnp/workflows/deploy-docs/badge.svg)](https://github.com/aiqm/nnp/actions)

examples are also tests
library is also docs
6 changes: 6 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. automodule:: nnp.pbc
:members:
.. automodule:: nnp.md
:members:
.. automodule:: nnp.vib
:members:
59 changes: 59 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import nnp # noqa: F401
import sphinx_rtd_theme

project = 'NNP'
copyright = '2019, Xiang Gao'
author = 'Xiang Gao'

version = nnp.__version__
release = nnp.__version__

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx_gallery.gen_gallery',
]

templates_path = ['_templates']
html_static_path = []

source_suffix = '.rst'
master_doc = 'index'
pygments_style = 'sphinx'
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
htmlhelp_basename = 'NNPdoc'
# Temporary fix for bug in HTML5 support in the RTD theme
html4_writer = True

sphinx_gallery_conf = {
'examples_dirs': ['../tests/', '../nnp/'],
'gallery_dirs': ['examples', 'code'],
'filename_pattern': r'.*\.py'
}

intersphinx_mapping = {
'python': ('https://docs.python.org/', None),
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'torch': ('https://pytorch.org/docs/master/', None),
'ase': ('https://wiki.fysik.dtu.dk/ase/', None),
}

latex_documents = [
(master_doc, 'NNP.tex', 'NNP Documentation',
'Xiang Gao', 'manual'),
]

man_pages = [
(master_doc, 'torchani', 'TorchANI Documentation',
[author], 1)
]

texinfo_documents = [
(master_doc, 'TorchANI', 'TorchANI Documentation',
author, 'TorchANI', 'One line description of project.',
'Miscellaneous'),
]
34 changes: 34 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
===============================
Welcome to NNP's documentation!
===============================

.. toctree::
:maxdepth: 2
:caption: Getting Started

start

.. toctree::
:maxdepth: 2
:caption: Examples

examples/index

.. toctree::
:maxdepth: 2
:caption: API

api

.. toctree::
:maxdepth: 2
:caption: Implementation Walkthrough

code/index

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading

0 comments on commit 5be3ca8

Please sign in to comment.