Skip to content

Commit 6e919d0

Browse files
committed
Create documentation
1 parent 4e41e93 commit 6e919d0

File tree

9 files changed

+244
-32
lines changed

9 files changed

+244
-32
lines changed

.github/workflows/document.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: documentation
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
document:
10+
runs-on: ubuntu-24.04
11+
environment:
12+
name: github-pages
13+
url: ${{ steps.deployment.outputs.page_url }}
14+
permissions:
15+
pages: write
16+
id-token: write
17+
steps:
18+
- id: deployment
19+
uses: sphinx-notes/pages@v3
20+
with:
21+
python_version: 3.12
22+
documentation_path: ./docs
23+
requirements_path: ./docs/requirements.txt

.gitignore

Lines changed: 105 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,129 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
13
*.py[cod]
4+
*$py.class
25

36
# C extensions
47
*.so
58

6-
# Packages
7-
*.egg
8-
*.egg-info
9-
*.tar.gz
10-
dist
11-
build
12-
eggs
13-
parts
14-
bin
15-
var
16-
sdist
17-
develop-eggs
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
1826
.installed.cfg
19-
lib
20-
lib64
21-
__pycache__
27+
*.egg
28+
MANIFEST
2229

23-
# Sublime
24-
.sublime-project
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
2535

2636
# Installer logs
2737
pip-log.txt
38+
pip-delete-this-directory.txt
2839

2940
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
3044
.coverage
31-
.tox
45+
.coverage.*
46+
.cache
3247
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
3353

3454
# Translations
3555
*.mo
56+
*.pot
3657

37-
# Mr Developer
38-
.mr.developer.cfg
39-
.project
40-
.pydevproject
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
4163

42-
# Temp files
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
4367

44-
*~
68+
# Scrapy stuff:
69+
.scrapy
4570

46-
# Pipy codes
71+
# Sphinx documentation
72+
docs/_build/
4773

48-
.pypirc
74+
# PyBuilder
75+
target/
4976

50-
examples/reports
51-
examples/features/downloaded_data
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
5279

53-
.cache
54-
.vscode
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/

docs/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)

docs/conf.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
import os, sys
9+
10+
sys.path.insert(0, os.path.abspath("../python_codon_tables/"))
11+
12+
project = "python_codon_tables"
13+
author = "Zulko"
14+
15+
# -- General configuration ---------------------------------------------------
16+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
17+
18+
extensions = []
19+
20+
templates_path = ["_templates"]
21+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
22+
23+
extensions = [
24+
"sphinx.ext.autodoc",
25+
"sphinx.ext.napoleon",
26+
]
27+
napoleon_numpy_docstring = True
28+
29+
# -- Options for HTML output -------------------------------------------------
30+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
31+
32+
html_theme = "sphinx_rtd_theme"
33+
html_static_path = ["_static"]

docs/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. Python Codon Tables documentation master file, created by
2+
sphinx-quickstart on Fri Mar 28 14:35:51 2025.
3+
4+
Python Codon Tables
5+
===================
6+
7+
`General documentation <https://github.com/Edinburgh-Genome-Foundry/python_codon_tables/>`_
8+
9+
10+
:doc:`API reference <ref>`
11+
12+
13+
----
14+
15+
.. toctree::
16+
:hidden:
17+
:maxdepth: 1
18+
:caption: Python Codon Tables
19+
20+
ref

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/ref.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
API reference
2+
=============
3+
4+
.. automodule:: python_codon_tables
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sphinx_rtd_theme

python_codon_tables/python_codon_tables.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ def get_codons_table(table_name, replace_U_by_T=True, web_timeout=5):
6363
TAA etc.
6464
6565
Returns a dict {"*": {'TAA': 0.64...}, 'K': {'AAA': 0.76...}, ...}
66-
67-
6866
"""
6967
if replace_U_by_T:
7068
table = get_codons_table(table_name, replace_U_by_T=False, web_timeout=5)

0 commit comments

Comments
 (0)