pyotc 0.2.2__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.
- pyotc-0.2.2/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- pyotc-0.2.2/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- pyotc-0.2.2/.github/workflows/README.md +9 -0
- pyotc-0.2.2/.github/workflows/build_and_publish.yml +70 -0
- pyotc-0.2.2/.github/workflows/lint_and_test.yml +43 -0
- pyotc-0.2.2/.github/workflows/sphinx.yml +52 -0
- pyotc-0.2.2/.gitignore +167 -0
- pyotc-0.2.2/.python-version +1 -0
- pyotc-0.2.2/AUTHORS.rst +12 -0
- pyotc-0.2.2/CHANGELOG.md +41 -0
- pyotc-0.2.2/CONTRIBUTING.md +117 -0
- pyotc-0.2.2/INSTALL.md +41 -0
- pyotc-0.2.2/LICENSE +22 -0
- pyotc-0.2.2/MANIFEST.in +11 -0
- pyotc-0.2.2/PKG-INFO +38 -0
- pyotc-0.2.2/README.md +23 -0
- pyotc-0.2.2/RELEASE.md +41 -0
- pyotc-0.2.2/docs/INSTALL.md +36 -0
- pyotc-0.2.2/docs/Makefile +27 -0
- pyotc-0.2.2/docs/authors.rst +1 -0
- pyotc-0.2.2/docs/conf.py +159 -0
- pyotc-0.2.2/docs/contributing.rst +2 -0
- pyotc-0.2.2/docs/history.rst +2 -0
- pyotc-0.2.2/docs/index.rst +25 -0
- pyotc-0.2.2/docs/installation.rst +51 -0
- pyotc-0.2.2/docs/joss/README.md +12 -0
- pyotc-0.2.2/docs/joss/paper.bib +162 -0
- pyotc-0.2.2/docs/joss/paper.md +115 -0
- pyotc-0.2.2/docs/make.bat +36 -0
- pyotc-0.2.2/docs/modules/modules.rst +14 -0
- pyotc-0.2.2/docs/modules/pyotc.examples.rst +45 -0
- pyotc-0.2.2/docs/modules/pyotc.otc_backend.graph.rst +21 -0
- pyotc-0.2.2/docs/modules/pyotc.otc_backend.optimal_transport.rst +45 -0
- pyotc-0.2.2/docs/modules/pyotc.otc_backend.policy_iteration.dense.rst +69 -0
- pyotc-0.2.2/docs/modules/pyotc.otc_backend.policy_iteration.rst +30 -0
- pyotc-0.2.2/docs/modules/pyotc.otc_backend.policy_iteration.sparse.rst +37 -0
- pyotc-0.2.2/docs/modules/pyotc.otc_backend.rst +20 -0
- pyotc-0.2.2/docs/modules/pyotc.rst +30 -0
- pyotc-0.2.2/docs/modules.rst +8 -0
- pyotc-0.2.2/docs/readme.rst +2 -0
- pyotc-0.2.2/docs/usage.rst +7 -0
- pyotc-0.2.2/notebooks/EntropicOTC.ipynb +944 -0
- pyotc-0.2.2/notebooks/MarkovProcesses.ipynb +237 -0
- pyotc-0.2.2/notebooks/NetworkExamples.ipynb +310 -0
- pyotc-0.2.2/notebooks/README.md +3 -0
- pyotc-0.2.2/notebooks/Sparse.ipynb +207 -0
- pyotc-0.2.2/notebooks/pyotc_demo.ipynb +354 -0
- pyotc-0.2.2/noxfile.py +28 -0
- pyotc-0.2.2/pyproject.toml +47 -0
- pyotc-0.2.2/pytest.ini +2 -0
- pyotc-0.2.2/src/pyotc/__init__.py +5 -0
- pyotc-0.2.2/src/pyotc/examples/__init__.py +0 -0
- pyotc-0.2.2/src/pyotc/examples/edge_awareness.py +86 -0
- pyotc-0.2.2/src/pyotc/examples/lollipops.py +54 -0
- pyotc-0.2.2/src/pyotc/examples/stochastic_block_model.py +57 -0
- pyotc-0.2.2/src/pyotc/examples/wheel.py +127 -0
- pyotc-0.2.2/src/pyotc/otc.py +5 -0
- pyotc-0.2.2/src/pyotc/otc_backend/__init__.py +0 -0
- pyotc-0.2.2/src/pyotc/otc_backend/graph/__init__.py +3 -0
- pyotc-0.2.2/src/pyotc/otc_backend/graph/utils.py +109 -0
- pyotc-0.2.2/src/pyotc/otc_backend/optimal_transport/__init__.py +0 -0
- pyotc-0.2.2/src/pyotc/otc_backend/optimal_transport/logsinkhorn.py +78 -0
- pyotc-0.2.2/src/pyotc/otc_backend/optimal_transport/native.py +49 -0
- pyotc-0.2.2/src/pyotc/otc_backend/optimal_transport/native_refactor.py +51 -0
- pyotc-0.2.2/src/pyotc/otc_backend/optimal_transport/pot.py +38 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/__init__.py +0 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/dense/__init__.py +0 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/dense/approx_tce.py +42 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/dense/entropic.py +161 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/dense/entropic_tci.py +49 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/dense/exact.py +127 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/dense/exact_tce.py +56 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/dense/exact_tci_lp.py +65 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/dense/exact_tci_pot.py +90 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/sparse/__init__.py +0 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/sparse/exact.py +89 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/sparse/exact_tce.py +78 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/sparse/exact_tci.py +88 -0
- pyotc-0.2.2/src/pyotc/otc_backend/policy_iteration/utils.py +112 -0
- pyotc-0.2.2/tests/__init__.py +0 -0
- pyotc-0.2.2/tests/benchmark/__init__.py +0 -0
- pyotc-0.2.2/tests/benchmark/graph data/graph_G1.json +8006 -0
- pyotc-0.2.2/tests/benchmark/graph data/graph_G2.json +10158 -0
- pyotc-0.2.2/tests/benchmark/graph data/molecule_visualization.png +0 -0
- pyotc-0.2.2/tests/benchmark/test_entropic.py +81 -0
- pyotc-0.2.2/tests/benchmark/test_exact.py +116 -0
- pyotc-0.2.2/tests/examples/__init__.py +0 -0
- pyotc-0.2.2/tests/examples/test_lollipops.py +1 -0
- pyotc-0.2.2/tests/examples/test_stochastic_block_model.py +35 -0
- pyotc-0.2.2/tests/examples/test_wheel.py +1 -0
- pyotc-0.2.2/uv.lock +1247 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# GitHub Actions Workflows
|
|
2
|
+
|
|
3
|
+
This directory contains YAML workflows for GitHub Actions automation.
|
|
4
|
+
|
|
5
|
+
## Workflows Overview
|
|
6
|
+
- [build_and_publish.yml](build_and_publish.yml) – Deploys the project to production when a release is created.
|
|
7
|
+
- [lint_and_test.yml](lint_and_test.yml) – Runs nox to check (ruff), format (ruff), and test (pytest) for a matrix of pythons.
|
|
8
|
+
- [sphinx.yml](sphinx.yml) - Run sphinx documentation and deploys to github pages.
|
|
9
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# This workflow will upload a Python Package to PyPI when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
5
|
+
# They are provided by a third-party and are governed by
|
|
6
|
+
# separate terms of service, privacy policy, and support
|
|
7
|
+
# documentation.
|
|
8
|
+
|
|
9
|
+
name: build and publish
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
push:
|
|
16
|
+
branches:
|
|
17
|
+
- '77-fix-pypi-upload'
|
|
18
|
+
|
|
19
|
+
permissions:
|
|
20
|
+
contents: read
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
uv-release-build:
|
|
24
|
+
name: uv-release-build
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
|
|
29
|
+
- name: Install uv
|
|
30
|
+
uses: astral-sh/setup-uv@v5
|
|
31
|
+
|
|
32
|
+
- name: Run uv build
|
|
33
|
+
run: uv build
|
|
34
|
+
|
|
35
|
+
- name: Upload distributions
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: release-dists
|
|
39
|
+
path: dist/
|
|
40
|
+
|
|
41
|
+
pypi-publish:
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
needs:
|
|
44
|
+
- uv-release-build
|
|
45
|
+
permissions:
|
|
46
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
47
|
+
id-token: write
|
|
48
|
+
|
|
49
|
+
# Dedicated environments with protections for publishing are strongly recommended.
|
|
50
|
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
|
|
51
|
+
environment:
|
|
52
|
+
name: pypi
|
|
53
|
+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
|
|
54
|
+
# url: https://pypi.org/p/YOURPROJECT
|
|
55
|
+
#
|
|
56
|
+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
|
|
57
|
+
# ALTERNATIVE: exactly, uncomment the following line instead:
|
|
58
|
+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
|
|
59
|
+
|
|
60
|
+
steps:
|
|
61
|
+
- name: Retrieve release distributions
|
|
62
|
+
uses: actions/download-artifact@v4
|
|
63
|
+
with:
|
|
64
|
+
name: release-dists
|
|
65
|
+
path: dist/
|
|
66
|
+
|
|
67
|
+
- name: Publish release distributions to PyPI
|
|
68
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
69
|
+
with:
|
|
70
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: lint and test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
uv-nox:
|
|
8
|
+
name: uv-nox
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: ${{ matrix.python-version }}
|
|
22
|
+
cache: 'pip'
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v5
|
|
26
|
+
|
|
27
|
+
- name: Install nox
|
|
28
|
+
run: pip install nox
|
|
29
|
+
|
|
30
|
+
- name: Install the project
|
|
31
|
+
run: uv sync --all-extras --dev
|
|
32
|
+
|
|
33
|
+
- name: Run nox sessions (lint format test)
|
|
34
|
+
run: python -m nox
|
|
35
|
+
|
|
36
|
+
- name: Upload coverage reports to Codecov
|
|
37
|
+
uses: codecov/codecov-action@v5
|
|
38
|
+
with:
|
|
39
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
40
|
+
files: ./coverage.xml
|
|
41
|
+
flags: unittests
|
|
42
|
+
name: codecov-umbrella
|
|
43
|
+
fail_ci_if_error: true
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Simple workflow for deploying static content to GitHub Pages
|
|
2
|
+
# Obtained from github pages github actions dialog
|
|
3
|
+
# deploys to pyotc.github.io/pyotc
|
|
4
|
+
name: Deploy static content to Pages
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
# Runs on pushes targeting the default branch
|
|
8
|
+
push:
|
|
9
|
+
branches: ["main"]
|
|
10
|
+
|
|
11
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
|
|
14
|
+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
pages: write
|
|
18
|
+
id-token: write
|
|
19
|
+
|
|
20
|
+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
|
21
|
+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
|
22
|
+
concurrency:
|
|
23
|
+
group: "pages"
|
|
24
|
+
cancel-in-progress: false
|
|
25
|
+
|
|
26
|
+
jobs:
|
|
27
|
+
# Single deploy job since we're just deploying
|
|
28
|
+
deploy:
|
|
29
|
+
environment:
|
|
30
|
+
name: github-pages
|
|
31
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checkout
|
|
35
|
+
uses: actions/checkout@v4
|
|
36
|
+
- name: Setup Pages
|
|
37
|
+
uses: actions/configure-pages@v5
|
|
38
|
+
- uses: actions/setup-python@v5
|
|
39
|
+
- name: Install dependencies
|
|
40
|
+
run: |
|
|
41
|
+
pip install sphinx sphinx_rtd_theme myst_parser
|
|
42
|
+
pip install .
|
|
43
|
+
- name: Sphinx build
|
|
44
|
+
run: |
|
|
45
|
+
sphinx-build docs _build
|
|
46
|
+
- name: Upload artifact
|
|
47
|
+
uses: actions/upload-pages-artifact@v3
|
|
48
|
+
with:
|
|
49
|
+
path: '_build'
|
|
50
|
+
- name: Deploy to GitHub Pages
|
|
51
|
+
id: deployment
|
|
52
|
+
uses: actions/deploy-pages@v4
|
pyotc-0.2.2/.gitignore
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
env/
|
|
126
|
+
venv/
|
|
127
|
+
ENV/
|
|
128
|
+
env.bak/
|
|
129
|
+
venv.bak/
|
|
130
|
+
|
|
131
|
+
# Spyder project settings
|
|
132
|
+
.spyderproject
|
|
133
|
+
.spyproject
|
|
134
|
+
|
|
135
|
+
# Rope project settings
|
|
136
|
+
.ropeproject
|
|
137
|
+
|
|
138
|
+
# mkdocs documentation
|
|
139
|
+
/site
|
|
140
|
+
|
|
141
|
+
# mypy
|
|
142
|
+
.mypy_cache/
|
|
143
|
+
.dmypy.json
|
|
144
|
+
dmypy.json
|
|
145
|
+
|
|
146
|
+
# Pyre type checker
|
|
147
|
+
.pyre/
|
|
148
|
+
|
|
149
|
+
# pytype static type analyzer
|
|
150
|
+
.pytype/
|
|
151
|
+
|
|
152
|
+
# Cython debug symbols
|
|
153
|
+
cython_debug/
|
|
154
|
+
|
|
155
|
+
# PyCharm
|
|
156
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
157
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
158
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
159
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
160
|
+
.idea/
|
|
161
|
+
.DS_Store
|
|
162
|
+
src/.DS_Store
|
|
163
|
+
src/pyotc/.DS_Store
|
|
164
|
+
src/pyotc/otc_backend/.DS_Store
|
|
165
|
+
|
|
166
|
+
# pdf
|
|
167
|
+
*.pdf
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
pyotc-0.2.2/AUTHORS.rst
ADDED
pyotc-0.2.2/CHANGELOG.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.2.2] - 2025-10-10
|
|
11
|
+
* Add github actions build wheels and upload them to pypi.
|
|
12
|
+
|
|
13
|
+
## [0.2.1] - 2025-10-10
|
|
14
|
+
* Fix verion in `pyproject.toml`
|
|
15
|
+
|
|
16
|
+
## [0.2.0] - 2025-10-02
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
* [RELEASE.md](./RELEASE.md)
|
|
20
|
+
* Install with `uv`
|
|
21
|
+
* `pytest` testing
|
|
22
|
+
* `nox` for linting (`ruff`), formating (`ruff`), and testing (`pytest`)
|
|
23
|
+
* [sphinx documentation](https://pyotc.github.io/pyotc/)
|
|
24
|
+
* github actions running `nox` and generating documentation
|
|
25
|
+
* sparse versions of exact otc
|
|
26
|
+
* entropic otc
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
* Use `md` vs `rst` in most cases
|
|
30
|
+
|
|
31
|
+
### Removed
|
|
32
|
+
* makefiles from cookie cutter
|
|
33
|
+
|
|
34
|
+
## [0.1.0] - 2024-02-27
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
* Initial cookiecutter template
|
|
38
|
+
* Basic algorithm
|
|
39
|
+
|
|
40
|
+
[unreleased]: https://github.com/pyotc/pyotc
|
|
41
|
+
[0.1.0]: https://github.com/pyotc/pyotc/tree/v0.1.0
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
|
|
4
|
+
|
|
5
|
+
You can contribute in many ways:
|
|
6
|
+
|
|
7
|
+
## Types of Contributions
|
|
8
|
+
|
|
9
|
+
### Report Bugs
|
|
10
|
+
|
|
11
|
+
Report bugs at [https://github.com/pyotc/pyotc/issues](https://github.com/pyotc/pyotc/issues).
|
|
12
|
+
|
|
13
|
+
If you are reporting a bug, please include:
|
|
14
|
+
|
|
15
|
+
- Your operating system name and version.
|
|
16
|
+
- Any details about your local setup that might be helpful in troubleshooting.
|
|
17
|
+
- Detailed steps to reproduce the bug.
|
|
18
|
+
|
|
19
|
+
### Fix Bugs
|
|
20
|
+
|
|
21
|
+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
|
|
22
|
+
|
|
23
|
+
### Implement Features
|
|
24
|
+
|
|
25
|
+
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
|
|
26
|
+
|
|
27
|
+
See improvements listed in the [issues](https://github.com/pyotc/pyotc/issues).
|
|
28
|
+
|
|
29
|
+
### Write Documentation
|
|
30
|
+
|
|
31
|
+
`pyotc` could always use more documentation, whether as part of the official `pyotc` docs, in docstrings, or even on the web in blog posts, articles, and such.
|
|
32
|
+
|
|
33
|
+
### Submit Feedback
|
|
34
|
+
|
|
35
|
+
The best way to send feedback is to file an issue at [https://github.com/pyotc/pyotc/issues](https://github.com/pytoc/pyotc/issues).
|
|
36
|
+
|
|
37
|
+
If you are proposing a feature:
|
|
38
|
+
|
|
39
|
+
- Explain in detail how it would work.
|
|
40
|
+
- Keep the scope as narrow as possible, to make it easier to implement.
|
|
41
|
+
- Remember that this is a volunteer-driven project, and that contributions are welcome! :)
|
|
42
|
+
|
|
43
|
+
## Get Started!
|
|
44
|
+
|
|
45
|
+
Ready to contribute? Here's how to set up `pyotc` for local development.
|
|
46
|
+
|
|
47
|
+
1. Fork the `pyotc` repo on GitHub.
|
|
48
|
+
2. Clone your fork locally:
|
|
49
|
+
|
|
50
|
+
```shell
|
|
51
|
+
git clone git@github.com:your_name_here/pyotc.git
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3. Install your local copy into a virtualenv. See the [install directions](INSTALL.md)
|
|
55
|
+
|
|
56
|
+
4. Create a branch for local development:
|
|
57
|
+
|
|
58
|
+
```shell
|
|
59
|
+
git checkout -b name-of-your-bugfix-or-feature
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Now you can make your changes locally.
|
|
63
|
+
|
|
64
|
+
5. When you're done making changes use [nox](nox) to lint, format, and test.
|
|
65
|
+
|
|
66
|
+
6. Commit your changes and push your branch to GitHub:
|
|
67
|
+
|
|
68
|
+
```shell
|
|
69
|
+
git add .
|
|
70
|
+
git commit -m "Your detailed description of your changes."
|
|
71
|
+
git push origin name-of-your-bugfix-or-feature
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
7. Submit a pull request through the GitHub website.
|
|
75
|
+
|
|
76
|
+
## Pull Request Guidelines
|
|
77
|
+
|
|
78
|
+
Before you submit a pull request, check that it meets these guidelines:
|
|
79
|
+
|
|
80
|
+
0. Run `nox` in the root directory. Other [nox cli](https://nox.thea.codes/en/stable/usage.html#command-line-usage) options are avaiable. We use this same workflow in github actions. This should install, lint, format, and test your code.
|
|
81
|
+
1. Include new tests for new functionality.
|
|
82
|
+
2. Include new documentation for new functionality.
|
|
83
|
+
3. Include updates to the [changelog](./CHANGELOG.md).
|
|
84
|
+
4. Prepare to [help other review your changes](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/helping-others-review-your-changes).
|
|
85
|
+
|
|
86
|
+
## `uv` workflow
|
|
87
|
+
|
|
88
|
+
### Adding dependencies with `uv`
|
|
89
|
+
If you're adding true dependency, say for example `pytorch`, this is done simply with
|
|
90
|
+
```bash
|
|
91
|
+
uv add pytorch
|
|
92
|
+
```
|
|
93
|
+
See also documentation on [adding dependencies](https://docs.astral.sh/uv/concepts/projects/dependencies/#adding-dependencies)
|
|
94
|
+
|
|
95
|
+
If you're adding a [development dependency](https://docs.astral.sh/uv/concepts/projects/dependencies/#development-dependencies) (e.g `pytest`) there is a little extra
|
|
96
|
+
```bash
|
|
97
|
+
uv add --dev pytest
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Running nox via `uv` as tool
|
|
101
|
+
```bash
|
|
102
|
+
# in project root
|
|
103
|
+
uv tool run nox
|
|
104
|
+
```
|
|
105
|
+
*Note that this uses `nox` in isolation and should mimic what is done in [github actions](.github/workflows/nox.yml)*
|
|
106
|
+
|
|
107
|
+
### Running ruff format via `uv`
|
|
108
|
+
```bash
|
|
109
|
+
# in project root
|
|
110
|
+
uv tool run ruff format
|
|
111
|
+
```
|
|
112
|
+
*Note that this uses `ruff` in isolation and should mimic what is done in [github actions](.github/workflows/nox.yml)*
|
|
113
|
+
*Ruff in particular on your system, vs as tool, may be divergent.*
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Tagged releases
|
|
117
|
+
We adhere to the following release process described in the template available in [RELEASE.md](RELEASE.md).
|
pyotc-0.2.2/INSTALL.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Install
|
|
2
|
+
We expect pyotc to be pip-installable across all platforms.
|
|
3
|
+
|
|
4
|
+
## Install for usage
|
|
5
|
+
### From pypi
|
|
6
|
+
|
|
7
|
+
```pip install pyotc```
|
|
8
|
+
[TODO#26](https://github.com/pyotc/pyotc/issues/26)
|
|
9
|
+
|
|
10
|
+
### From github
|
|
11
|
+
|
|
12
|
+
```pip install https://github.com/pyotc/pyotc.git```
|
|
13
|
+
|
|
14
|
+
## Install for development
|
|
15
|
+
We test in venvs provided by [uv](https://docs.astral.sh/uv/) via [nox](https://nox.thea.codes/en/stable/usage.html#changing-the-sessions-default-backend). It's helpful, but not strictly necessary to do the same.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git clone https://github.com/pyotc/pyotc.git
|
|
19
|
+
cd pyotc
|
|
20
|
+
pip install -e .
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### `uv` workflow
|
|
24
|
+
[Install the uv tool](https://docs.astral.sh/uv/getting-started/installation/).
|
|
25
|
+
|
|
26
|
+
Then
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/pyotc/pyotc.git
|
|
30
|
+
cd pyotc
|
|
31
|
+
uv sync
|
|
32
|
+
uv pip install -e .
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To verify your installation, run
|
|
36
|
+
```bash
|
|
37
|
+
uv run pytest
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
pyotc-0.2.2/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, Jay Hineman
|
|
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.
|
|
22
|
+
|
pyotc-0.2.2/MANIFEST.in
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
include AUTHORS.md
|
|
2
|
+
include CONTRIBUTING.md
|
|
3
|
+
include HISTORY.md
|
|
4
|
+
include LICENSE
|
|
5
|
+
include README.md
|
|
6
|
+
|
|
7
|
+
recursive-include tests *
|
|
8
|
+
recursive-exclude * __pycache__
|
|
9
|
+
recursive-exclude * *.py[co]
|
|
10
|
+
|
|
11
|
+
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
|
pyotc-0.2.2/PKG-INFO
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyotc
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Perform optimal transition coupling (OTC) in python.
|
|
5
|
+
Author: Jay Hineman, Yuning Pan, Bongsoo Yi
|
|
6
|
+
License: MIT license
|
|
7
|
+
License-File: AUTHORS.rst
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: matplotlib>=3.10.0
|
|
11
|
+
Requires-Dist: networkx>=3.4.2
|
|
12
|
+
Requires-Dist: numpy>=2.2.1
|
|
13
|
+
Requires-Dist: pot>=0.9.5
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# pyotc
|
|
17
|
+
[](https://codecov.io/github/pyotc/pyotc)
|
|
18
|
+
|
|
19
|
+
A python implementations of optimal transport coupling algorithms.
|
|
20
|
+
|
|
21
|
+
## Documentation
|
|
22
|
+
Find sphinx documentation [here](https://pyotc.github.io/pyotc/).
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
See [install instructions](INSTALL.md)
|
|
26
|
+
|
|
27
|
+
## Run Tests
|
|
28
|
+
With a `uv` setup one can simply
|
|
29
|
+
```bash
|
|
30
|
+
uv run pytest
|
|
31
|
+
```
|
|
32
|
+
Otherwise, in `pip` installed context with deps met, `pytest` should behave as expected.
|
|
33
|
+
|
|
34
|
+
## Contributing
|
|
35
|
+
Guidelines for contribution to `pyotc` are provided in [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
36
|
+
|
|
37
|
+
## Changelog
|
|
38
|
+
A summary of changes and guide to versioning are recoreded in [CHANGELOG.md](./CHANGELOG.md).
|