Commit e94b3f41 authored by Ultima's avatar Ultima
Browse files

Migration of point_space to d2o completed.

Reworked init of d2o.
Implemented a distributor cache.
parent a43a3b04
...@@ -29,7 +29,8 @@ from nifty_cmaps import ncmap ...@@ -29,7 +29,8 @@ from nifty_cmaps import ncmap
from nifty_core import space,\ from nifty_core import space,\
point_space,\ point_space,\
nested_space,\ nested_space,\
field field
from nifty_mpi_data import distributed_data_object from nifty_mpi_data import distributed_data_object
from nifty_power import * from nifty_power import *
from nifty_random import random from nifty_random import random
......
...@@ -36,7 +36,7 @@ from nifty import * # version 0.8.0 ...@@ -36,7 +36,7 @@ from nifty import * # version 0.8.0
about.warnings.off() about.warnings.off()
# some signal space; e.g., a two-dimensional regular grid # some signal space; e.g., a two-dimensional regular grid
x_space = rg_space([128, 128]) # define signal space x_space = rg_space([1280, 1280], datamodel = 'd2o') # define signal space
#x_space = rg_space(512) #x_space = rg_space(512)
#x_space = hp_space(32) #x_space = hp_space(32)
#x_space = gl_space(96) #x_space = gl_space(96)
...@@ -56,6 +56,7 @@ d_space = R.target # get data spac ...@@ -56,6 +56,7 @@ d_space = R.target # get data spac
N = diagonal_operator(d_space, diag=s.var(), bare=True) # define noise covariance N = diagonal_operator(d_space, diag=s.var(), bare=True) # define noise covariance
n = N.get_random_field(domain=d_space) # generate noise n = N.get_random_field(domain=d_space) # generate noise
d = R(s) + n # compute data d = R(s) + n # compute data
j = R.adjoint_times(N.inverse_times(d)) # define information source j = R.adjoint_times(N.inverse_times(d)) # define information source
......
...@@ -128,7 +128,7 @@ class lm_space(point_space): ...@@ -128,7 +128,7 @@ class lm_space(point_space):
vol : numpy.ndarray vol : numpy.ndarray
Pixel volume of the :py:class:`lm_space`, which is always 1. Pixel volume of the :py:class:`lm_space`, which is always 1.
""" """
def __init__(self,lmax,mmax=None,datatype=None): def __init__(self, lmax, mmax=None, datatype=None):
""" """
Sets the attributes for an lm_space class instance. Sets the attributes for an lm_space class instance.
...@@ -186,7 +186,10 @@ class lm_space(point_space): ...@@ -186,7 +186,10 @@ class lm_space(point_space):
self.paradict['lmax'] = x[0] self.paradict['lmax'] = x[0]
self.paradict['mmax'] = x[1] self.paradict['mmax'] = x[1]
def copy(self):
return lm_space(lmax = self.paradict['lmax'],
mmax = self.paradict['mmax'],
datatype = self.datatype)
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...@@ -213,12 +216,12 @@ class lm_space(point_space): ...@@ -213,12 +216,12 @@ class lm_space(point_space):
""" """
return self.paradict['mmax'] return self.paradict['mmax']
def shape(self): def get_shape(self):
mmax = self.paradict['mmax'] mmax = self.paradict['mmax']
lmax = self.paradict['lmax'] lmax = self.paradict['lmax']
return np.array([(mmax+1)*(lmax+1)-((lmax+1)*lmax)//2], dtype=int) return np.array([(mmax+1)*(lmax+1)-((lmax+1)*lmax)//2], dtype=int)
def dim(self,split=False): def get_dim(self, split=False):
""" """
Computes the dimension of the space, i.e.\ the number of spherical Computes the dimension of the space, i.e.\ the number of spherical
harmonics components that are stored. harmonics components that are stored.
...@@ -242,15 +245,15 @@ class lm_space(point_space): ...@@ -242,15 +245,15 @@ class lm_space(point_space):
""" """
## dim = (mmax+1)*(lmax-mmax/2+1) ## dim = (mmax+1)*(lmax-mmax/2+1)
if(split): if(split):
return self.shape() return self.get_shape()
#return np.array([(self.para[0]+1)*(self.para[1]+1)-(self.para[1]+1)*self.para[1]//2],dtype=np.int) #return np.array([(self.para[0]+1)*(self.para[1]+1)-(self.para[1]+1)*self.para[1]//2],dtype=np.int)
else: else:
return np.prod(self.shape()) return np.prod(self.get_shape())
#return (self.para[0]+1)*(self.para[1]+1)-(self.para[1]+1)*self.para[1]//2 #return (self.para[0]+1)*(self.para[1]+1)-(self.para[1]+1)*self.para[1]//2
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def dof(self): def get_dof(self):
""" """
Computes the number of degrees of freedom of the space, taking into Computes the number of degrees of freedom of the space, taking into
account symmetry constraints and complex-valuedness. account symmetry constraints and complex-valuedness.
...@@ -325,7 +328,7 @@ class lm_space(point_space): ...@@ -325,7 +328,7 @@ class lm_space(point_space):
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def _getlm(self): ## > compute all (l,m) def _getlm(self): ## > compute all (l,m)
index = np.arange(self.dim(split=False)) index = np.arange(self.get_dim(split=False))
n = 2*self.para[0]+1 n = 2*self.para[0]+1
m = np.ceil((n-np.sqrt(n**2-8*(index-self.para[0])))/2).astype(np.int) m = np.ceil((n-np.sqrt(n**2-8*(index-self.para[0])))/2).astype(np.int)
l = index-self.para[0]*m+m*(m-1)//2 l = index-self.para[0]*m+m*(m-1)//2
...@@ -397,7 +400,7 @@ class lm_space(point_space): ...@@ -397,7 +400,7 @@ class lm_space(point_space):
else: else:
if(np.size(x)==1): if(np.size(x)==1):
if(extend): if(extend):
x = self.datatype(x)*np.ones(self.dim(split=True),dtype=self.datatype,order='C') x = self.datatype(x)*np.ones(self.get_dim(split=True),dtype=self.datatype,order='C')
else: else:
if(np.isscalar(x)): if(np.isscalar(x)):
x = np.array([x],dtype=self.datatype) x = np.array([x],dtype=self.datatype)
...@@ -459,13 +462,13 @@ class lm_space(point_space): ...@@ -459,13 +462,13 @@ class lm_space(point_space):
arg = random.parse_arguments(self,**kwargs) arg = random.parse_arguments(self,**kwargs)
if(arg is None): if(arg is None):
return np.zeros(self.dim(split=True),dtype=self.datatype,order='C') return np.zeros(self.get_dim(split=True),dtype=self.datatype,order='C')
elif(arg[0]=="pm1"): elif(arg[0]=="pm1"):
x = random.pm1(datatype=self.datatype,shape=self.dim(split=True)) x = random.pm1(datatype=self.datatype,shape=self.get_dim(split=True))
elif(arg[0]=="gau"): elif(arg[0]=="gau"):
x = random.gau(datatype=self.datatype,shape=self.dim(split=True),mean=None,dev=arg[2],var=arg[3]) x = random.gau(datatype=self.datatype,shape=self.get_dim(split=True),mean=None,dev=arg[2],var=arg[3])
elif(arg[0]=="syn"): elif(arg[0]=="syn"):
lmax = self.para[0] ## lmax lmax = self.para[0] ## lmax
...@@ -483,7 +486,7 @@ class lm_space(point_space): ...@@ -483,7 +486,7 @@ class lm_space(point_space):
return x return x
elif(arg[0]=="uni"): elif(arg[0]=="uni"):
x = random.uni(datatype=self.datatype,shape=self.dim(split=True),vmin=arg[1],vmax=arg[2]) x = random.uni(datatype=self.datatype,shape=self.get_dim(split=True),vmin=arg[1],vmax=arg[2])
else: else:
raise KeyError(about._errors.cstring("ERROR: unsupported random key '"+str(arg[0])+"'.")) raise KeyError(about._errors.cstring("ERROR: unsupported random key '"+str(arg[0])+"'."))
...@@ -612,9 +615,9 @@ class lm_space(point_space): ...@@ -612,9 +615,9 @@ class lm_space(point_space):
each determine another component with negative :math:`m`. each determine another component with negative :math:`m`.
""" """
if(total): if(total):
return self.dof() return self.get_dof()
else: else:
mol = np.ones(self.dim(split=True),dtype=self.vol.dtype,order='C') mol = np.ones(self.get_dim(split=True),dtype=self.vol.dtype,order='C')
mol[self.para[0]+1:] = 2 ## redundant in (l,m) and (l,-m) mol[self.para[0]+1:] = 2 ## redundant in (l,m) and (l,-m)
return mol return mol
...@@ -1060,6 +1063,10 @@ class gl_space(point_space): ...@@ -1060,6 +1063,10 @@ class gl_space(point_space):
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def copy(self):
return gl_space(nlat = self.paradict['nlat'],
nlon = self.paradict['nlon'],
datatype = self.datatype)
def nlat(self): def nlat(self):
""" """
Returns the number of latitudinal bins. Returns the number of latitudinal bins.
...@@ -1082,10 +1089,10 @@ class gl_space(point_space): ...@@ -1082,10 +1089,10 @@ class gl_space(point_space):
""" """
return self.paradict['nlon'] return self.paradict['nlon']
def shape(self): def get_shape(self):
return np.array([(self.paradict['nlat']*self.paradict['nlon'])], dtype=np.int) return np.array([(self.paradict['nlat']*self.paradict['nlon'])], dtype=np.int)
def dim(self,split=False): def get_dim(self,split=False):
""" """
Computes the dimension of the space, i.e.\ the number of pixels. Computes the dimension of the space, i.e.\ the number of pixels.
...@@ -1102,15 +1109,15 @@ class gl_space(point_space): ...@@ -1102,15 +1109,15 @@ class gl_space(point_space):
""" """
## dim = nlat*nlon ## dim = nlat*nlon
if(split): if(split):
return self.shape() return self.get_shape()
#return np.array([self.para[0]*self.para[1]],dtype=np.int) #return np.array([self.para[0]*self.para[1]],dtype=np.int)
else: else:
return np.prod(self.shape()) return np.prod(self.get_shape())
#return self.para[0]*self.para[1] #return self.para[0]*self.para[1]
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def dof(self): def get_dof(self):
""" """
Computes the number of degrees of freedom of the space. Computes the number of degrees of freedom of the space.
...@@ -1236,13 +1243,13 @@ class gl_space(point_space): ...@@ -1236,13 +1243,13 @@ class gl_space(point_space):
arg = random.parse_arguments(self,**kwargs) arg = random.parse_arguments(self,**kwargs)
if(arg is None): if(arg is None):
x = np.zeros(self.dim(split=True),dtype=self.datatype,order='C') x = np.zeros(self.get_dim(split=True),dtype=self.datatype,order='C')
elif(arg[0]=="pm1"): elif(arg[0]=="pm1"):
x = random.pm1(datatype=self.datatype,shape=self.dim(split=True)) x = random.pm1(datatype=self.datatype,shape=self.get_dim(split=True))
elif(arg[0]=="gau"): elif(arg[0]=="gau"):
x = random.gau(datatype=self.datatype,shape=self.dim(split=True),mean=None,dev=arg[2],var=arg[3]) x = random.gau(datatype=self.datatype,shape=self.get_dim(split=True),mean=None,dev=arg[2],var=arg[3])
elif(arg[0]=="syn"): elif(arg[0]=="syn"):
lmax = self.para[0]-1 ## nlat-1 lmax = self.para[0]-1 ## nlat-1
...@@ -1255,7 +1262,7 @@ class gl_space(point_space): ...@@ -1255,7 +1262,7 @@ class gl_space(point_space):
x = self.calc_weight(x,power=0.5) x = self.calc_weight(x,power=0.5)
elif(arg[0]=="uni"): elif(arg[0]=="uni"):
x = random.uni(datatype=self.datatype,shape=self.dim(split=True),vmin=arg[1],vmax=arg[2]) x = random.uni(datatype=self.datatype,shape=self.get_dim(split=True),vmin=arg[1],vmax=arg[2])
else: else:
raise KeyError(about._errors.cstring("ERROR: unsupported random key '"+str(arg[0])+"'.")) raise KeyError(about._errors.cstring("ERROR: unsupported random key '"+str(arg[0])+"'."))
...@@ -1345,7 +1352,7 @@ class gl_space(point_space): ...@@ -1345,7 +1352,7 @@ class gl_space(point_space):
if(total): if(total):
return self.datatype(4*pi) return self.datatype(4*pi)
else: else:
mol = np.ones(self.dim(split=True),dtype=self.datatype,order='C') mol = np.ones(self.get_dim(split=True),dtype=self.datatype,order='C')
return self.calc_weight(mol,power=1) return self.calc_weight(mol,power=1)
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...@@ -1689,7 +1696,7 @@ class hp_space(point_space): ...@@ -1689,7 +1696,7 @@ class hp_space(point_space):
""" """
niter = 0 ## default number of iterations used for transformations niter = 0 ## default number of iterations used for transformations
def __init__(self,nside): def __init__(self, nside):
""" """
Sets the attributes for a hp_space class instance. Sets the attributes for a hp_space class instance.
...@@ -1734,6 +1741,9 @@ class hp_space(point_space): ...@@ -1734,6 +1741,9 @@ class hp_space(point_space):
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def copy(self):
return hp_space(nside = self.paradict['nside'])
def nside(self): def nside(self):
""" """
Returns the resolution parameter. Returns the resolution parameter.
...@@ -1745,10 +1755,10 @@ class hp_space(point_space): ...@@ -1745,10 +1755,10 @@ class hp_space(point_space):
""" """
return self.paradict['nside'] return self.paradict['nside']
def shape(self): def get_shape(self):
return np.array([12*self.paradict['nside']**2], dtype=np.int) return np.array([12*self.paradict['nside']**2], dtype=np.int)
def dim(self,split=False): def get_dim(self,split=False):
""" """
Computes the dimension of the space, i.e.\ the number of pixels. Computes the dimension of the space, i.e.\ the number of pixels.
...@@ -1765,15 +1775,15 @@ class hp_space(point_space): ...@@ -1765,15 +1775,15 @@ class hp_space(point_space):
""" """
## dim = 12*nside**2 ## dim = 12*nside**2
if(split): if(split):
return self.shape() return self.get_shape()
#return np.array([12*self.para[0]**2],dtype=np.int) #return np.array([12*self.para[0]**2],dtype=np.int)
else: else:
return np.prod(self.shape()) return np.prod(self.get_shape())
#return 12*self.para[0]**2 #return 12*self.para[0]**2
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def dof(self): def get_dof(self):
""" """
Computes the number of degrees of freedom of the space. Computes the number of degrees of freedom of the space.
...@@ -1899,13 +1909,13 @@ class hp_space(point_space): ...@@ -1899,13 +1909,13 @@ class hp_space(point_space):
arg = random.parse_arguments(self,**kwargs) arg = random.parse_arguments(self,**kwargs)
if(arg is None): if(arg is None):
x = np.zeros(self.dim(split=True),dtype=self.datatype,order='C') x = np.zeros(self.get_dim(split=True),dtype=self.datatype,order='C')
elif(arg[0]=="pm1"): elif(arg[0]=="pm1"):
x = random.pm1(datatype=self.datatype,shape=self.dim(split=True)) x = random.pm1(datatype=self.datatype,shape=self.get_dim(split=True))
elif(arg[0]=="gau"): elif(arg[0]=="gau"):
x = random.gau(datatype=self.datatype,shape=self.dim(split=True),mean=None,dev=arg[2],var=arg[3]) x = random.gau(datatype=self.datatype,shape=self.get_dim(split=True),mean=None,dev=arg[2],var=arg[3])
elif(arg[0]=="syn"): elif(arg[0]=="syn"):
lmax = 3*self.para[0]-1 ## 3*nside-1 lmax = 3*self.para[0]-1 ## 3*nside-1
...@@ -1915,7 +1925,7 @@ class hp_space(point_space): ...@@ -1915,7 +1925,7 @@ class hp_space(point_space):
x = self.calc_weight(x,power=0.5) x = self.calc_weight(x,power=0.5)
elif(arg[0]=="uni"): elif(arg[0]=="uni"):
x = random.uni(datatype=self.datatype,shape=self.dim(split=True),vmin=arg[1],vmax=arg[2]) x = random.uni(datatype=self.datatype,shape=self.get_dim(split=True),vmin=arg[1],vmax=arg[2])
else: else:
raise KeyError(about._errors.cstring("ERROR: unsupported random key '"+str(arg[0])+"'.")) raise KeyError(about._errors.cstring("ERROR: unsupported random key '"+str(arg[0])+"'."))
...@@ -2001,7 +2011,7 @@ class hp_space(point_space): ...@@ -2001,7 +2011,7 @@ class hp_space(point_space):
if(total): if(total):
return self.datatype(4*pi) return self.datatype(4*pi)
else: else:
mol = np.ones(self.dim(split=True),dtype=self.datatype,order='C') mol = np.ones(self.get_dim(split=True),dtype=self.datatype,order='C')
return self.calc_weight(mol,power=1) return self.calc_weight(mol,power=1)
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......
...@@ -149,6 +149,8 @@ from nifty_paradict import space_paradict,\ ...@@ -149,6 +149,8 @@ from nifty_paradict import space_paradict,\
from nifty_about import about from nifty_about import about
from nifty_random import random from nifty_random import random
from nifty.nifty_mpi_data import distributed_data_object
pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
...@@ -214,7 +216,7 @@ class space(object): ...@@ -214,7 +216,7 @@ class space(object):
An array of pixel volumes, only one component if the pixels all An array of pixel volumes, only one component if the pixels all
have the same volume. have the same volume.
""" """
def __init__(self,para=0,datatype=None): def __init__(self, para=0, datatype=None):
""" """
Sets the attributes for a space class instance. Sets the attributes for a space class instance.
...@@ -260,7 +262,9 @@ class space(object): ...@@ -260,7 +262,9 @@ class space(object):
""" """
return frozenset(dictionary.items()) return frozenset(dictionary.items())
def copy(self):
return space(para = self.para,
datatype = self.datatype)
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def getitem(self, data, key): def getitem(self, data, key):
...@@ -289,16 +293,16 @@ class space(object): ...@@ -289,16 +293,16 @@ class space(object):
"ERROR: no generic instance method 'binary_operation'.")) "ERROR: no generic instance method 'binary_operation'."))
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def norm(self, x, q): def get_norm(self, x, q):
raise NotImplementedError(about._errors.cstring(\ raise NotImplementedError(about._errors.cstring(\
"ERROR: no generic instance method 'norm'.")) "ERROR: no generic instance method 'norm'."))
def shape(self): def get_shape(self):
raise NotImplementedError(about._errors.cstring(\ raise NotImplementedError(about._errors.cstring(\
"ERROR: no generic instance method 'shape'.")) "ERROR: no generic instance method 'shape'."))
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def dim(self,split=False): def get_dim(self,split=False):
""" """
Computes the dimension of the space, i.e.\ the number of pixels. Computes the dimension of the space, i.e.\ the number of pixels.
...@@ -313,11 +317,12 @@ class space(object): ...@@ -313,11 +317,12 @@ class space(object):
dim : {int, numpy.ndarray} dim : {int, numpy.ndarray}
Dimension(s) of the space. Dimension(s) of the space.
""" """
raise NotImplementedError(about._errors.cstring("ERROR: no generic instance method 'dim'.")) raise NotImplementedError(about._errors.cstring(
"ERROR: no generic instance method 'dim'."))
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def dof(self): def get_dof(self):
""" """
Computes the number of degrees of freedom of the space. Computes the number of degrees of freedom of the space.
...@@ -326,7 +331,8 @@ class space(object): ...@@ -326,7 +331,8 @@ class space(object):
dof : int dof : int
Number of degrees of freedom of the space. Number of degrees of freedom of the space.
""" """
raise NotImplementedError(about._errors.cstring("ERROR: no generic instance method 'dof'.")) raise NotImplementedError(about._errors.cstring(
"ERROR: no generic instance method 'dof'."))
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...@@ -371,7 +377,8 @@ class space(object): ...@@ -371,7 +377,8 @@ class space(object):
(default: 0). (default: 0).
""" """
raise NotImplementedError(about._errors.cstring("ERROR: no generic instance method 'enforce_power'.")) raise NotImplementedError(about._errors.cstring(
"ERROR: no generic instance method 'enforce_power'."))
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...@@ -404,7 +411,8 @@ class space(object): ...@@ -404,7 +411,8 @@ class space(object):
get_power_indices get_power_indices
""" """
raise NotImplementedError(about._errors.cstring("ERROR: no generic instance method 'set_power_indices'.")) raise NotImplementedError(about._errors.cstring(
"ERROR: no generic instance method 'set_power_indices'."))
def get_power_indices(self,**kwargs): def get_power_indices(self,**kwargs):
""" """
...@@ -456,7 +464,8 @@ class space(object): ...@@ -456,7 +464,8 @@ class space(object):
set_power_indices set_power_indices
""" """
raise NotImplementedError(about._errors.cstring("ERROR: no generic instance method 'get_power_indices'.")) raise NotImplementedError(about._errors.cstring(
"ERROR: no generic instance method 'get_power_indices'."))
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...@@ -1059,7 +1068,7 @@ class point_space(space): ...@@ -1059,7 +1068,7 @@ class point_space(space):
vol : numpy.ndarray vol : numpy.ndarray
Pixel volume of the :py:class:`point_space`, which is always 1. Pixel volume of the :py:class:`point_space`, which is always 1.
""" """
def __init__(self,num,datatype=None): def __init__(self, num, datatype=None, datamodel='d2o'):
""" """
Sets the attributes for a point_space class instance. Sets the attributes for a point_space class instance.
...@@ -1077,15 +1086,30 @@ class point_space(space): ...@@ -1077,15 +1086,30 @@ class point_space(space):
self.paradict = point_space_paradict(num=num) self.paradict = point_space_paradict(num=num)
## check datatype ## check datatype
if(datatype is None): if (datatype is None):
datatype = np.float64 datatype = np.float64
elif(datatype not in [np.int8,np.int16,np.int32,np.int64,np.float16,np.float32,np.float64,np.complex64,np.complex128]): elif (datatype not in [np.int8,
np.int16,
np.int32,
np.int64,
np.float16,