arrayff 0.0.1__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.
- arrayff-0.0.1/PKG-INFO +142 -0
- arrayff-0.0.1/README.md +110 -0
- arrayff-0.0.1/pyproject.toml +162 -0
- arrayff-0.0.1/pyproject.toml.orig +143 -0
- arrayff-0.0.1/src/LICENSE +674 -0
- arrayff-0.0.1/src/arrayff/__init__.py +29 -0
- arrayff-0.0.1/src/arrayff/electrostatics/__init__.py +20 -0
- arrayff-0.0.1/src/arrayff/electrostatics/calculator.py +18 -0
- arrayff-0.0.1/src/arrayff/electrostatics/placeholders.py +23 -0
- arrayff-0.0.1/src/arrayff/electrostatics/qeq.py +498 -0
- arrayff-0.0.1/src/arrayff/neighbors/__init__.py +9 -0
- arrayff-0.0.1/src/arrayff/neighbors/_list.py +649 -0
- arrayff-0.0.1/src/arrayff/neighbors/_table.py +388 -0
- arrayff-0.0.1/src/arrayff/potentials/__init__.py +76 -0
- arrayff-0.0.1/src/arrayff/potentials/_torch.py +44 -0
- arrayff-0.0.1/src/arrayff/potentials/base.py +720 -0
- arrayff-0.0.1/src/arrayff/potentials/calculator.py +146 -0
- arrayff-0.0.1/src/arrayff/potentials/composite.py +142 -0
- arrayff-0.0.1/src/arrayff/potentials/eam/__init__.py +1 -0
- arrayff-0.0.1/src/arrayff/potentials/eam/_torch.py +31 -0
- arrayff-0.0.1/src/arrayff/potentials/eam/calculator.py +20 -0
- arrayff-0.0.1/src/arrayff/potentials/eam/eam.py +233 -0
- arrayff-0.0.1/src/arrayff/potentials/eam/io/__init__.py +8 -0
- arrayff-0.0.1/src/arrayff/potentials/eam/io/eam.py +115 -0
- arrayff-0.0.1/src/arrayff/potentials/emt/__init__.py +1 -0
- arrayff-0.0.1/src/arrayff/potentials/emt/_torch.py +38 -0
- arrayff-0.0.1/src/arrayff/potentials/emt/calculator.py +18 -0
- arrayff-0.0.1/src/arrayff/potentials/emt/emt.py +353 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/__init__.py +21 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/_pairs.py +36 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/_torch.py +181 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/base.py +346 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/calculator.py +43 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/forms.py +147 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/lj.py +134 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/lj93.py +85 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/lj_kim.py +138 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/morse.py +100 -0
- arrayff-0.0.1/src/arrayff/potentials/pairwise/params.py +50 -0
- arrayff-0.0.1/src/arrayff/potentials/placeholders.py +37 -0
- arrayff-0.0.1/src/arrayff/potentials/registry.py +49 -0
- arrayff-0.0.1/src/arrayff/py.typed +0 -0
- arrayff-0.0.1/src/arrayff/utils/__init__.py +50 -0
- arrayff-0.0.1/src/arrayff/utils/ad.py +272 -0
- arrayff-0.0.1/src/arrayff/utils/ase.py +68 -0
- arrayff-0.0.1/src/arrayff/utils/backend.py +101 -0
- arrayff-0.0.1/src/arrayff/utils/dispatch.py +118 -0
- arrayff-0.0.1/src/arrayff/utils/exceptions.py +19 -0
- arrayff-0.0.1/src/arrayff/utils/interp.py +77 -0
- arrayff-0.0.1/src/arrayff/utils/jit.py +51 -0
- arrayff-0.0.1/src/arrayff/utils/optional.py +38 -0
arrayff-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: arrayff
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: The Force Field Library Based on Multiple Array Backends like NumPy, PyTorch and JAX.
|
|
5
|
+
Keywords: chemistry,Force Field
|
|
6
|
+
Author: LiuGaoyong
|
|
7
|
+
Author-email: LiuGaoyong <liugaoyong_88@163.com>
|
|
8
|
+
License-Expression: GPL-3.0-or-later
|
|
9
|
+
License-File: src/LICENSE
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Requires-Dist: numpy>=2,<3
|
|
14
|
+
Requires-Dist: ase>=3.23
|
|
15
|
+
Requires-Dist: autoray>=0.6
|
|
16
|
+
Requires-Dist: autograd>=1.6
|
|
17
|
+
Requires-Dist: scipy>=1.10,<2
|
|
18
|
+
Requires-Dist: scikit-learn>=1.5
|
|
19
|
+
Requires-Dist: vesin ; extra == 'builders'
|
|
20
|
+
Requires-Dist: matscipy ; extra == 'builders'
|
|
21
|
+
Requires-Dist: pymatgen ; extra == 'builders'
|
|
22
|
+
Requires-Dist: jax>=0.5 ; extra == 'jax'
|
|
23
|
+
Requires-Dist: torch>=2.3 ; extra == 'torch'
|
|
24
|
+
Requires-Python: >=3.12
|
|
25
|
+
Project-URL: Homepage, https://github.com/LiuGaoyong/ArrayFF
|
|
26
|
+
Project-URL: Repository, https://github.com/LiuGaoyong/ArrayFF
|
|
27
|
+
Project-URL: Issues, https://github.com/LiuGaoyong/ArrayFF/issues/
|
|
28
|
+
Provides-Extra: builders
|
|
29
|
+
Provides-Extra: jax
|
|
30
|
+
Provides-Extra: torch
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# ArrayFF
|
|
34
|
+
|
|
35
|
+
The Force Field Library Based on Multiple Array Backends like NumPy, PyTorch
|
|
36
|
+
and JAX.
|
|
37
|
+
|
|
38
|
+
Kernels are written once with [`autoray`](https://github.com/jcmgray/autoray),
|
|
39
|
+
so the backend is chosen by the arrays you pass in. Structural I/O uses
|
|
40
|
+
`ase.Atoms` throughout.
|
|
41
|
+
|
|
42
|
+
The only required array backends are NumPy and
|
|
43
|
+
[`autograd`](https://github.com/HIPS/autograd) (for NumPy autodiff); PyTorch and
|
|
44
|
+
JAX are optional extras.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv pip install -e .
|
|
50
|
+
uv pip install -e ".[torch]" # optional PyTorch backend + nn wrappers
|
|
51
|
+
uv pip install -e ".[jax]" # optional JAX backend
|
|
52
|
+
uv pip install -e ".[builders]" # vesin / matscipy / pymatgen neighbours
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Quick start
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from ase.build import bulk
|
|
59
|
+
from arrayff.potentials import EMT, EMTCalculator
|
|
60
|
+
|
|
61
|
+
atoms = bulk("Cu", "fcc", a=3.6, cubic=True).repeat((2, 2, 2))
|
|
62
|
+
|
|
63
|
+
calc = EMT() # numpy backend + autograd for forces
|
|
64
|
+
energy, forces = calc.energy_and_forces(atoms, method="analytic")
|
|
65
|
+
|
|
66
|
+
atoms.calc = EMTCalculator() # ASE calculator interface
|
|
67
|
+
energy = atoms.get_potential_energy()
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Backends are selected at construction:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
calc = EMT(backend="torch") # or "jax"
|
|
74
|
+
calc = EMT(backend="jax", jit=True)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`LennardJones()` without arguments uses the OpenKIM universal shifted
|
|
78
|
+
parameters (118 elements, cutoff `4*sigma` per pair, Lorentz-Berthelot
|
|
79
|
+
mixing: arithmetic `r0`/cutoff and geometric `epsilon`).
|
|
80
|
+
|
|
81
|
+
Each potential exposes analytic and autodiff forces/stress:
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from arrayff.potentials import LennardJones
|
|
85
|
+
|
|
86
|
+
calc = LennardJones(cutoff=8.0, sigma=3.405, epsilon=0.01032)
|
|
87
|
+
calc.energy_and_forces(atoms, method="analytic")
|
|
88
|
+
calc.energy_and_forces(atoms, method="autodiff")
|
|
89
|
+
calc.stress(atoms, method="analytic")
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`jit=True` compiles the array-level kernel with `autoray.autojit` (JAX and
|
|
93
|
+
PyTorch are the useful backends; NumPy's compiler is best-effort).
|
|
94
|
+
|
|
95
|
+
## Charge equilibration and composite potentials
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from arrayff.electrostatics import QEq
|
|
99
|
+
|
|
100
|
+
qeq = QEq(chi={8: 8.5, 1: 4.5}, J={8: 10.0, 1: 12.0}, shielding=1.0)
|
|
101
|
+
charges = qeq.charges(atoms) # sum == total charge
|
|
102
|
+
|
|
103
|
+
# additive composite: energy/forces/stress add, charges come from QEq
|
|
104
|
+
composite = LennardJones(cutoff=8.0, sigma=3.405, epsilon=0.01032) + qeq
|
|
105
|
+
energy, forces = composite.energy_and_forces(atoms)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
QEq supports `charge_response="frozen"` (Hellmann-Feynman, default) and
|
|
109
|
+
`"relaxed"` (differentiate through the charge solve).
|
|
110
|
+
|
|
111
|
+
## Training (optional)
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from arrayff.potentials import LJTorch
|
|
115
|
+
|
|
116
|
+
model = LJTorch(species=[18]) # epsilon/sigma trainable
|
|
117
|
+
loss = (model(atoms) - target_energy) ** 2
|
|
118
|
+
loss.backward()
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Tests and benchmarks
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
pytest -q
|
|
125
|
+
pytest -s src/tests-benchmark/bench_potentials.py
|
|
126
|
+
pytest -s src/tests-benchmark/bench_derivatives.py
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The benchmark tables compare analytic vs autodiff forces/stress and
|
|
130
|
+
`jit=False/True` across backends.
|
|
131
|
+
|
|
132
|
+
## Status
|
|
133
|
+
|
|
134
|
+
| Potential | State |
|
|
135
|
+
|---|---|
|
|
136
|
+
| Lennard-Jones (OpenKIM universal shifted) | implemented |
|
|
137
|
+
| Lennard-Jones 9-3, Morse | implemented |
|
|
138
|
+
| EMT (matches `ase.calculators.emt`, including `asap_cutoff`) | implemented |
|
|
139
|
+
| EAM (setfl tables, matches `ase.calculators.eam`) | implemented |
|
|
140
|
+
| QEq (shielded Coulomb, extended matrix, frozen/relaxed response) | implemented |
|
|
141
|
+
| Additive composites (`LJ + QEq`, ...) | implemented |
|
|
142
|
+
| MEAM, UF3, EEM, PQEq | declared placeholders |
|
arrayff-0.0.1/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# ArrayFF
|
|
2
|
+
|
|
3
|
+
The Force Field Library Based on Multiple Array Backends like NumPy, PyTorch
|
|
4
|
+
and JAX.
|
|
5
|
+
|
|
6
|
+
Kernels are written once with [`autoray`](https://github.com/jcmgray/autoray),
|
|
7
|
+
so the backend is chosen by the arrays you pass in. Structural I/O uses
|
|
8
|
+
`ase.Atoms` throughout.
|
|
9
|
+
|
|
10
|
+
The only required array backends are NumPy and
|
|
11
|
+
[`autograd`](https://github.com/HIPS/autograd) (for NumPy autodiff); PyTorch and
|
|
12
|
+
JAX are optional extras.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
uv pip install -e .
|
|
18
|
+
uv pip install -e ".[torch]" # optional PyTorch backend + nn wrappers
|
|
19
|
+
uv pip install -e ".[jax]" # optional JAX backend
|
|
20
|
+
uv pip install -e ".[builders]" # vesin / matscipy / pymatgen neighbours
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from ase.build import bulk
|
|
27
|
+
from arrayff.potentials import EMT, EMTCalculator
|
|
28
|
+
|
|
29
|
+
atoms = bulk("Cu", "fcc", a=3.6, cubic=True).repeat((2, 2, 2))
|
|
30
|
+
|
|
31
|
+
calc = EMT() # numpy backend + autograd for forces
|
|
32
|
+
energy, forces = calc.energy_and_forces(atoms, method="analytic")
|
|
33
|
+
|
|
34
|
+
atoms.calc = EMTCalculator() # ASE calculator interface
|
|
35
|
+
energy = atoms.get_potential_energy()
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Backends are selected at construction:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
calc = EMT(backend="torch") # or "jax"
|
|
42
|
+
calc = EMT(backend="jax", jit=True)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`LennardJones()` without arguments uses the OpenKIM universal shifted
|
|
46
|
+
parameters (118 elements, cutoff `4*sigma` per pair, Lorentz-Berthelot
|
|
47
|
+
mixing: arithmetic `r0`/cutoff and geometric `epsilon`).
|
|
48
|
+
|
|
49
|
+
Each potential exposes analytic and autodiff forces/stress:
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from arrayff.potentials import LennardJones
|
|
53
|
+
|
|
54
|
+
calc = LennardJones(cutoff=8.0, sigma=3.405, epsilon=0.01032)
|
|
55
|
+
calc.energy_and_forces(atoms, method="analytic")
|
|
56
|
+
calc.energy_and_forces(atoms, method="autodiff")
|
|
57
|
+
calc.stress(atoms, method="analytic")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`jit=True` compiles the array-level kernel with `autoray.autojit` (JAX and
|
|
61
|
+
PyTorch are the useful backends; NumPy's compiler is best-effort).
|
|
62
|
+
|
|
63
|
+
## Charge equilibration and composite potentials
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from arrayff.electrostatics import QEq
|
|
67
|
+
|
|
68
|
+
qeq = QEq(chi={8: 8.5, 1: 4.5}, J={8: 10.0, 1: 12.0}, shielding=1.0)
|
|
69
|
+
charges = qeq.charges(atoms) # sum == total charge
|
|
70
|
+
|
|
71
|
+
# additive composite: energy/forces/stress add, charges come from QEq
|
|
72
|
+
composite = LennardJones(cutoff=8.0, sigma=3.405, epsilon=0.01032) + qeq
|
|
73
|
+
energy, forces = composite.energy_and_forces(atoms)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
QEq supports `charge_response="frozen"` (Hellmann-Feynman, default) and
|
|
77
|
+
`"relaxed"` (differentiate through the charge solve).
|
|
78
|
+
|
|
79
|
+
## Training (optional)
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from arrayff.potentials import LJTorch
|
|
83
|
+
|
|
84
|
+
model = LJTorch(species=[18]) # epsilon/sigma trainable
|
|
85
|
+
loss = (model(atoms) - target_energy) ** 2
|
|
86
|
+
loss.backward()
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Tests and benchmarks
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pytest -q
|
|
93
|
+
pytest -s src/tests-benchmark/bench_potentials.py
|
|
94
|
+
pytest -s src/tests-benchmark/bench_derivatives.py
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The benchmark tables compare analytic vs autodiff forces/stress and
|
|
98
|
+
`jit=False/True` across backends.
|
|
99
|
+
|
|
100
|
+
## Status
|
|
101
|
+
|
|
102
|
+
| Potential | State |
|
|
103
|
+
|---|---|
|
|
104
|
+
| Lennard-Jones (OpenKIM universal shifted) | implemented |
|
|
105
|
+
| Lennard-Jones 9-3, Morse | implemented |
|
|
106
|
+
| EMT (matches `ase.calculators.emt`, including `asap_cutoff`) | implemented |
|
|
107
|
+
| EAM (setfl tables, matches `ase.calculators.eam`) | implemented |
|
|
108
|
+
| QEq (shielded Coulomb, extended matrix, frozen/relaxed response) | implemented |
|
|
109
|
+
| Additive composites (`LJ + QEq`, ...) | implemented |
|
|
110
|
+
| MEAM, UF3, EEM, PQEq | declared placeholders |
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["uv_build>=0.11.15,<0.12"]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "arrayff"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
description = "The Force Field Library Based on Multiple Array Backends like NumPy, PyTorch and JAX."
|
|
10
|
+
license-files = ["src/LICENSE"]
|
|
11
|
+
license = "GPL-3.0-or-later"
|
|
12
|
+
requires-python = ">=3.12"
|
|
13
|
+
keywords = [
|
|
14
|
+
"chemistry",
|
|
15
|
+
"Force Field",
|
|
16
|
+
]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 5 - Production/Stable",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Chemistry",
|
|
20
|
+
"Intended Audience :: Science/Research",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"numpy>=2,<3",
|
|
24
|
+
"ase>=3.23",
|
|
25
|
+
"autoray>=0.6",
|
|
26
|
+
"autograd>=1.6",
|
|
27
|
+
"scipy>=1.10,<2",
|
|
28
|
+
"scikit-learn>=1.5",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/LiuGaoyong/ArrayFF"
|
|
33
|
+
Repository = "https://github.com/LiuGaoyong/ArrayFF"
|
|
34
|
+
Issues = "https://github.com/LiuGaoyong/ArrayFF/issues/"
|
|
35
|
+
|
|
36
|
+
[[project.authors]]
|
|
37
|
+
name = "LiuGaoyong"
|
|
38
|
+
email = "liugaoyong_88@163.com"
|
|
39
|
+
|
|
40
|
+
[project.optional-dependencies]
|
|
41
|
+
torch = ["torch>=2.3"]
|
|
42
|
+
jax = ["jax>=0.5"]
|
|
43
|
+
builders = [
|
|
44
|
+
"vesin",
|
|
45
|
+
"matscipy",
|
|
46
|
+
"pymatgen",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[dependency-groups]
|
|
50
|
+
dev = [
|
|
51
|
+
"ruff>=0.11",
|
|
52
|
+
"pymatgen>=2023.6",
|
|
53
|
+
"array-api-strict>=2.5",
|
|
54
|
+
"pytest>=8.3",
|
|
55
|
+
"pytest-xdist",
|
|
56
|
+
"jupyterlab",
|
|
57
|
+
"chemiscope",
|
|
58
|
+
"autograd>=1.6",
|
|
59
|
+
"nglview",
|
|
60
|
+
"jax>=0.5",
|
|
61
|
+
"torch>=2.10",
|
|
62
|
+
"matscipy",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[tool.uv]
|
|
66
|
+
package = true
|
|
67
|
+
|
|
68
|
+
[[tool.uv.index]]
|
|
69
|
+
name = "pypi"
|
|
70
|
+
url = "https://mirrors.cernet.edu.cn/pypi/web/simple"
|
|
71
|
+
default = true
|
|
72
|
+
|
|
73
|
+
[tool.pytest.ini_options]
|
|
74
|
+
filterwarnings = [
|
|
75
|
+
"error",
|
|
76
|
+
"ignore::RuntimeWarning",
|
|
77
|
+
"ignore::DeprecationWarning",
|
|
78
|
+
"ignore::pytest.PytestAssertRewriteWarning",
|
|
79
|
+
"ignore:unclosed file.*:ResourceWarning",
|
|
80
|
+
]
|
|
81
|
+
addopts = "--maxfail=1 -rf"
|
|
82
|
+
testpaths = ["src/tests"]
|
|
83
|
+
|
|
84
|
+
[tool.ruff]
|
|
85
|
+
line-length = 80
|
|
86
|
+
indent-width = 4
|
|
87
|
+
unsafe-fixes = true
|
|
88
|
+
|
|
89
|
+
[tool.ruff.lint]
|
|
90
|
+
select = [
|
|
91
|
+
"F",
|
|
92
|
+
"E",
|
|
93
|
+
"W",
|
|
94
|
+
"UP",
|
|
95
|
+
"TID",
|
|
96
|
+
]
|
|
97
|
+
ignore = [
|
|
98
|
+
"F722",
|
|
99
|
+
"D100",
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
[tool.ruff.lint.pydocstyle]
|
|
103
|
+
convention = "google"
|
|
104
|
+
|
|
105
|
+
[tool.pixi.package.build.backend]
|
|
106
|
+
name = "pixi-build-python"
|
|
107
|
+
version = "*"
|
|
108
|
+
|
|
109
|
+
[tool.pixi.workspace]
|
|
110
|
+
preview = ["pixi-build"]
|
|
111
|
+
channels = ["conda-forge"]
|
|
112
|
+
platforms = [
|
|
113
|
+
"linux-64",
|
|
114
|
+
"osx-arm64",
|
|
115
|
+
"win-64",
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
[tool.pixi.pypi-dependencies.arrayff]
|
|
119
|
+
path = "."
|
|
120
|
+
editable = true
|
|
121
|
+
|
|
122
|
+
[tool.pixi.environments.default]
|
|
123
|
+
solve-group = "default"
|
|
124
|
+
|
|
125
|
+
[tool.pixi.environments.dev]
|
|
126
|
+
features = ["dev"]
|
|
127
|
+
solve-group = "default"
|
|
128
|
+
|
|
129
|
+
[tool.pixi.tasks]
|
|
130
|
+
test = "pytest -s -vv"
|
|
131
|
+
benchmark = "pytest -s src/tests-benchmark/*.py"
|
|
132
|
+
|
|
133
|
+
[tool.pixi.dependencies]
|
|
134
|
+
python = ">=3.12"
|
|
135
|
+
pytest = ">=8"
|
|
136
|
+
array-api-compat = ">=1.15.0"
|
|
137
|
+
array-api-extra = ">=0.11.0"
|
|
138
|
+
array-api-strict = ">=2.5.0"
|
|
139
|
+
autoray = ">=0.1.0"
|
|
140
|
+
scikit-learn = ">=1.8.0"
|
|
141
|
+
numpy = ">=2.0.0"
|
|
142
|
+
autograd = ">=1.6"
|
|
143
|
+
scipy = ">=1.10.2"
|
|
144
|
+
jupyterlab = ">=4.5.8"
|
|
145
|
+
pytest-xdist = ">=3.8.0"
|
|
146
|
+
nglview = ">=0.14.0"
|
|
147
|
+
ruff = ">=0.11"
|
|
148
|
+
chemiscope = ">=0.1.0"
|
|
149
|
+
typing-extensions = ">=4.12.0"
|
|
150
|
+
pytorch = ">=2.3.0"
|
|
151
|
+
opt_einsum = ">=0.1.0"
|
|
152
|
+
ml_dtypes = ">=0.1.0"
|
|
153
|
+
python-vesin = ">=0.1.0"
|
|
154
|
+
pymatgen = ">=2023.6"
|
|
155
|
+
|
|
156
|
+
[tool.pixi.target.osx-arm64.dependencies]
|
|
157
|
+
matscipy = ">=0.1.0"
|
|
158
|
+
jax = ">=0.5.0"
|
|
159
|
+
|
|
160
|
+
[tool.pixi.target.linux-64.dependencies]
|
|
161
|
+
matscipy = ">=0.1.0"
|
|
162
|
+
jax = ">=0.5.0"
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["uv_build>=0.11.15,<0.12"]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
|
|
5
|
+
[project.urls]
|
|
6
|
+
Homepage = "https://github.com/LiuGaoyong/ArrayFF"
|
|
7
|
+
Repository = "https://github.com/LiuGaoyong/ArrayFF"
|
|
8
|
+
Issues = "https://github.com/LiuGaoyong/ArrayFF/issues/"
|
|
9
|
+
[project]
|
|
10
|
+
name = "arrayff"
|
|
11
|
+
version = "0.0.1"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
description = "The Force Field Library Based on Multiple Array Backends like NumPy, PyTorch and JAX."
|
|
14
|
+
authors = [{ name = "LiuGaoyong", email = "liugaoyong_88@163.com" }]
|
|
15
|
+
license-files = ["src/LICENSE"]
|
|
16
|
+
license = "GPL-3.0-or-later"
|
|
17
|
+
requires-python = ">=3.12"
|
|
18
|
+
keywords = [
|
|
19
|
+
"chemistry", #
|
|
20
|
+
"Force Field",
|
|
21
|
+
]
|
|
22
|
+
classifiers = [
|
|
23
|
+
"Development Status :: 5 - Production/Stable",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Chemistry",
|
|
25
|
+
"Intended Audience :: Science/Research",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"numpy>=2,<3",
|
|
29
|
+
"ase>=3.23",
|
|
30
|
+
"autoray>=0.6",
|
|
31
|
+
"autograd>=1.6",
|
|
32
|
+
"scipy>=1.10,<2",
|
|
33
|
+
"scikit-learn>=1.5",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
torch = ["torch>=2.3"]
|
|
38
|
+
jax = ["jax>=0.5"]
|
|
39
|
+
builders = ["vesin", "matscipy", "pymatgen"]
|
|
40
|
+
|
|
41
|
+
[dependency-groups]
|
|
42
|
+
dev = [
|
|
43
|
+
"ruff>=0.11",
|
|
44
|
+
"pymatgen>=2023.6",
|
|
45
|
+
"array-api-strict>=2.5", # for test
|
|
46
|
+
"pytest>=8.3",
|
|
47
|
+
"pytest-xdist",
|
|
48
|
+
"jupyterlab",
|
|
49
|
+
"chemiscope",
|
|
50
|
+
# "playwright>=1.52", # chemiscope [headless]
|
|
51
|
+
"autograd>=1.6",
|
|
52
|
+
"nglview",
|
|
53
|
+
"jax>=0.5",
|
|
54
|
+
"torch>=2.10",
|
|
55
|
+
"matscipy",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
# uv config
|
|
59
|
+
[tool.uv]
|
|
60
|
+
package = true
|
|
61
|
+
[[tool.uv.index]]
|
|
62
|
+
name = "pypi"
|
|
63
|
+
url = "https://mirrors.cernet.edu.cn/pypi/web/simple" # CERNET
|
|
64
|
+
default = true
|
|
65
|
+
|
|
66
|
+
# pytest config
|
|
67
|
+
[tool.pytest.ini_options]
|
|
68
|
+
filterwarnings = [
|
|
69
|
+
"error", # All other warnings are transformed into errors.
|
|
70
|
+
# ignore the following warnings that matching a regex
|
|
71
|
+
# example: "ignore:function ham\(\) is deprecated:DeprecationWarning",
|
|
72
|
+
"ignore::RuntimeWarning",
|
|
73
|
+
"ignore::DeprecationWarning",
|
|
74
|
+
"ignore::pytest.PytestAssertRewriteWarning",
|
|
75
|
+
"ignore:unclosed file.*:ResourceWarning",
|
|
76
|
+
|
|
77
|
+
]
|
|
78
|
+
addopts = "--maxfail=1 -rf" # exit after 1 failures, report fail info
|
|
79
|
+
testpaths = ["src/tests"]
|
|
80
|
+
|
|
81
|
+
# ruff config
|
|
82
|
+
[tool.ruff]
|
|
83
|
+
line-length = 80
|
|
84
|
+
indent-width = 4
|
|
85
|
+
unsafe-fixes = true
|
|
86
|
+
[tool.ruff.lint]
|
|
87
|
+
select = ["F", "E", "W", "UP", "TID"]
|
|
88
|
+
ignore = ["F722", "D100"]
|
|
89
|
+
[tool.ruff.lint.pydocstyle]
|
|
90
|
+
convention = "google"
|
|
91
|
+
|
|
92
|
+
[tool.pixi.package]
|
|
93
|
+
|
|
94
|
+
[tool.pixi.package.build]
|
|
95
|
+
backend = { name = "pixi-build-python", version = "*" }
|
|
96
|
+
|
|
97
|
+
[tool.pixi.workspace]
|
|
98
|
+
preview = ["pixi-build"]
|
|
99
|
+
channels = ["conda-forge"]
|
|
100
|
+
platforms = ["linux-64", "osx-arm64", "win-64"]
|
|
101
|
+
|
|
102
|
+
[tool.pixi.pypi-dependencies]
|
|
103
|
+
arrayff = { path = ".", editable = true }
|
|
104
|
+
|
|
105
|
+
[tool.pixi.environments]
|
|
106
|
+
default = { solve-group = "default" }
|
|
107
|
+
dev = { features = ["dev"], solve-group = "default" }
|
|
108
|
+
|
|
109
|
+
[tool.pixi.tasks]
|
|
110
|
+
test = "pytest -s -vv"
|
|
111
|
+
benchmark = "pytest -s src/tests-benchmark/*.py"
|
|
112
|
+
|
|
113
|
+
[tool.pixi.dependencies]
|
|
114
|
+
python = ">=3.12"
|
|
115
|
+
pytest = ">=8"
|
|
116
|
+
array-api-compat = ">=1.15.0"
|
|
117
|
+
array-api-extra = ">=0.11.0"
|
|
118
|
+
array-api-strict = ">=2.5.0"
|
|
119
|
+
autoray = ">=0.1.0"
|
|
120
|
+
scikit-learn = ">=1.8.0"
|
|
121
|
+
numpy = ">=2.0.0"
|
|
122
|
+
autograd = ">=1.6"
|
|
123
|
+
scipy = ">=1.10.2"
|
|
124
|
+
jupyterlab = ">=4.5.8"
|
|
125
|
+
pytest-xdist = ">=3.8.0"
|
|
126
|
+
nglview = ">=0.14.0"
|
|
127
|
+
ruff = ">=0.11"
|
|
128
|
+
chemiscope = ">=0.1.0"
|
|
129
|
+
# types-array-api = ">=1.0.0"
|
|
130
|
+
typing-extensions = ">=4.12.0"
|
|
131
|
+
pytorch = ">=2.3.0"
|
|
132
|
+
opt_einsum = ">=0.1.0"
|
|
133
|
+
ml_dtypes = ">=0.1.0"
|
|
134
|
+
python-vesin = ">=0.1.0"
|
|
135
|
+
pymatgen = ">=2023.6"
|
|
136
|
+
|
|
137
|
+
[tool.pixi.target.osx-arm64.dependencies]
|
|
138
|
+
matscipy = ">=0.1.0"
|
|
139
|
+
jax = ">=0.5.0"
|
|
140
|
+
|
|
141
|
+
[tool.pixi.target.linux-64.dependencies]
|
|
142
|
+
matscipy = ">=0.1.0"
|
|
143
|
+
jax = ">=0.5.0"
|