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.
- atommatch-0.1.0/.github/workflows/ci.yml +26 -0
- atommatch-0.1.0/.github/workflows/docs.yml +45 -0
- atommatch-0.1.0/.github/workflows/release.yml +94 -0
- atommatch-0.1.0/.gitignore +8 -0
- atommatch-0.1.0/CHANGELOG.md +16 -0
- atommatch-0.1.0/Cargo.lock +563 -0
- atommatch-0.1.0/Cargo.toml +27 -0
- atommatch-0.1.0/LICENSE +675 -0
- atommatch-0.1.0/PKG-INFO +233 -0
- atommatch-0.1.0/README.md +201 -0
- atommatch-0.1.0/benchmarks/bench.py +246 -0
- atommatch-0.1.0/benchmarks/bench_mol.py +173 -0
- atommatch-0.1.0/benchmarks/common.py +143 -0
- atommatch-0.1.0/benchmarks/dump_pairs.py +27 -0
- atommatch-0.1.0/benchmarks/results/crystals-apex.json +325 -0
- atommatch-0.1.0/benchmarks/results/molecules-apex.json +165 -0
- atommatch-0.1.0/benchmarks/scale.py +28 -0
- atommatch-0.1.0/docs/algorithm.md +102 -0
- atommatch-0.1.0/docs/api.md +13 -0
- atommatch-0.1.0/docs/assets/logo.svg +26 -0
- atommatch-0.1.0/docs/benchmarks.md +148 -0
- atommatch-0.1.0/docs/guide.md +134 -0
- atommatch-0.1.0/docs/index.md +32 -0
- atommatch-0.1.0/docs/install.md +70 -0
- atommatch-0.1.0/docs/molecules.md +134 -0
- atommatch-0.1.0/docs/pymatgen.md +30 -0
- atommatch-0.1.0/examples/common/io.rs +26 -0
- atommatch-0.1.0/examples/pairprof.rs +37 -0
- atommatch-0.1.0/examples/primdebug.rs +21 -0
- atommatch-0.1.0/examples/profile.rs +31 -0
- atommatch-0.1.0/pyproject.toml +42 -0
- atommatch-0.1.0/python/atommatch/__init__.py +369 -0
- atommatch-0.1.0/src/batch.rs +193 -0
- atommatch-0.1.0/src/lap.rs +112 -0
- atommatch-0.1.0/src/lattice.rs +231 -0
- atommatch-0.1.0/src/lib.rs +15 -0
- atommatch-0.1.0/src/matcher.rs +443 -0
- atommatch-0.1.0/src/molecule.rs +513 -0
- atommatch-0.1.0/src/primitive.rs +434 -0
- atommatch-0.1.0/src/python.rs +507 -0
- atommatch-0.1.0/src/store.rs +378 -0
- atommatch-0.1.0/src/structure.rs +352 -0
- atommatch-0.1.0/src/symmetry.rs +129 -0
- atommatch-0.1.0/src/testutil.rs +133 -0
- atommatch-0.1.0/tests/molgen.py +44 -0
- atommatch-0.1.0/tests/structgen.py +70 -0
- atommatch-0.1.0/tests/test_api.py +157 -0
- atommatch-0.1.0/tests/test_match.py +79 -0
- atommatch-0.1.0/tests/test_molecule.py +84 -0
- atommatch-0.1.0/tests/test_persist.py +162 -0
- atommatch-0.1.0/tests/test_prepared.py +116 -0
- 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,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.
|