atommatch 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.
Files changed (52) hide show
  1. atommatch-0.1.0/.github/workflows/ci.yml +26 -0
  2. atommatch-0.1.0/.github/workflows/docs.yml +45 -0
  3. atommatch-0.1.0/.github/workflows/release.yml +94 -0
  4. atommatch-0.1.0/.gitignore +8 -0
  5. atommatch-0.1.0/CHANGELOG.md +16 -0
  6. atommatch-0.1.0/Cargo.lock +563 -0
  7. atommatch-0.1.0/Cargo.toml +27 -0
  8. atommatch-0.1.0/LICENSE +675 -0
  9. atommatch-0.1.0/PKG-INFO +233 -0
  10. atommatch-0.1.0/README.md +201 -0
  11. atommatch-0.1.0/benchmarks/bench.py +246 -0
  12. atommatch-0.1.0/benchmarks/bench_mol.py +173 -0
  13. atommatch-0.1.0/benchmarks/common.py +143 -0
  14. atommatch-0.1.0/benchmarks/dump_pairs.py +27 -0
  15. atommatch-0.1.0/benchmarks/results/crystals-apex.json +325 -0
  16. atommatch-0.1.0/benchmarks/results/molecules-apex.json +165 -0
  17. atommatch-0.1.0/benchmarks/scale.py +28 -0
  18. atommatch-0.1.0/docs/algorithm.md +102 -0
  19. atommatch-0.1.0/docs/api.md +13 -0
  20. atommatch-0.1.0/docs/assets/logo.svg +26 -0
  21. atommatch-0.1.0/docs/benchmarks.md +148 -0
  22. atommatch-0.1.0/docs/guide.md +134 -0
  23. atommatch-0.1.0/docs/index.md +32 -0
  24. atommatch-0.1.0/docs/install.md +70 -0
  25. atommatch-0.1.0/docs/molecules.md +134 -0
  26. atommatch-0.1.0/docs/pymatgen.md +30 -0
  27. atommatch-0.1.0/examples/common/io.rs +26 -0
  28. atommatch-0.1.0/examples/pairprof.rs +37 -0
  29. atommatch-0.1.0/examples/primdebug.rs +21 -0
  30. atommatch-0.1.0/examples/profile.rs +31 -0
  31. atommatch-0.1.0/pyproject.toml +42 -0
  32. atommatch-0.1.0/python/atommatch/__init__.py +369 -0
  33. atommatch-0.1.0/src/batch.rs +193 -0
  34. atommatch-0.1.0/src/lap.rs +112 -0
  35. atommatch-0.1.0/src/lattice.rs +231 -0
  36. atommatch-0.1.0/src/lib.rs +15 -0
  37. atommatch-0.1.0/src/matcher.rs +443 -0
  38. atommatch-0.1.0/src/molecule.rs +513 -0
  39. atommatch-0.1.0/src/primitive.rs +434 -0
  40. atommatch-0.1.0/src/python.rs +507 -0
  41. atommatch-0.1.0/src/store.rs +378 -0
  42. atommatch-0.1.0/src/structure.rs +352 -0
  43. atommatch-0.1.0/src/symmetry.rs +129 -0
  44. atommatch-0.1.0/src/testutil.rs +133 -0
  45. atommatch-0.1.0/tests/molgen.py +44 -0
  46. atommatch-0.1.0/tests/structgen.py +70 -0
  47. atommatch-0.1.0/tests/test_api.py +157 -0
  48. atommatch-0.1.0/tests/test_match.py +79 -0
  49. atommatch-0.1.0/tests/test_molecule.py +84 -0
  50. atommatch-0.1.0/tests/test_persist.py +162 -0
  51. atommatch-0.1.0/tests/test_prepared.py +116 -0
  52. atommatch-0.1.0/zensical.toml +68 -0
