Skip to content

Commit

Permalink
Merge pull request #22 from maximilianvz/sphinx_docs
Browse files Browse the repository at this point in the history
Create Sphinx Documentation Site
  • Loading branch information
gabrielasd authored Feb 13, 2024
2 parents 184a693 + b6922a9 commit fecdd2d
Show file tree
Hide file tree
Showing 33 changed files with 1,189 additions and 734 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
max_line_length = 100

[Makefile]
indent_style = tab

[{*.json,*.yml,*.yaml}]
indent_style = space
indent_size = 2
52 changes: 52 additions & 0 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: build_website

on:
push:
branches:
- master

permissions:
contents: write
deployments: write
pages: write

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write
deployments: write
pages: write

steps:
- uses: actions/checkout@v3

- name: Install development and distributions version
run: |
pip install --upgrade pip
pip install .[doc]
pip install pypandoc_binary
- name: Setup pandoc
uses: siacodelabs/setup-pandoc@v1
with:
xelatex: true.

# didn't need to change anything here, but had to add sphinx.ext.githubpages
# to my conf.py extensions list. that fixes the broken uploads
- name: Building documentation
run: |
sphinx-apidoc -a -o ./docs/source/pyapi/ ./atomdb/ ./atomdb/test/ ./atomdb/data/ ./atomdb/datasets/ --separate
sphinx-build -M html docs/source _build
# still need to build and set the PAT to get a rebuild on the pages job,
# apart from that quite clean and nice
- name: GitHub Pages Action
#if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html
publish_branch: gh-pages
cname: atomdb.qcdevs.org
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
files: "atomdb/"
exclude: "examples/"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files # prevents giant files from being commit
- id: check-ast # Check whether files parse as valid python.
- id: check-case-conflict # Checks conflict case-insensitive
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks # Check for symlinks which don't point
- id: check-toml
- id: check-vcs-permalinks
- id: debug-statements # Check for debugger imports and py37 breakpt
- id: detect-private-key # Checks for the existence of private keys.
- id: destroyed-symlinks
- id: end-of-file-fixer # Makes sure files end in a newline
- id: fix-byte-order-marker # Removes UTF-8 byte order marker
- id: mixed-line-ending # Replaces or checks mixed line ending.
- id: pretty-format-json # Checks JSON are pretty
args: ["--autofix", "--no-sort-keys"]
- id: trailing-whitespace # Trims trailing whitespace.
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: remove-crlf
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.14'
hooks:
- id: ruff
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.3
hooks:
- id: check-github-workflows
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include LICENSE
include README.rst

include atomdb/datasets/*/data/*
include atomdb/datasets/*/raw_data/*
include atomdb/datasets/*/db/*
2 changes: 2 additions & 0 deletions atomdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

from atomdb.promolecule import *

from atomdb.periodic import *


__version__ = version
r"""AtomDB version string."""
18 changes: 4 additions & 14 deletions atomdb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@


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


# Specify positional arguments and options
parser.add_argument(
"-c", action="store_true", default=False, help="compile the specified entry"
)
parser.add_argument(
"-q", action="store_true", default=False, help="query the specified entry"
)
parser.add_argument("-c", action="store_true", default=False, help="compile the specified entry")
parser.add_argument("-q", action="store_true", default=False, help="query the specified entry")
parser.add_argument("dataset", type=str, help="name of dataset")
parser.add_argument("elem", type=str, help="element symbol")
parser.add_argument("charge", type=int, help="charge")
Expand All @@ -57,11 +51,7 @@
if args.c:
atomdb.compile(args.elem, args.charge, args.mult, args.e, args.dataset)
if args.q:
print(
atomdb.load(
args.elem, args.charge, args.mult, args.e, args.dataset
).to_json()
)
print(atomdb.load(args.elem, args.charge, args.mult, args.e, args.dataset).to_json())

# Exit successfully
exit(0)
Loading

0 comments on commit fecdd2d

Please sign in to comment.