Skip to content

Commit 2c83995

Browse files
committed
update torch_admp version; minor update in dipole_charge non-pbc assertion
1 parent a84ea9f commit 2c83995

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

deepmd/pt/modifier/dipole_charge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def forward(
139139
- virial: Virial correction tensor with shape (nframes, 3, 3)
140140
"""
141141
if box is None:
142-
raise RuntimeWarning(
142+
raise RuntimeError(
143143
"dipole_charge data modifier can only be applied for periodic systems."
144144
)
145145
else:

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ pin_pytorch_cpu = [
164164
# macos x86 has been deprecated
165165
"torch>=2.8,<2.10; platform_machine!='x86_64' or platform_system != 'Darwin'",
166166
"torch; platform_machine=='x86_64' and platform_system == 'Darwin'",
167-
"torch_admp @ git+https://github.com/chiahsinchu/torch-admp.git@v1.1.0a",
167+
"torch_admp @ git+https://github.com/chiahsinchu/torch-admp.git@v1.1.1",
168168
]
169169
pin_pytorch_gpu = [
170170
"torch>=2.7,<2.10",
171-
"torch_admp @ git+https://github.com/chiahsinchu/torch-admp.git@v1.1.0a",
171+
"torch_admp @ git+https://github.com/chiahsinchu/torch-admp.git@v1.1.1",
172172
]
173173
pin_jax = [
174174
"jax==0.5.0;python_version>='3.10'",

source/tests/pt/modifier/test_dipole_charge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,17 @@ def test_serialize(self):
171171
)
172172

173173
def test_box_none_warning(self):
174-
"""Test that a RuntimeWarning is raised when box is None."""
175-
coord, box, atype = ref_data()
174+
"""Test that a RuntimeError is raised when box is None."""
175+
coord, _box, atype = ref_data()
176176
# consistent with the input shape from BaseModifier.modify_data
177177
t_coord = to_torch_tensor(coord).to(DTYPE).reshape(1, -1, 3)
178178
t_atype = to_torch_tensor(atype).to(torch.long)
179179

180-
with self.assertRaises(RuntimeWarning) as context:
180+
with self.assertRaises(RuntimeError) as context:
181181
self.dm_pt(
182182
coord=t_coord,
183183
atype=t_atype,
184-
box=None, # Pass None to trigger the warning
184+
box=None, # Pass None to trigger the error
185185
)
186186

187187
self.assertIn(

0 commit comments

Comments
 (0)