@@ -0,0 +1,26 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v7
12
+ - uses: dtolnay/rust-toolchain@stable
13
+ - uses: Swatinem/rust-cache@v2
14
+ - uses: astral-sh/setup-uv@v10.4.0
15
+ - name: Rust unit tests
16
+ run: cargo test --release --no-default-features
17
+ - name: Build and install
18
+ run: |
19
+ uv venv .venv --python 3.12
20
+ uv pip install --python .venv maturin numpy pytest pymatgen ase zensical "mkdocstrings[python]"
21
+ .venv/bin/maturin develop --release
22
+ - name: Python tests
23
+ working-directory: tests
24
+ run: ../.venv/bin/python -m pytest -q
25
+ - name: Docs (strict)
26
+ run: .venv/bin/zensical build --clean --strict
@@ -0,0 +1,45 @@
1
+ name: docs
2
+
3
+ # Builds the Zensical documentation and publishes it to GitHub Pages at
4
+ # https://deng-group.github.io/atommatch/ on every push to main.
5
+ # mkdocstrings reads the Python sources statically, so no Rust build is needed.
6
+
7
+ on:
8
+ push:
9
+ branches: [main]
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+ pages: write
15
+ id-token: write
16
+
17
+ concurrency:
18
+ group: pages
19
+ cancel-in-progress: true
20
+
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v7
26
+ - uses: astral-sh/setup-uv@v10.4.0
27
+ with:
28
+ python-version: "3.12"
29
+ activate-environment: true
30
+ - run: uv pip install zensical "mkdocstrings[python]"
31
+ - run: zensical build --clean --strict
32
+ - uses: actions/configure-pages@v6
33
+ - uses: actions/upload-pages-artifact@v5
34
+ with:
35
+ path: site
36
+
37
+ deploy:
38
+ needs: build
39
+ runs-on: ubuntu-latest
40
+ environment:
41
+ name: github-pages
42
+ url: ${{ steps.deployment.outputs.page_url }}
43
+ steps:
44
+ - id: deployment
45
+ uses: actions/deploy-pages@v5
@@ -0,0 +1,94 @@
1
+ name: release
2
+
3
+ # Builds abi3 wheels (one per platform, CPython >= 3.9) and the sdist on every run.
4
+ # No macOS wheel: hosted macOS runners queue for long; macOS installs build the sdist.
5
+ # Pushing a tag vX.Y.Z also publishes them to PyPI through trusted publishing
6
+ # (PyPI project settings -> Publishing: repository deng-group/atommatch,
7
+ # workflow release.yml, environment pypi). No API token is stored in the repository.
8
+
9
+ on:
10
+ push:
11
+ tags: ["v*"]
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ wheels:
19
+ name: wheel ${{ matrix.os }} ${{ matrix.target }} ${{ matrix.manylinux }}
20
+ runs-on: ${{ matrix.runner }}
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ include:
25
+ - { os: linux, runner: ubuntu-latest, target: x86_64, manylinux: auto, smoke: true }
26
+ - { os: linux, runner: ubuntu-24.04-arm, target: aarch64, manylinux: auto, smoke: true }
27
+ - { os: linux, runner: ubuntu-latest, target: x86_64, manylinux: musllinux_1_2 }
28
+ - { os: linux, runner: ubuntu-24.04-arm, target: aarch64, manylinux: musllinux_1_2 }
29
+ - { os: windows, runner: windows-latest, target: x64, smoke: true }
30
+ steps:
31
+ - uses: actions/checkout@v7
32
+ - uses: actions/setup-python@v7
33
+ with:
34
+ python-version: "3.12"
35
+ - uses: PyO3/maturin-action@v1
36
+ with:
37
+ target: ${{ matrix.target }}
38
+ manylinux: ${{ matrix.manylinux }}
39
+ args: --release --out dist
40
+ - name: Smoke test the wheel
41
+ if: matrix.smoke
42
+ shell: bash
43
+ run: |
44
+ python -m pip install numpy
45
+ python -m pip install --no-index --find-links dist atommatch
46
+ cd tests && python -c "
47
+ import numpy as np, atommatch
48
+ lat = np.eye(3) * 4.2
49
+ frac = [[0, 0, 0], [0.5, 0.5, 0.5]]
50
+ a = (lat, frac, [11, 17])
51
+ b = (lat, [[0.5, 0.5, 0.5], [0, 0, 0]], [11, 17])
52
+ assert atommatch.Matcher().fit(a, b)
53
+ print('ok', atommatch.__name__)
54
+ "
55
+ - uses: actions/upload-artifact@v7
56
+ with:
57
+ name: wheel-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'native' }}
58
+ path: dist/*.whl
59
+
60
+ sdist:
61
+ runs-on: ubuntu-latest
62
+ steps:
63
+ - uses: actions/checkout@v7
64
+ - name: Tag matches the package version
65
+ if: startsWith(github.ref, 'refs/tags/v')
66
+ run: |
67
+ v=$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml | head -1)
68
+ c=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
69
+ test "v$v" = "$GITHUB_REF_NAME" && test "$v" = "$c" || { echo "tag $GITHUB_REF_NAME, pyproject $v, Cargo $c"; exit 1; }
70
+ - uses: PyO3/maturin-action@v1
71
+ with:
72
+ command: sdist
73
+ args: --out dist
74
+ - uses: actions/upload-artifact@v7
75
+ with:
76
+ name: sdist
77
+ path: dist/*.tar.gz
78
+
79
+ publish:
80
+ if: startsWith(github.ref, 'refs/tags/v')
81
+ needs: [wheels, sdist]
82
+ runs-on: ubuntu-latest
83
+ environment:
84
+ name: pypi
85
+ url: https://pypi.org/project/atommatch/
86
+ permissions:
87
+ id-token: write
88
+ steps:
89
+ - uses: actions/download-artifact@v8
90
+ with:
91
+ path: dist
92
+ merge-multiple: true
93
+ - run: ls -l dist
94
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,8 @@
1
+ /target
2
+ /.venv
3
+ __pycache__/
4
+ *.so
5
+ *.egg-info/
6
+ .pytest_cache/
7
+ /site
8
+ .coverage
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (2026-12-02)
4
+
5
+ First release.
6
+
7
+ - `Matcher`: crystal structure matching in the style of pymatgen's `StructureMatcher`
8
+ (`fit`, `get_rms_dist`, `fit_matrix`, `group_structures`, `group_labels`), with primitive-cell
9
+ reduction, supercell matching and lattice-symmetry pruning.
10
+ - `MoleculeMatcher`: RMSD after optimal rotation, translation and per-element atom
11
+ ordering, with exact lower bounds that reject most non-matching pairs without a search.
12
+ - `Index`: incremental database of prepared structures or molecules, with `query`,
13
+ `query_first`, `save` and `load`.
14
+ - `PreparedStructure` / `PreparedMolecule`: prepare once and reuse; picklable.
15
+ - Inputs: pymatgen `Structure` / `Molecule`, ASE `Atoms`, or raw arrays.
16
+ - abi3 wheels for CPython ≥ 3.9 on Linux and Windows; macOS installs build from the sdist.