Skip to content

Commit 3f35ac6

Browse files
authored
fix SciPy DeprecationWarning (#551)
1 parent e73531b commit 3f35ac6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dpdata/amber/md.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33

44
import numpy as np
5-
from scipy.io import netcdf
5+
from scipy.io import netcdf_file
66

77
from dpdata.amber.mask import pick_by_amber_mask
88
from dpdata.unit import EnergyConversion
@@ -77,7 +77,7 @@ def read_amber_traj(
7777
for ii in use_element_symbols:
7878
amber_types[ii] = symbols[atomic_number[ii]]
7979

80-
with netcdf.netcdf_file(nc_file, "r") as f:
80+
with netcdf_file(nc_file, "r") as f:
8181
coords = np.array(f.variables["coordinates"][:])
8282
cell_lengths = np.array(f.variables["cell_lengths"][:])
8383
cell_angles = np.array(f.variables["cell_angles"][:])
@@ -92,7 +92,7 @@ def read_amber_traj(
9292
raise RuntimeError("Unsupported cells")
9393

9494
if labeled:
95-
with netcdf.netcdf_file(mdfrc_file, "r") as f:
95+
with netcdf_file(mdfrc_file, "r") as f:
9696
forces = np.array(f.variables["forces"][:])
9797

9898
# load energy from mden_file or mdout_file

0 commit comments

Comments
 (0)