Fix new dtype values for Numpy.

Numpy does not allow anylonger types np.int or np.float.
These are replaced simply by int and float python native types.
This commit is contained in:
Sylvain Tricot 2023-03-29 11:41:52 +02:00
parent 0699f193b3
commit cf74431c31
3 changed files with 7 additions and 7 deletions

View File

@ -727,15 +727,15 @@ class SpecIO(object):
content += line
nat = p.extra_nat
nra_arr = np.ones((nat), dtype=np.int)
nra_arr = np.ones((nat), dtype=int)
thfwd_arr = np.ones((nat))
path_filtering = p.extra_parameters['calculation'].get_parameter(
'path_filtering').value
if (path_filtering is not None and
'backward_scattering' in path_filtering):
ibwd_arr = np.ones((nat), dtype=np.int)
ibwd_arr = np.ones((nat), dtype=int)
else:
ibwd_arr = np.zeros((nat), dtype=np.int)
ibwd_arr = np.zeros((nat), dtype=int)
thbwd_arr = np.ones((nat))
for at in p.extra_atoms:
i = at.get('proto_index') - 1

View File

@ -301,7 +301,7 @@ class _MSCALCULATOR(Calculator):
wf = 4.5
source_energy = self.source_parameters.get_parameter('energy').value
ke = source_energy - binding_energy - wf
#return np.array(ke, dtype=np.float).flatten()
#return np.array(ke, dtype=float).flatten()
return ke

View File

@ -1310,8 +1310,8 @@ class ScanParameters(BaseParameters):
# LOGGER.error('Incompatible options!')
# raise ValueError(msg)
# p._value = np.array(p.value, dtype=np.float).flatten()
arr = np.array(p.value, dtype=np.float).flatten()
# p._value = np.array(p.value, dtype=float).flatten()
arr = np.array(p.value, dtype=float).flatten()
theta0 = arr[0]
theta1 = arr[-1]
@ -1345,7 +1345,7 @@ class ScanParameters(BaseParameters):
# LOGGER.error('Incompatible options')
# raise ValueError(msg)
arr = np.array(p.value, dtype=np.float).flatten()
arr = np.array(p.value, dtype=float).flatten()
phi0 = arr[0]
phi1 = arr[-1]