Author: bugman
Date: Fri Oct 16 16:02:57 2015
New Revision: 28064
URL: http://svn.gna.org/viewcvs/relax?rev=28064&view=rev
Log:
More future protection against numpy changes.
The FutureWarning is "`rank` is deprecated; use the `ndim` attribute or
function instead. To find
the rank of a matrix see `numpy.linalg.matrix_rank`." Therefore the N-state
model target function
method paramag_info() has been updated to use the .ndim attribute and longer
use numpy.rank()
function.
Modified:
trunk/target_functions/n_state_model.py
Modified: trunk/target_functions/n_state_model.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/target_functions/n_state_model.py?rev=28064&r1=28063&r2=28064&view=diff
==============================================================================
--- trunk/target_functions/n_state_model.py (original)
+++ trunk/target_functions/n_state_model.py Fri Oct 16 16:02:57 2015
@@ -21,7 +21,7 @@
# Python module imports.
from math import sqrt
-from numpy import array, dot, eye, float64, ones, rank, transpose, zeros
+from numpy import array, dot, eye, float64, ones, transpose, zeros
# relax module imports.
from lib.alignment.alignment_tensor import dAi_dAxx, dAi_dAyy, dAi_dAxy,
dAi_dAxz, dAi_dAyz, to_tensor
@@ -1200,7 +1200,7 @@
"""Calculate the paramagnetic centre to spin vectors, distances and
constants."""
# Get the vectors and distances.
- if rank(self.paramag_centre) == 1:
+ if self.paramag_centre.ndim == 1:
vectors_single_centre(self.atomic_pos, self.paramag_centre,
self.paramag_unit_vect, self.paramag_dist)
else:
vectors_centre_per_state(self.atomic_pos, self.paramag_centre,
self.paramag_unit_vect, self.paramag_dist)
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits