goatd for Python
Python bindings for goatd, built with PyO3 and maturin.
pip install goatd
Wheels cover CPython 3.10 and later on Linux x86-64, macOS arm64 and Windows x64. Anywhere else, pip builds from the source distribution, which needs a Rust toolchain and a C++20 compiler.
import goatd
graph = goatd.Graph(4, [(0, 1), (1, 2), (2, 3), (3, 0), (0, 2)])
td = goatd.decompose(graph, order="portfolio", budget_ms=100)
td.treewidth # 2
td.bags # [[0, 1, 2], [0, 2, 3]]
td.edges # [(0, 1)] — pairs of positions in td.bags
td.validate(graph) # raises goatd.Error if td does not decompose graph
print(td.to_td()) # PACE .td text
decompose takes the solver's knobs under the solver's names: order is one
of minfill, mindegree, nested-dissection, flowcutter and portfolio;
seed breaks ties; ties="sample" and weights control weighted sampling for
the two greedy orders; steps gives flowcutter a repeatable step budget in
place of a clock; refine=True re-cuts the result along FlowCutter separators.
An argument the chosen order cannot act on raises ValueError naming both.
Budgets are milliseconds, so the name is budget_ms rather than the command
line's --budget.
goatd.Graph.from_gr and TreeDecomposition.from_td read the PACE formats;
to_gr and to_td write them.
goatd is single-threaded. The interpreter lock is released for the whole of a solve, so a caller can decompose several graphs at once from Python threads.
Building
The extension builds against the published goatd crate rather than the
checkout around it, so it needs a Rust toolchain, a C++20 compiler for the
vendored FlowCutter, and maturin.
PEP 639 resolves license-files against the directory holding
pyproject.toml and forbids .., so the two notice files are copied in from
the repository root first rather than kept here in a second copy:
mkdir -p bindings/python/notices
cp LICENSE docs/THIRD-PARTY.md bindings/python/notices/
pip install maturin
maturin build --release --manifest-path bindings/python/Cargo.toml
maturin develop installs the extension into the active virtualenv for
pytest bindings/python/tests.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goatd-0.1.2.tar.gz.
File metadata
- Download URL: goatd-0.1.2.tar.gz
- Upload date:
- Size: 582.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
183fcabee6f6416189ad20fdb9ab70347a658756a47e4d479f5fd0f7be137cb3
|
|
| MD5 |
1c0d2302e765ae1d9fb0ae46e9386ec9
|
|
| BLAKE2b-256 |
12b7e7f7420b82de5402ce9c33cecfa6b962509dd1a916e448f8f56d477afa3b
|
Provenance
The following attestation bundles were made for goatd-0.1.2.tar.gz:
Publisher:
wheels.yml on Tractables/goatd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goatd-0.1.2.tar.gz -
Subject digest:
183fcabee6f6416189ad20fdb9ab70347a658756a47e4d479f5fd0f7be137cb3 - Sigstore transparency entry: 2655055308
- Sigstore integration time:
-
Permalink:
Tractables/goatd@7bfae5c5e9214495e1b3f50e8cec8a290ab6bd4b -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Tractables
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7bfae5c5e9214495e1b3f50e8cec8a290ab6bd4b -
Trigger Event:
push
-
Statement type:
File details
Details for the file goatd-0.1.2-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: goatd-0.1.2-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 413.2 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90f57373b61a26a98f4f19ba3f4863cf25b64eeae1260a4fe03dc2e934d61588
|
|
| MD5 |
ef3d92f2bdb94716d9070a1adaf60d58
|
|
| BLAKE2b-256 |
528c1b110c8509c7a83289031779fd11c6012d7035f8c06354cdf692afedc26e
|
Provenance
The following attestation bundles were made for goatd-0.1.2-cp310-abi3-win_amd64.whl:
Publisher:
wheels.yml on Tractables/goatd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goatd-0.1.2-cp310-abi3-win_amd64.whl -
Subject digest:
90f57373b61a26a98f4f19ba3f4863cf25b64eeae1260a4fe03dc2e934d61588 - Sigstore transparency entry: 2655055376
- Sigstore integration time:
-
Permalink:
Tractables/goatd@7bfae5c5e9214495e1b3f50e8cec8a290ab6bd4b -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Tractables
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7bfae5c5e9214495e1b3f50e8cec8a290ab6bd4b -
Trigger Event:
push
-
Statement type:
File details
Details for the file goatd-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: goatd-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 536.7 kB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d64763e2750734004afe7acb876fab9f483547ee8394cc3e777338a720ca10f
|
|
| MD5 |
947881a52eea13ed151ef4e576306185
|
|
| BLAKE2b-256 |
ee0ca8b7065537a74f03ad7e8e937abf8fcf2bef5cad41a8df0c7f61d7bddbbb
|
Provenance
The following attestation bundles were made for goatd-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl:
Publisher:
wheels.yml on Tractables/goatd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goatd-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
5d64763e2750734004afe7acb876fab9f483547ee8394cc3e777338a720ca10f - Sigstore transparency entry: 2655055325
- Sigstore integration time:
-
Permalink:
Tractables/goatd@7bfae5c5e9214495e1b3f50e8cec8a290ab6bd4b -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Tractables
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7bfae5c5e9214495e1b3f50e8cec8a290ab6bd4b -
Trigger Event:
push
-
Statement type:
File details
Details for the file goatd-0.1.2-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: goatd-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 473.0 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77cd8b047f8efcce3efbc1b8d88bfcbe4496ce8f751dbc102618570734650f8a
|
|
| MD5 |
632d64a6a24e8023037746e9bd5e7297
|
|
| BLAKE2b-256 |
f86a524b31cefcbe1c03c2627fb4a16c05749b281a5d637eea2f54fcac7f95ca
|
Provenance
The following attestation bundles were made for goatd-0.1.2-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
wheels.yml on Tractables/goatd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goatd-0.1.2-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
77cd8b047f8efcce3efbc1b8d88bfcbe4496ce8f751dbc102618570734650f8a - Sigstore transparency entry: 2655055349
- Sigstore integration time:
-
Permalink:
Tractables/goatd@7bfae5c5e9214495e1b3f50e8cec8a290ab6bd4b -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Tractables
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7bfae5c5e9214495e1b3f50e8cec8a290ab6bd4b -
Trigger Event:
push
-
Statement type: