Skip to content

Commit aeddaf2

Browse files
authored
Merge pull request #20 from lverweijen/package
Modernize package setup
2 parents 3a747b9 + f04c2a2 commit aeddaf2

Some content is hidden

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

42 files changed

+647
-75
lines changed

.github/workflows/sphinx.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Sphinx: Render docs"
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
id-token: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Build HTML
14+
uses: ammaraskar/sphinx-action@dev
15+
- name: Upload artifacts
16+
uses: actions/upload-artifact@v4
17+
with:
18+
name: html-docs
19+
path: docs/build/html/
20+
- name: Deploy
21+
uses: peaceiris/actions-gh-pages@v3
22+
if: github.ref == 'refs/heads/main'
23+
with:
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
publish_dir: docs/build/html

.gitignore

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
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+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116+
.pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
#.idea/
169+
170+
# PyPI configuration file
171+
.pypirc
172+
173+
.idea

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ print(table_result)
4545
```
4646

4747
Change `C:\Users\User\Programs\TauArgus4.2.0b5\TauArgus.exe` to the location where argus is installed.
48-
See [tutorial](https://github.com/lverweijen/tree/main/tutorial.md) for a general introduction.
48+
See [tutorial](https://lverweijen.github.io/piargus/tutorial.html) for a general introduction.
4949
See [Examples](https://github.com/lverweijen/tree/main/examples) for more examples.
5050

5151
## See also

docs/Makefile

+20
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 = source
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/make.bat

+35
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=source
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/requirements.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sphinx-rtd-theme>=3.0.2
2+
myst-parser>=3.0.1
3+
myst>=1.0.4
4+
sphinxcontrib-mermaid>=1.0.0
5+
pandas>=1.5
6+
littletree>=0.6.2

docs/source/api.rst

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
===
2+
API
3+
===
4+
5+
Input Specification
6+
===================
7+
8+
Input data
9+
----------
10+
.. automodule:: piargus.inputspec
11+
:members: InputData, MetaData, MicroData, TableData, CodeList
12+
:show-inheritance:
13+
14+
Hierarchies
15+
-----------
16+
.. automodule:: piargus.inputspec.hierarchy
17+
:members: Hierarchy, TreeHierarchy, FlatHierarchy, LevelHierarchy, TreeHierarchyNode
18+
:show-inheritance:
19+
20+
Output Specification
21+
====================
22+
23+
Tables
24+
------
25+
.. automodule:: piargus.outputspec
26+
:members: Table, Apriori, TreeRecode
27+
:show-inheritance:
28+
29+
Safety rule
30+
-----------
31+
.. automodule:: piargus
32+
:members: dominance_rule, percent_rule, frequency_rule, request_rule, zero_rule, missing_rule, weight_rule, manual_rule, p_rule, nk_rule,
33+
:show-inheritance:
34+
35+
Result
36+
======
37+
.. automodule:: piargus
38+
:members: ArgusReport, TableResult
39+
:show-inheritance:
40+
41+
Tau-Argus
42+
=========
43+
.. automodule:: piargus
44+
:members: TauArgus, BatchWriter, Job, JobSetupError
45+
:show-inheritance:

changes.md docs/source/changes.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Changelog #
2+
13
## Version 1.0.0 ##
24

35
- Add alias `Node` for `TreeHierarchyNode`.

docs/source/conf.py

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
9+
project = 'PiArgus'
10+
copyright = '2025, Laurent Verweijen'
11+
author = 'Laurent Verweijen'
12+
13+
# -- General configuration ---------------------------------------------------
14+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15+
16+
extensions = [
17+
'sphinx.ext.autodoc',
18+
'sphinx.ext.autosummary',
19+
'sphinx.ext.githubpages',
20+
'sphinx.ext.viewcode',
21+
'myst_parser',
22+
]
23+
24+
templates_path = ['_templates']
25+
exclude_patterns = []
26+
27+
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']
34+
35+
myst_enable_extensions = ["colon_fence"]
36+
37+
# Code is in src. Make sure sphinx can find it
38+
import sys
39+
from pathlib import Path
40+
src_folder = Path(__file__).parent.parent.parent / "src"
41+
sys.path.insert(0, str(src_folder.resolve(strict=True)))

docs/source/index.rst

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.. PiArgus documentation master file, created by
2+
sphinx-quickstart on Tue Jan 7 13:41:10 2025.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to PiArgus' documentation!
7+
==================================
8+
9+
This package provides a python wrapper around `τ-ARGUS <https://research.cbs.nl/casc/tau.htm>`_, a program to protect statistical tables.
10+
This package takes care of generating all the required metadata and runs τ-ARGUS in the background to do the heavy work.
11+
12+
For this package to work, it is required to install τ-ARGUS locally first.
13+
It's also recommended to read the `TauArgus manual <https://research.cbs.nl/casc/Software/TauManualV4.1.pdf>`_ to understand some of the underlying concepts used in this package.
14+
15+
.. toctree::
16+
:maxdepth: 2
17+
:caption: Contents:
18+
19+
installation
20+
tutorial
21+
api
22+
changes
23+
24+
Indices and tables
25+
==================
26+
27+
* :ref:`genindex`
28+
* :ref:`modindex`
29+
* :ref:`search`

0 commit comments

Comments
 (0)