setreplace 0.1.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.
- setreplace-0.1.0/.github/workflows/ci.yml +34 -0
- setreplace-0.1.0/.github/workflows/release.yml +90 -0
- setreplace-0.1.0/.gitignore +6 -0
- setreplace-0.1.0/Cargo.lock +682 -0
- setreplace-0.1.0/Cargo.toml +11 -0
- setreplace-0.1.0/LICENSE +28 -0
- setreplace-0.1.0/PKG-INFO +81 -0
- setreplace-0.1.0/README.md +169 -0
- setreplace-0.1.0/docs/engine.md +114 -0
- setreplace-0.1.0/docs/images/basic_hypergraph_plot.png +0 -0
- setreplace-0.1.0/docs/images/causal10_wolfram_vs_rust.png +0 -0
- setreplace-0.1.0/docs/images/evolution_result_100_steps.png +0 -0
- setreplace-0.1.0/docs/images/evolution_result_10_steps.png +0 -0
- setreplace-0.1.0/docs/images/evolution_result_1_step.png +0 -0
- setreplace-0.1.0/docs/images/layered_causal_graph.png +0 -0
- setreplace-0.1.0/docs/images/showcase/announcement_web.png +0 -0
- setreplace-0.1.0/docs/images/showcase/crumpled_ball.png +0 -0
- setreplace-0.1.0/docs/images/showcase/lens_mesh.png +0 -0
- setreplace-0.1.0/docs/images/showcase/sierpinski_fractal.png +0 -0
- setreplace-0.1.0/docs/images/showcase/triangular_net.png +0 -0
- setreplace-0.1.0/docs/images/step10_wolfram_vs_rust.png +0 -0
- setreplace-0.1.0/docs/python-api.md +239 -0
- setreplace-0.1.0/docs/release.md +59 -0
- setreplace-0.1.0/docs/rust.md +77 -0
- setreplace-0.1.0/examples/bench.rs +65 -0
- setreplace-0.1.0/examples/growth.rs +35 -0
- setreplace-0.1.0/examples/orderings.rs +30 -0
- setreplace-0.1.0/examples/print_states.rs +27 -0
- setreplace-0.1.0/out/basic_hypergraph_plot.png +0 -0
- setreplace-0.1.0/out/basic_hypergraph_plot.svg +32 -0
- setreplace-0.1.0/out/comparison/basic_wolfram_vs_rust.png +0 -0
- setreplace-0.1.0/out/comparison/causal10_wolfram_vs_rust.png +0 -0
- setreplace-0.1.0/out/comparison/step100_wolfram_vs_rust.png +0 -0
- setreplace-0.1.0/out/comparison/step10_wolfram_vs_rust.png +0 -0
- setreplace-0.1.0/out/comparison/step1_wolfram_vs_rust.png +0 -0
- setreplace-0.1.0/out/evolution_result_100_steps.png +0 -0
- setreplace-0.1.0/out/evolution_result_100_steps.svg +625 -0
- setreplace-0.1.0/out/evolution_result_10_steps.png +0 -0
- setreplace-0.1.0/out/evolution_result_10_steps.svg +102 -0
- setreplace-0.1.0/out/evolution_result_1_step.png +0 -0
- setreplace-0.1.0/out/evolution_result_1_step.svg +39 -0
- setreplace-0.1.0/out/layered_causal_graph.png +0 -0
- setreplace-0.1.0/out/layered_causal_graph.svg +47 -0
- setreplace-0.1.0/pyproject.toml +31 -0
- setreplace-0.1.0/python/Cargo.toml +16 -0
- setreplace-0.1.0/python/README.md +61 -0
- setreplace-0.1.0/python/setreplace.pyi +123 -0
- setreplace-0.1.0/python/src/lib.rs +614 -0
- setreplace-0.1.0/python/tests/test_api.py +185 -0
- setreplace-0.1.0/src/atoms_index.rs +48 -0
- setreplace-0.1.0/src/error.rs +41 -0
- setreplace-0.1.0/src/lib.rs +99 -0
- setreplace-0.1.0/src/matcher.rs +427 -0
- setreplace-0.1.0/src/pcg.rs +73 -0
- setreplace-0.1.0/src/rule.rs +316 -0
- setreplace-0.1.0/src/system.rs +653 -0
- setreplace-0.1.0/tests/wolfram_vectors.rs +529 -0
- setreplace-0.1.0/viz/Cargo.toml +11 -0
- setreplace-0.1.0/viz/README.md +67 -0
- setreplace-0.1.0/viz/examples/compose_comparison.rs +91 -0
- setreplace-0.1.0/viz/examples/inline_editions.rs +66 -0
- setreplace-0.1.0/viz/examples/readme_figures.rs +62 -0
- setreplace-0.1.0/viz/examples/showcase.rs +123 -0
- setreplace-0.1.0/viz/src/causal.rs +226 -0
- setreplace-0.1.0/viz/src/geometry.rs +143 -0
- setreplace-0.1.0/viz/src/layout.rs +456 -0
- setreplace-0.1.0/viz/src/lib.rs +26 -0
- setreplace-0.1.0/viz/src/pcg.rs +35 -0
- setreplace-0.1.0/viz/src/plot.rs +328 -0
- setreplace-0.1.0/viz/src/png.rs +17 -0
- setreplace-0.1.0/viz/src/style.rs +82 -0
- setreplace-0.1.0/viz/src/svg.rs +147 -0
- setreplace-0.1.0/viz/src/vec2.rs +126 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
CARGO_TERM_COLOR: always
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
rust:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
17
|
+
with:
|
|
18
|
+
components: rustfmt, clippy
|
|
19
|
+
- uses: Swatinem/rust-cache@v2
|
|
20
|
+
- run: cargo fmt --check
|
|
21
|
+
- run: cargo clippy --workspace --all-targets -- -D warnings
|
|
22
|
+
- run: cargo test --workspace
|
|
23
|
+
|
|
24
|
+
python:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
29
|
+
- uses: Swatinem/rust-cache@v2
|
|
30
|
+
- uses: actions/setup-python@v5
|
|
31
|
+
with:
|
|
32
|
+
python-version: "3.9" # oldest supported; abi3 covers the rest
|
|
33
|
+
- run: pip install ./python
|
|
34
|
+
- run: python python/tests/test_api.py
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Builds wheels for all platforms and publishes to PyPI via Trusted
|
|
4
|
+
# Publishing (no API tokens). Triggered by pushing a v* tag; see
|
|
5
|
+
# docs/release.md for the runbook.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags: ["v*"]
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
wheels:
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
include:
|
|
20
|
+
- os: ubuntu-latest
|
|
21
|
+
target: x86_64
|
|
22
|
+
smoke: true
|
|
23
|
+
- os: ubuntu-latest
|
|
24
|
+
target: aarch64
|
|
25
|
+
smoke: false # cross-compiled; can't run on the x86_64 runner
|
|
26
|
+
- os: macos-14
|
|
27
|
+
target: universal2-apple-darwin
|
|
28
|
+
smoke: true
|
|
29
|
+
- os: windows-latest
|
|
30
|
+
target: x64
|
|
31
|
+
smoke: true
|
|
32
|
+
runs-on: ${{ matrix.os }}
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
- uses: actions/setup-python@v5
|
|
36
|
+
with:
|
|
37
|
+
python-version: "3.12"
|
|
38
|
+
- name: Build wheel
|
|
39
|
+
uses: PyO3/maturin-action@v1
|
|
40
|
+
with:
|
|
41
|
+
working-directory: python
|
|
42
|
+
target: ${{ matrix.target }}
|
|
43
|
+
args: --release --out dist
|
|
44
|
+
manylinux: auto
|
|
45
|
+
- name: Smoke test
|
|
46
|
+
if: matrix.smoke
|
|
47
|
+
shell: bash
|
|
48
|
+
run: |
|
|
49
|
+
pip install --no-index --find-links python/dist setreplace
|
|
50
|
+
python -c "
|
|
51
|
+
import setreplace as sr
|
|
52
|
+
s = sr.evolve('{{x, y}} -> {{x, y}, {y, z}}', [[1, 1]], generations=5)
|
|
53
|
+
assert s.events_count == 31 and len(s.final_state) == 32
|
|
54
|
+
assert s.plot().svg.startswith('<svg')
|
|
55
|
+
print('smoke ok:', repr(s))
|
|
56
|
+
"
|
|
57
|
+
- uses: actions/upload-artifact@v4
|
|
58
|
+
with:
|
|
59
|
+
name: wheels-${{ matrix.os }}-${{ matrix.target }}
|
|
60
|
+
path: python/dist
|
|
61
|
+
|
|
62
|
+
sdist:
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/checkout@v4
|
|
66
|
+
- name: Build sdist
|
|
67
|
+
uses: PyO3/maturin-action@v1
|
|
68
|
+
with:
|
|
69
|
+
working-directory: python
|
|
70
|
+
command: sdist
|
|
71
|
+
args: --out dist
|
|
72
|
+
- uses: actions/upload-artifact@v4
|
|
73
|
+
with:
|
|
74
|
+
name: sdist
|
|
75
|
+
path: python/dist
|
|
76
|
+
|
|
77
|
+
publish:
|
|
78
|
+
needs: [wheels, sdist]
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
environment: pypi
|
|
81
|
+
permissions:
|
|
82
|
+
id-token: write # PyPI Trusted Publishing (OIDC)
|
|
83
|
+
steps:
|
|
84
|
+
- uses: actions/download-artifact@v4
|
|
85
|
+
with:
|
|
86
|
+
merge-multiple: true
|
|
87
|
+
path: dist
|
|
88
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
89
|
+
with:
|
|
90
|
+
packages-dir: dist
|