diff --git a/CHANGELOG.md b/CHANGELOG.md index 477b4ea..a387199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Changed -- Add `rcut` option to `build_random_cell`. +- Add mandatory `rcut` option to `build_random_cell`. ## [0.1.0] - 2024-10-06 diff --git a/src/tinyff/atomsmithy.py b/src/tinyff/atomsmithy.py index d1d8b1b..df91c27 100644 --- a/src/tinyff/atomsmithy.py +++ b/src/tinyff/atomsmithy.py @@ -97,8 +97,8 @@ def __call__(self, dist: ArrayLike) -> tuple[NDArray, NDArray]: def build_random_cell( cell_length: float, natom: int, + rcut: float, *, - rcut: float | None = None, maxiter: int = 100, rng: np.random.Generator | None = None, ): @@ -109,8 +109,6 @@ def build_random_cell( atpos0 = rng.uniform(0, cell_length, (natom, 3)) # Define cost function to push the atoms appart. - if rcut is None: - rcut = 0.49 * cell_length pwff = PairwiseForceField(PushPotential(rcut), rcut) def costgrad(atpos_raveled): diff --git a/tests/test_atomsmithy.py b/tests/test_atomsmithy.py index a89f25a..a2f51b0 100644 --- a/tests/test_atomsmithy.py +++ b/tests/test_atomsmithy.py @@ -128,6 +128,6 @@ def test_push_cutoff(): def test_random_box(): rng = np.random.default_rng(42) - atpos = build_random_cell(10.0, 32, rng=rng) + atpos = build_random_cell(10.0, 32, 3.0, rng=rng) nlist = build_nlist_simple(atpos, [10.0, 10.0, 10.0], rcut=4.0) assert nlist["dist"].min() > 2.0