Hello MDAnalysis community,
I get the following warnings when I use the following code snippet to read and analyze a couple of Lammps data and dump files. Please use attached a pair of data and dump files.
Thank you in advance for your help.
Amir
def remove_scaling(dimensions):
if len(dimensions) == 3:
dimensions = np.float32(dimensions)
else:
raise ValueError("{} vectors is not 3d.".format(dimensions))
def return_real(ts):
ts.positions /= dimensions
return ts
return return_real
cell = mda.Universe(data, dump, format='LAMMPSDUMP', atom_style="id resid type x y z", dt=0.02)
# define the transformation
workflow = [remove_scaling([cellAttrs.xlen,cellAttrs.ylen,cellAttrs.zlen]), mdatransform.unwrap(cell.atoms)]
cell.trajectory.add_transformations(*workflow)
#PipeLine.universe_info(cell)
chrm = cell.select_atoms('resid 1') # resid 1 is the atoms creating the chain
gyr_t = np.empty([0]) # radius of gyration
for ts in cell.trajectory:
gyr = chrm.radius_of_gyration()
gyr_t = np.append(gyr_t,np.array([gyr]),axis=0) # radius of gyration in each time step
Warnings:
/scratch/amirhsi/dask/daskEnv/lib/python3.8/site-packages/MDAnalysis/core/topologyattrs.py:2011: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
np.array(sorted(unique_bonds)), 4)
/scratch/amirhsi/dask/daskEnv/lib/python3.8/site-packages/MDAnalysis/core/topologyobjects.py:600: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations guessed = np.asarray(guessed, dtype=np.bool)
/scratch/amirhsi/dask/daskEnv/lib/python3.8/site-packages/MDAnalysis/core/selection.py:640: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations mask = np.zeros(len(vals), dtype=np.bool)