fixed strange behavior for inSST without given symmetry

np.all() on dict (with keys 'proper' and 'improper') always returns
'False', and not, as (most likely) intended 'True' in the case of no symmetry.
Removed this comparison and simply setting inSST=False for no symmetry,
color will be (0,0,0) in that case
This commit is contained in:
Martin Diehl 2016-11-16 12:28:38 +01:00
parent 1346efbef0
commit b128b15abf
1 changed files with 14 additions and 17 deletions

View File

@ -774,26 +774,23 @@ class Symmetry:
[-1., 0., 0.],
[ 0., 1., 0.] ]),
}
else:
basis = {'improper': np.zeros((3,3),dtype=float),
'proper': np.zeros((3,3),dtype=float),
}
else: # direct exit for unspecified symmetry
if color:
return (True,np.zeros(3,'d'))
else:
return True
if np.all(basis == 0.0):
theComponents = -np.ones(3,'d')
v = np.array(vector,dtype = float)
if proper: # check both improper ...
theComponents = np.dot(basis['improper'],v)
inSST = np.all(theComponents >= 0.0)
else:
v = np.array(vector,dtype = float)
if proper: # check both improper ...
theComponents = np.dot(basis['improper'],v)
inSST = np.all(theComponents >= 0.0)
if not inSST: # ... and proper SST
theComponents = np.dot(basis['proper'],v)
inSST = np.all(theComponents >= 0.0)
else:
v[2] = abs(v[2]) # z component projects identical
theComponents = np.dot(basis['improper'],v) # for positive and negative values
if not inSST: # ... and proper SST
theComponents = np.dot(basis['proper'],v)
inSST = np.all(theComponents >= 0.0)
else:
v[2] = abs(v[2]) # z component projects identical
theComponents = np.dot(basis['improper'],v) # for positive and negative values
inSST = np.all(theComponents >= 0.0)
if color: # have to return color array
if inSST: