Skip to content

Commit 44634eb

Browse files
authored
Merge pull request #22 from maximilianvz/sphinx_docs
Create Sphinx Documentation Site
2 parents 0f566b7 + cfaa757 commit 44634eb

33 files changed

+1189
-734
lines changed

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 4
9+
max_line_length = 100
10+
11+
[Makefile]
12+
indent_style = tab
13+
14+
[{*.json,*.yml,*.yaml}]
15+
indent_style = space
16+
indent_size = 2

.github/workflows/website.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: build_website
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: write
10+
deployments: write
11+
pages: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
contents: write
19+
deployments: write
20+
pages: write
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- name: Install development and distributions version
26+
run: |
27+
pip install --upgrade pip
28+
pip install .[doc]
29+
pip install pypandoc_binary
30+
31+
- name: Setup pandoc
32+
uses: siacodelabs/setup-pandoc@v1
33+
with:
34+
xelatex: true.
35+
36+
# didn't need to change anything here, but had to add sphinx.ext.githubpages
37+
# to my conf.py extensions list. that fixes the broken uploads
38+
- name: Building documentation
39+
run: |
40+
sphinx-apidoc -a -o ./docs/source/pyapi/ ./atomdb/ ./atomdb/test/ ./atomdb/data/ ./atomdb/datasets/ --separate
41+
sphinx-build -M html docs/source _build
42+
43+
# still need to build and set the PAT to get a rebuild on the pages job,
44+
# apart from that quite clean and nice
45+
- name: GitHub Pages Action
46+
#if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
47+
uses: peaceiris/actions-gh-pages@v3
48+
with:
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
publish_dir: _build/html
51+
publish_branch: gh-pages
52+
cname: atomdb.qcdevs.org

.pre-commit-config.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
files: "atomdb/"
2+
exclude: "examples/"
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: check-added-large-files # prevents giant files from being commit
8+
- id: check-ast # Check whether files parse as valid python.
9+
- id: check-case-conflict # Checks conflict case-insensitive
10+
- id: check-executables-have-shebangs
11+
- id: check-json
12+
- id: check-merge-conflict
13+
- id: check-symlinks # Check for symlinks which don't point
14+
- id: check-toml
15+
- id: check-vcs-permalinks
16+
- id: debug-statements # Check for debugger imports and py37 breakpt
17+
- id: detect-private-key # Checks for the existence of private keys.
18+
- id: destroyed-symlinks
19+
- id: end-of-file-fixer # Makes sure files end in a newline
20+
- id: fix-byte-order-marker # Removes UTF-8 byte order marker
21+
- id: mixed-line-ending # Replaces or checks mixed line ending.
22+
- id: pretty-format-json # Checks JSON are pretty
23+
args: ["--autofix", "--no-sort-keys"]
24+
- id: trailing-whitespace # Trims trailing whitespace.
25+
- repo: https://github.com/Lucas-C/pre-commit-hooks
26+
rev: v1.5.4
27+
hooks:
28+
- id: remove-crlf
29+
- repo: https://github.com/psf/black
30+
rev: 24.1.1
31+
hooks:
32+
- id: black
33+
- repo: https://github.com/astral-sh/ruff-pre-commit
34+
rev: 'v0.1.14'
35+
hooks:
36+
- id: ruff
37+
- repo: https://github.com/python-jsonschema/check-jsonschema
38+
rev: 0.27.3
39+
hooks:
40+
- id: check-github-workflows

MANIFEST.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
include LICENSE
22
include README.rst
33

4-
include atomdb/datasets/*/data/*
5-
include atomdb/datasets/*/raw_data/*
4+
include atomdb/datasets/*/db/*

atomdb/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
from atomdb.promolecule import *
2626

27+
from atomdb.periodic import *
28+
2729

2830
__version__ = version
2931
r"""AtomDB version string."""

atomdb/__main__.py

+4-14
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,12 @@
2424

2525

2626
# Initialize command line argument parser
27-
parser = ArgumentParser(
28-
prog="python -m atomdb", description="Compile and/or query an AtomDB entry"
29-
)
27+
parser = ArgumentParser(prog="python -m atomdb", description="Compile and/or query an AtomDB entry")
3028

3129

3230
# Specify positional arguments and options
33-
parser.add_argument(
34-
"-c", action="store_true", default=False, help="compile the specified entry"
35-
)
36-
parser.add_argument(
37-
"-q", action="store_true", default=False, help="query the specified entry"
38-
)
31+
parser.add_argument("-c", action="store_true", default=False, help="compile the specified entry")
32+
parser.add_argument("-q", action="store_true", default=False, help="query the specified entry")
3933
parser.add_argument("dataset", type=str, help="name of dataset")
4034
parser.add_argument("elem", type=str, help="element symbol")
4135
parser.add_argument("charge", type=int, help="charge")
@@ -57,11 +51,7 @@
5751
if args.c:
5852
atomdb.compile(args.elem, args.charge, args.mult, args.e, args.dataset)
5953
if args.q:
60-
print(
61-
atomdb.load(
62-
args.elem, args.charge, args.mult, args.e, args.dataset
63-
).to_json()
64-
)
54+
print(atomdb.load(args.elem, args.charge, args.mult, args.e, args.dataset).to_json())
6555

6656
# Exit successfully
6757
exit(0)

0 commit comments

Comments
 (0)