asplain 0.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- asplain-0.0.0/.envrc +10 -0
- asplain-0.0.0/.github/workflows/deploy.yml +48 -0
- asplain-0.0.0/.github/workflows/doc.yml +51 -0
- asplain-0.0.0/.github/workflows/test.yml +38 -0
- asplain-0.0.0/.gitignore +48 -0
- asplain-0.0.0/.pre-commit-config.yaml +35 -0
- asplain-0.0.0/.readthedocs.yaml +14 -0
- asplain-0.0.0/CHANGES.md +5 -0
- asplain-0.0.0/CONTRIBUTING.md +31 -0
- asplain-0.0.0/DEPLOYMENT.md +27 -0
- asplain-0.0.0/DEVELOPMENT.md +63 -0
- asplain-0.0.0/LICENSE +21 -0
- asplain-0.0.0/PKG-INFO +125 -0
- asplain-0.0.0/README.md +57 -0
- asplain-0.0.0/docs/SUMMARY.md +35 -0
- asplain-0.0.0/docs/_custom/css/extra.css +181 -0
- asplain-0.0.0/docs/_custom/css/mkdocstrings.css +50 -0
- asplain-0.0.0/docs/_custom/javascripts/mathjax.js +19 -0
- asplain-0.0.0/docs/_custom/overrides/.icons/potassco-full-logo.svg +21 -0
- asplain-0.0.0/docs/_custom/overrides/.icons/potassco-logo.svg +10 -0
- asplain-0.0.0/docs/_custom/overrides/partials/logo.html +29 -0
- asplain-0.0.0/docs/assets/images/asplain.svg +4 -0
- asplain-0.0.0/docs/assets/images/catdog.svg +4 -0
- asplain-0.0.0/docs/assets/images/dontdrivedrunk.svg +4 -0
- asplain-0.0.0/docs/assets/images/graph_example.svg +98 -0
- asplain-0.0.0/docs/assets/images/jamesbond.svg +4 -0
- asplain-0.0.0/docs/assets/images/potassco-logo-dark.svg +10 -0
- asplain-0.0.0/docs/assets/images/potassco-logo.svg +10 -0
- asplain-0.0.0/docs/assets/images/pt_rgb_green_digital.svg +9 -0
- asplain-0.0.0/docs/assets/images/sudoku.svg +4 -0
- asplain-0.0.0/docs/assets/images/workflow.png +0 -0
- asplain-0.0.0/docs/community/CHANGES.md +11 -0
- asplain-0.0.0/docs/community/CONTRIBUTING.md +5 -0
- asplain-0.0.0/docs/community/DEPLOYMENT.md +5 -0
- asplain-0.0.0/docs/community/DEVELOPMENT.md +5 -0
- asplain-0.0.0/docs/community/index.md +30 -0
- asplain-0.0.0/docs/examples/catdog.md +29 -0
- asplain-0.0.0/docs/examples/dontdrivedrunk.md +23 -0
- asplain-0.0.0/docs/examples/index.md +61 -0
- asplain-0.0.0/docs/examples/jamesbond.md +29 -0
- asplain-0.0.0/docs/examples/sudoku.md +38 -0
- asplain-0.0.0/docs/index.md +51 -0
- asplain-0.0.0/docs/reference/api/index.md +12 -0
- asplain-0.0.0/docs/reference/cli.md +205 -0
- asplain-0.0.0/docs/reference/encodings/index.md +48 -0
- asplain-0.0.0/docs/reference/explanation-graph.md +104 -0
- asplain-0.0.0/docs/reference/foils.md +44 -0
- asplain-0.0.0/docs/reference/index.md +62 -0
- asplain-0.0.0/docs/reference/preferences/index.md +38 -0
- asplain-0.0.0/docs/reference/preferences/model-difference.md +12 -0
- asplain-0.0.0/docs/reference/preferences/penalize-added.md +12 -0
- asplain-0.0.0/docs/reference/preferences/penalize-non-assumptions.md +13 -0
- asplain-0.0.0/docs/reference/preferences/penalize-non-constraints.md +13 -0
- asplain-0.0.0/docs/reference/preferences/penalize-non-facts.md +13 -0
- asplain-0.0.0/docs/reference/preferences/penalize-removed.md +12 -0
- asplain-0.0.0/docs/reference/preferences/program-difference.md +13 -0
- asplain-0.0.0/docs/reference/pruning.md +67 -0
- asplain-0.0.0/docs/reference/setup.md +52 -0
- asplain-0.0.0/docs/reference/tagging.md +170 -0
- asplain-0.0.0/docs/use/help.md +50 -0
- asplain-0.0.0/docs/use/installation.md +22 -0
- asplain-0.0.0/docs/use/quick-start.md +58 -0
- asplain-0.0.0/examples/cat-dog/README.md +29 -0
- asplain-0.0.0/examples/cat-dog/encoding.lp +19 -0
- asplain-0.0.0/examples/cat-dog/instance.lp +6 -0
- asplain-0.0.0/examples/dont_drive_drunk/README.md +39 -0
- asplain-0.0.0/examples/dont_drive_drunk/encoding.lp +35 -0
- asplain-0.0.0/examples/james-bond/README.md +61 -0
- asplain-0.0.0/examples/james-bond/encoding-unsat.lp +27 -0
- asplain-0.0.0/examples/james-bond/encoding.lp +31 -0
- asplain-0.0.0/examples/james-bond/model.lp +2 -0
- asplain-0.0.0/examples/sudoku/BENCHMARK.sh +22 -0
- asplain-0.0.0/examples/sudoku/README.md +55 -0
- asplain-0.0.0/examples/sudoku/dynamic-tags.lp +5 -0
- asplain-0.0.0/examples/sudoku/encoding.lp +37 -0
- asplain-0.0.0/examples/sudoku/instance4x4-no-tags.lp +7 -0
- asplain-0.0.0/examples/sudoku/instance4x4.lp +11 -0
- asplain-0.0.0/examples/sudoku/instance4x4.pdf +0 -0
- asplain-0.0.0/examples/sudoku/instance9x9.lp +60 -0
- asplain-0.0.0/examples/sudoku/instance9x9.pdf +0 -0
- asplain-0.0.0/examples/sudoku/results.txt +168 -0
- asplain-0.0.0/examples/sudoku/viz.lp +17 -0
- asplain-0.0.0/mkdocs.yml +125 -0
- asplain-0.0.0/noxfile.py +59 -0
- asplain-0.0.0/pyproject.toml +89 -0
- asplain-0.0.0/setup.cfg +4 -0
- asplain-0.0.0/src/asplain/__init__.py +287 -0
- asplain-0.0.0/src/asplain/__main__.py +24 -0
- asplain-0.0.0/src/asplain/app.py +485 -0
- asplain-0.0.0/src/asplain/encodings/construct-foil.lp +30 -0
- asplain-0.0.0/src/asplain/encodings/costs/docs.lp +10 -0
- asplain-0.0.0/src/asplain/encodings/costs/model-difference.lp +5 -0
- asplain-0.0.0/src/asplain/encodings/costs/penalize-added.lp +2 -0
- asplain-0.0.0/src/asplain/encodings/costs/penalize-non-assumptions-removed.lp +2 -0
- asplain-0.0.0/src/asplain/encodings/costs/penalize-non-constraint-removed.lp +2 -0
- asplain-0.0.0/src/asplain/encodings/costs/penalize-non-facts-removed.lp +2 -0
- asplain-0.0.0/src/asplain/encodings/costs/penalize-removed.lp +2 -0
- asplain-0.0.0/src/asplain/encodings/costs/program-difference.lp +5 -0
- asplain-0.0.0/src/asplain/encodings/dynamic-tags/removable-assumptions.lp +2 -0
- asplain-0.0.0/src/asplain/encodings/force-model.lp +5 -0
- asplain-0.0.0/src/asplain/encodings/model-subgraph.lp +17 -0
- asplain-0.0.0/src/asplain/encodings/pruning/change.lp +2 -0
- asplain-0.0.0/src/asplain/encodings/pruning/changes.lp +12 -0
- asplain-0.0.0/src/asplain/encodings/pruning/inclusion_filter.lp +26 -0
- asplain-0.0.0/src/asplain/encodings/pruning/orphans.lp +11 -0
- asplain-0.0.0/src/asplain/encodings/pruning/path_test.lp +20 -0
- asplain-0.0.0/src/asplain/encodings/pruning/paths.lp +38 -0
- asplain-0.0.0/src/asplain/encodings/pruning/paths_undirected.lp +37 -0
- asplain-0.0.0/src/asplain/encodings/reify-to-pg.lp +75 -0
- asplain-0.0.0/src/asplain/encodings/show.lp +23 -0
- asplain-0.0.0/src/asplain/encodings/ui.lp +639 -0
- asplain-0.0.0/src/asplain/encodings/utils-tags.lp +19 -0
- asplain-0.0.0/src/asplain/encodings/viz-pg.lp +108 -0
- asplain-0.0.0/src/asplain/llm/__init__.py +0 -0
- asplain-0.0.0/src/asplain/llm/models/__init__.py +7 -0
- asplain-0.0.0/src/asplain/llm/models/base.py +32 -0
- asplain-0.0.0/src/asplain/llm/models/google.py +42 -0
- asplain-0.0.0/src/asplain/llm/models/openai.py +60 -0
- asplain-0.0.0/src/asplain/llm/models/tags.py +27 -0
- asplain-0.0.0/src/asplain/llm/templates/__init__.py +8 -0
- asplain-0.0.0/src/asplain/llm/templates/base.py +15 -0
- asplain-0.0.0/src/asplain/llm/templates/explain.py +36 -0
- asplain-0.0.0/src/asplain/llm/templates/prompt_templates/explain_input.txt +4 -0
- asplain-0.0.0/src/asplain/llm/templates/prompt_templates/explain_instructions.txt +294 -0
- asplain-0.0.0/src/asplain/llm/utils/__init__.py +8 -0
- asplain-0.0.0/src/asplain/llm/utils/graph.py +216 -0
- asplain-0.0.0/src/asplain/llm/utils/parsing.py +21 -0
- asplain-0.0.0/src/asplain/llm/utils/predicates.py +106 -0
- asplain-0.0.0/src/asplain/pruning/__init__.py +0 -0
- asplain-0.0.0/src/asplain/pruning/pruners.py +127 -0
- asplain-0.0.0/src/asplain/py.typed +0 -0
- asplain-0.0.0/src/asplain/ui/backend.py +416 -0
- asplain-0.0.0/src/asplain/utils/__init__.py +3 -0
- asplain-0.0.0/src/asplain/utils/clingo.py +166 -0
- asplain-0.0.0/src/asplain/utils/logging.py +135 -0
- asplain-0.0.0/src/asplain/utils/node-count.lp +10 -0
- asplain-0.0.0/src/asplain/utils/parser.py +53 -0
- asplain-0.0.0/src/asplain/utils/viz.py +48 -0
- asplain-0.0.0/src/asplain.egg-info/PKG-INFO +125 -0
- asplain-0.0.0/src/asplain.egg-info/SOURCES.txt +146 -0
- asplain-0.0.0/src/asplain.egg-info/dependency_links.txt +1 -0
- asplain-0.0.0/src/asplain.egg-info/entry_points.txt +2 -0
- asplain-0.0.0/src/asplain.egg-info/requires.txt +39 -0
- asplain-0.0.0/src/asplain.egg-info/top_level.txt +1 -0
- asplain-0.0.0/tests/__init__.py +0 -0
- asplain-0.0.0/tests/py.typed +0 -0
- asplain-0.0.0/tests/test_contrast.py +16 -0
- asplain-0.0.0/tests/test_main.py +315 -0
asplain-0.0.0/.envrc
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# automatically activate dev environment when in project tree using direnv.
|
|
2
|
+
ACT=.nox/dev/bin/activate
|
|
3
|
+
|
|
4
|
+
if [ -e $ACT ]
|
|
5
|
+
then
|
|
6
|
+
source $ACT
|
|
7
|
+
else
|
|
8
|
+
echo "Activation script ${ACT} not found for dev environment.
|
|
9
|
+
Run nox -s dev to install dev environment"
|
|
10
|
+
fi
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: deploy to pypi
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
uses: ./.github/workflows/test.yml
|
|
12
|
+
|
|
13
|
+
deploy:
|
|
14
|
+
name: deploy
|
|
15
|
+
needs: test
|
|
16
|
+
permissions:
|
|
17
|
+
id-token: write
|
|
18
|
+
environment: release
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v6
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
|
|
25
|
+
- uses: actions/setup-python@v6
|
|
26
|
+
with:
|
|
27
|
+
python-version: 3.11
|
|
28
|
+
|
|
29
|
+
- name: install build dependencies
|
|
30
|
+
run: python3 -m pip install build
|
|
31
|
+
|
|
32
|
+
- name: build package
|
|
33
|
+
run: python3 -m build --sdist --wheel --outdir dist/
|
|
34
|
+
|
|
35
|
+
- name: upload package
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: package
|
|
39
|
+
path: dist/
|
|
40
|
+
- name: publish package (pypi)
|
|
41
|
+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
|
42
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
43
|
+
|
|
44
|
+
- name: publish package (test.pypi)
|
|
45
|
+
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
46
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
47
|
+
with:
|
|
48
|
+
repository-url: "https://test.pypi.org/legacy/"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Deploy Documentation
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
|
14
|
+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
|
15
|
+
concurrency:
|
|
16
|
+
group: "pages"
|
|
17
|
+
cancel-in-progress: false
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v6
|
|
25
|
+
- name: Set up Python 3.12
|
|
26
|
+
uses: actions/setup-python@v6
|
|
27
|
+
with:
|
|
28
|
+
python-version: 3.12
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
python -m pip install -e .[doc]
|
|
33
|
+
- name: Build the documentation
|
|
34
|
+
run: mkdocs build
|
|
35
|
+
- name: Setup Pages
|
|
36
|
+
id: pages
|
|
37
|
+
uses: actions/configure-pages@v6
|
|
38
|
+
- name: Upload artifact
|
|
39
|
+
uses: actions/upload-pages-artifact@v5
|
|
40
|
+
with:
|
|
41
|
+
path: "./site"
|
|
42
|
+
deploy:
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
environment:
|
|
45
|
+
name: github-pages
|
|
46
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
47
|
+
needs: build
|
|
48
|
+
steps:
|
|
49
|
+
- name: Deploy to GitHub Pages
|
|
50
|
+
id: deployment
|
|
51
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: run CI test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [devel, main, master, wip]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_call:
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
FORCE_COLOR: "3"
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
name: test on ${{ matrix.os }}
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
- uses: actions/setup-python@v6
|
|
24
|
+
with:
|
|
25
|
+
python-version: |
|
|
26
|
+
3.10
|
|
27
|
+
3.11
|
|
28
|
+
3.12
|
|
29
|
+
|
|
30
|
+
- name: install requirements
|
|
31
|
+
run: python -m pip install nox pre-commit
|
|
32
|
+
|
|
33
|
+
- name: run pre-commit
|
|
34
|
+
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
35
|
+
run: pre-commit run --all --show-diff-on-failure
|
|
36
|
+
|
|
37
|
+
- name: run tests
|
|
38
|
+
run: nox
|
asplain-0.0.0/.gitignore
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Editors
|
|
2
|
+
.vscode/
|
|
3
|
+
*~
|
|
4
|
+
\#*\#
|
|
5
|
+
.\#*
|
|
6
|
+
.idea
|
|
7
|
+
.zed
|
|
8
|
+
|
|
9
|
+
# Mac/OSX
|
|
10
|
+
.DS_Store
|
|
11
|
+
|
|
12
|
+
# Byte-compiled / optimized / DLL files
|
|
13
|
+
__pycache__/
|
|
14
|
+
*.py[cod]
|
|
15
|
+
*$py.class
|
|
16
|
+
|
|
17
|
+
# Installer logs
|
|
18
|
+
pip-log.txt
|
|
19
|
+
pip-delete-this-directory.txt
|
|
20
|
+
|
|
21
|
+
# Unit test / coverage reports
|
|
22
|
+
.pytest_cache/
|
|
23
|
+
|
|
24
|
+
# pyenv
|
|
25
|
+
.python-version
|
|
26
|
+
|
|
27
|
+
# venv
|
|
28
|
+
.venv
|
|
29
|
+
|
|
30
|
+
# dotenv
|
|
31
|
+
.env
|
|
32
|
+
|
|
33
|
+
# mypy
|
|
34
|
+
.mypy_cache/
|
|
35
|
+
.dmypy.json
|
|
36
|
+
dmypy.json
|
|
37
|
+
*egg-info*
|
|
38
|
+
|
|
39
|
+
# unclassified
|
|
40
|
+
dist
|
|
41
|
+
build
|
|
42
|
+
.coverage
|
|
43
|
+
_build
|
|
44
|
+
_autosummary
|
|
45
|
+
site
|
|
46
|
+
|
|
47
|
+
out/*
|
|
48
|
+
*out/
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/myint/autoflake
|
|
3
|
+
rev: v2.3.1
|
|
4
|
+
hooks:
|
|
5
|
+
- id: autoflake
|
|
6
|
+
args: ["--in-place", "--imports=asplain", "--ignore-init-module-imports", "--remove-unused-variables"]
|
|
7
|
+
exclude: ^.github/
|
|
8
|
+
|
|
9
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
10
|
+
rev: v6.0.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: end-of-file-fixer
|
|
13
|
+
- id: trailing-whitespace
|
|
14
|
+
exclude: ^.github/
|
|
15
|
+
|
|
16
|
+
- repo: https://github.com/pycqa/isort
|
|
17
|
+
rev: 7.0.0
|
|
18
|
+
hooks:
|
|
19
|
+
- id: isort
|
|
20
|
+
exclude: ^.github/
|
|
21
|
+
|
|
22
|
+
- repo: https://github.com/psf/black
|
|
23
|
+
rev: 25.9.0
|
|
24
|
+
hooks:
|
|
25
|
+
- id: black
|
|
26
|
+
exclude: ^.github/
|
|
27
|
+
|
|
28
|
+
- repo: https://github.com/executablebooks/mdformat
|
|
29
|
+
rev: 1.0.0
|
|
30
|
+
hooks:
|
|
31
|
+
- id: mdformat
|
|
32
|
+
args: ["--wrap", "79"]
|
|
33
|
+
exclude: ^docs/
|
|
34
|
+
additional_dependencies:
|
|
35
|
+
- mdformat-gfm
|
asplain-0.0.0/CHANGES.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for considering a contribution to asplain. ❤️
|
|
4
|
+
|
|
5
|
+
## How to get help or discuss possible contributions
|
|
6
|
+
|
|
7
|
+
To avoid duplicating issues, please search our [issue tracker][issues] and our
|
|
8
|
+
[mailing list][mailing_list] before filing a new issue.
|
|
9
|
+
|
|
10
|
+
- Open an [issue][new_issue] describing your problem.
|
|
11
|
+
- [Subscribe] to our mailing list on SourceForge.
|
|
12
|
+
|
|
13
|
+
## How to make a contribution
|
|
14
|
+
|
|
15
|
+
- Fork the [asplain][project_url] repository and create a branch for your
|
|
16
|
+
changes.
|
|
17
|
+
- Submit a pull request to the master branch with your changes.
|
|
18
|
+
- Respond to feedback on your pull request.
|
|
19
|
+
- If everything is fine your pull request is merged. 🥳
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
|
|
23
|
+
When contributing to this project, you agree that you have authored 100% of the
|
|
24
|
+
content, that you have the necessary rights to the content and that the content
|
|
25
|
+
you contribute may be provided under the project license.
|
|
26
|
+
|
|
27
|
+
[issues]: asplainissues/
|
|
28
|
+
[mailing_list]: https://sourceforge.net/p/potassco/mailman/potassco-users/
|
|
29
|
+
[new_issue]: asplainissues/new/
|
|
30
|
+
[project_url]: asplain
|
|
31
|
+
[subscribe]: https://sourceforge.net/projects/potassco/lists/potassco-users/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Deployment
|
|
2
|
+
|
|
3
|
+
Releases are deployed on [pypi] whenever a tag of form `vMajor.Minor.Revision`
|
|
4
|
+
is pushed. Furthermore, the deployment workflow can be triggered manually to
|
|
5
|
+
deploy test releases on [test.pypi].
|
|
6
|
+
|
|
7
|
+
For this to work, the workflow has to be granted permission to deploy on the
|
|
8
|
+
two services. Please follow this packaging [guide] to setup your accounts
|
|
9
|
+
accordingly. We also recommend to setup a github [environment] to restrict
|
|
10
|
+
which contributors can deploy packages.
|
|
11
|
+
|
|
12
|
+
## Automatic Documentation Deployment
|
|
13
|
+
|
|
14
|
+
You can automatically publish project documentation to GitHub Pages on every
|
|
15
|
+
new tag. To enable this:
|
|
16
|
+
|
|
17
|
+
- Go to your repository on GitHub.
|
|
18
|
+
- Navigate to **Settings** > **Pages**.
|
|
19
|
+
- Under **Build and deployment**, set **Source** to **GitHub Actions**.
|
|
20
|
+
|
|
21
|
+
This setup ensures your documentation is updated and available online whenever
|
|
22
|
+
you create a new release tag via Github workflows.
|
|
23
|
+
|
|
24
|
+
[environment]: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment/
|
|
25
|
+
[guide]: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
|
|
26
|
+
[pypi]: https://pypi.org/
|
|
27
|
+
[test.pypi]: https://test.pypi.org/
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Development
|
|
2
|
+
|
|
3
|
+
To improve code quality, we use [nox] to run linters, type checkers, unit
|
|
4
|
+
tests, and more. We recommend installing nox using [pipx] to have it available
|
|
5
|
+
globally.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# install
|
|
9
|
+
python -m pip install pipx
|
|
10
|
+
python -m pipx install nox
|
|
11
|
+
|
|
12
|
+
# run all sessions
|
|
13
|
+
nox
|
|
14
|
+
|
|
15
|
+
# list all sessions
|
|
16
|
+
nox -l
|
|
17
|
+
|
|
18
|
+
# run individual session
|
|
19
|
+
nox -s session_name
|
|
20
|
+
|
|
21
|
+
# run individual session (reuse install)
|
|
22
|
+
nox -Rs session_name
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Note that the nox sessions create [editable] installs. In case there are
|
|
26
|
+
issues, try recreating environments by dropping the `-R` option. If your
|
|
27
|
+
project is incompatible with editable installs, adjust the `noxfile.py` to
|
|
28
|
+
disable them.
|
|
29
|
+
|
|
30
|
+
We also provide a [pre-commit][pre] config to autoformat code upon commits. It
|
|
31
|
+
can be set up using the following commands:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python -m pipx install pre-commit
|
|
35
|
+
pre-commit install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Documentation
|
|
39
|
+
|
|
40
|
+
Make sure the documentation dependencies for the project are properly installed
|
|
41
|
+
with
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install .[doc]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To run the documentation locally use the following command and click the
|
|
48
|
+
provided link to open it in the browser.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
mkdocs serve
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Live development:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
mkdocs serve --livereload
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
[editable]: https://setuptools.pypa.io/en/latest/userguide/development_mode.html
|
|
61
|
+
[nox]: https://nox.thea.codes/en/stable/index.html
|
|
62
|
+
[pipx]: https://pypa.github.io/pipx/
|
|
63
|
+
[pre]: https://pre-commit.com/
|
asplain-0.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Susana Hahn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
asplain-0.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: asplain
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: A template project.
|
|
5
|
+
Author-email: Susana Hahn <hahnmartinlu@uni-potsdam.de>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024 Susana Hahn
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/potassco/asplain.git/
|
|
29
|
+
Project-URL: Documentation, https://docs.potassco.org/asplain/
|
|
30
|
+
Project-URL: Repository, https://github.com/potassco/asplain
|
|
31
|
+
Project-URL: Issues, https://github.com/potassco/asplain/issues
|
|
32
|
+
Project-URL: Changelog, https://github.com/potassco/asplain/blob/master/CHANGES.md
|
|
33
|
+
Requires-Python: >=3.10
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Requires-Dist: clingo>=5.6.0
|
|
37
|
+
Requires-Dist: meta-tools-clingo>=0.3.4
|
|
38
|
+
Requires-Dist: clingraph>=1.2.2
|
|
39
|
+
Provides-Extra: ui
|
|
40
|
+
Requires-Dist: clinguin>=2.7.5; extra == "ui"
|
|
41
|
+
Provides-Extra: llm
|
|
42
|
+
Requires-Dist: openai>=2.8.1; extra == "llm"
|
|
43
|
+
Requires-Dist: dotenv; extra == "llm"
|
|
44
|
+
Requires-Dist: clorm; extra == "llm"
|
|
45
|
+
Requires-Dist: google-genai; extra == "llm"
|
|
46
|
+
Provides-Extra: format
|
|
47
|
+
Requires-Dist: black; extra == "format"
|
|
48
|
+
Requires-Dist: isort; extra == "format"
|
|
49
|
+
Requires-Dist: autoflake; extra == "format"
|
|
50
|
+
Provides-Extra: lint-pylint
|
|
51
|
+
Requires-Dist: pylint; extra == "lint-pylint"
|
|
52
|
+
Provides-Extra: typecheck
|
|
53
|
+
Requires-Dist: types-setuptools; extra == "typecheck"
|
|
54
|
+
Requires-Dist: mypy; extra == "typecheck"
|
|
55
|
+
Provides-Extra: test
|
|
56
|
+
Requires-Dist: coverage[toml]; extra == "test"
|
|
57
|
+
Provides-Extra: doc
|
|
58
|
+
Requires-Dist: mkdocs; extra == "doc"
|
|
59
|
+
Requires-Dist: mkdocs-material; extra == "doc"
|
|
60
|
+
Requires-Dist: mkdocstrings>=1.0.4; extra == "doc"
|
|
61
|
+
Requires-Dist: mkdocstrings-python>=2.0; extra == "doc"
|
|
62
|
+
Requires-Dist: clindocs>=1.5.2; extra == "doc"
|
|
63
|
+
Requires-Dist: mkdocs-literate-nav; extra == "doc"
|
|
64
|
+
Requires-Dist: pygments_clingo; extra == "doc"
|
|
65
|
+
Provides-Extra: dev
|
|
66
|
+
Requires-Dist: asplain[doc,lint_pylint,test,typecheck]; extra == "dev"
|
|
67
|
+
Dynamic: license-file
|
|
68
|
+
|
|
69
|
+
[](https://docs.potassco.org/asplain/)
|
|
70
|
+
[](https://pypi.org/project/asplain/)
|
|
71
|
+
[](LICENSE)
|
|
72
|
+
|
|
73
|
+
# asplain
|
|
74
|
+
|
|
75
|
+
Asplain is a tool for generating contrastive explanations for answer set
|
|
76
|
+
programs (ASP).
|
|
77
|
+
|
|
78
|
+
## Installation
|
|
79
|
+
|
|
80
|
+
To install the project, run
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pip install .
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For rendering the images with cligraph, Graphviz needs to be installed
|
|
87
|
+
following `graphviz <https://www.graphviz.org/download/>`\_ (version 2.50 or
|
|
88
|
+
greater).
|
|
89
|
+
|
|
90
|
+
## Documentation
|
|
91
|
+
|
|
92
|
+
Full documentation is available at
|
|
93
|
+
**[docs.potassco.org/asplain](https://docs.potassco.org/asplain/)**.
|
|
94
|
+
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
Run the following for basic usage information:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
asplain -h
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
For a basic usage example, see the
|
|
104
|
+
[examples/james-bond/README.md](examples/james-bond/README.md) file.
|
|
105
|
+
|
|
106
|
+
### LLM Integration
|
|
107
|
+
|
|
108
|
+
For using the OpenAI API, an API-Key has to be provided in the `OPENAI_API_KEY`
|
|
109
|
+
environment variable. This can be done using a `.env`file or directly in the
|
|
110
|
+
command line.
|
|
111
|
+
|
|
112
|
+
#### Using the `.env` file
|
|
113
|
+
|
|
114
|
+
Create a `.env` file in the root directory of the project and add the following
|
|
115
|
+
line
|
|
116
|
+
|
|
117
|
+
```.env
|
|
118
|
+
OPENAI_API_KEY=<your-api-key>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### Using the command line
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
OPENAI_API_KEY=<your-api-key> asplain --llm=<model-tag>
|
|
125
|
+
```
|
asplain-0.0.0/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[](https://docs.potassco.org/asplain/)
|
|
2
|
+
[](https://pypi.org/project/asplain/)
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
|
|
5
|
+
# asplain
|
|
6
|
+
|
|
7
|
+
Asplain is a tool for generating contrastive explanations for answer set
|
|
8
|
+
programs (ASP).
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
To install the project, run
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install .
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For rendering the images with cligraph, Graphviz needs to be installed
|
|
19
|
+
following `graphviz <https://www.graphviz.org/download/>`\_ (version 2.50 or
|
|
20
|
+
greater).
|
|
21
|
+
|
|
22
|
+
## Documentation
|
|
23
|
+
|
|
24
|
+
Full documentation is available at
|
|
25
|
+
**[docs.potassco.org/asplain](https://docs.potassco.org/asplain/)**.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
Run the following for basic usage information:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
asplain -h
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For a basic usage example, see the
|
|
36
|
+
[examples/james-bond/README.md](examples/james-bond/README.md) file.
|
|
37
|
+
|
|
38
|
+
### LLM Integration
|
|
39
|
+
|
|
40
|
+
For using the OpenAI API, an API-Key has to be provided in the `OPENAI_API_KEY`
|
|
41
|
+
environment variable. This can be done using a `.env`file or directly in the
|
|
42
|
+
command line.
|
|
43
|
+
|
|
44
|
+
#### Using the `.env` file
|
|
45
|
+
|
|
46
|
+
Create a `.env` file in the root directory of the project and add the following
|
|
47
|
+
line
|
|
48
|
+
|
|
49
|
+
```.env
|
|
50
|
+
OPENAI_API_KEY=<your-api-key>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
#### Using the command line
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
OPENAI_API_KEY=<your-api-key> asplain --llm=<model-tag>
|
|
57
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
* Getting Started
|
|
2
|
+
* [Getting Started](use/quick-start.md)
|
|
3
|
+
* [Installation](use/installation.md)
|
|
4
|
+
* [Help](use/help.md)
|
|
5
|
+
* Reference
|
|
6
|
+
* [Reference](reference/index.md)
|
|
7
|
+
* [CLI](reference/cli.md)
|
|
8
|
+
* [Contrastive Explanation](reference/explanation-graph.md)
|
|
9
|
+
* Implementation Details
|
|
10
|
+
* [Setup Construction](reference/setup.md)
|
|
11
|
+
* [Finding Explanations](reference/foils.md)
|
|
12
|
+
* Customization
|
|
13
|
+
* [Tagging](reference/tagging.md)
|
|
14
|
+
* Explanation Selection
|
|
15
|
+
* [Explanation Selection](reference/preferences/index.md)
|
|
16
|
+
* [`model-difference.lp`](reference/preferences/model-difference.md)
|
|
17
|
+
* [`program-difference.lp`](reference/preferences/program-difference.md)
|
|
18
|
+
* [`penalize-added.lp`](reference/preferences/penalize-added.md)
|
|
19
|
+
* [`penalize-removed.lp`](reference/preferences/penalize-removed.md)
|
|
20
|
+
* [`penalize-non-constraints.lp`](reference/preferences/penalize-non-constraints.md)
|
|
21
|
+
* [`penalize-non-facts.lp`](reference/preferences/penalize-non-facts.md)
|
|
22
|
+
* [`penalize-non-assumptions.lp`](reference/preferences/penalize-non-assumptions.md)
|
|
23
|
+
* [Pruning Methods](reference/pruning.md)
|
|
24
|
+
* Examples
|
|
25
|
+
* [Examples](examples/index.md)
|
|
26
|
+
* [James Bond](examples/jamesbond.md)
|
|
27
|
+
* [Sudoku](examples/sudoku.md)
|
|
28
|
+
* [Cat-dog](examples/catdog.md)
|
|
29
|
+
* [Don't drive drunk](examples/dontdrivedrunk.md)
|
|
30
|
+
* Community
|
|
31
|
+
* [Community](community/index.md)
|
|
32
|
+
* [Changes](community/CHANGES.md)
|
|
33
|
+
* [Contributing](community/CONTRIBUTING.md)
|
|
34
|
+
* [Development](community/DEVELOPMENT.md)
|
|
35
|
+
* [Deployment](community/DEPLOYMENT.md)
|