本文整理匯總了Python中mantid.geometry.SpaceGroupFactory.isSubscribedNumber方法的典型用法代碼示例。如果您正苦於以下問題:Python SpaceGroupFactory.isSubscribedNumber方法的具體用法?Python SpaceGroupFactory.isSubscribedNumber怎麽用?Python SpaceGroupFactory.isSubscribedNumber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mantid.geometry.SpaceGroupFactory
的用法示例。
在下文中一共展示了SpaceGroupFactory.isSubscribedNumber方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: validateInputs
# 需要導入模塊: from mantid.geometry import SpaceGroupFactory [as 別名]
# 或者: from mantid.geometry.SpaceGroupFactory import isSubscribedNumber [as 別名]
def validateInputs(self):
issues = dict()
inWS = self.getProperty("InputWorkspace").value
dimX=inWS.getXDimension()
dimY=inWS.getYDimension()
dimZ=inWS.getZDimension()
if dimX.name != '[H,0,0]' or dimY.name != '[0,K,0]' or dimZ.name != '[0,0,L]':
issues['InputWorkspace'] = 'dimensions must be [H,0,0], [0,K,0] and [0,0,L]'
for d in range(inWS.getNumDims()):
dim = inWS.getDimension(d)
if not np.isclose(dim.getMaximum(), -dim.getMinimum(), atol=1e-5):
issues['InputWorkspace'] = 'dimensions must be centered on zero'
if self.getProperty("Convolution").value and self.getProperty("Method").value == 'Punch and fill':
try:
import astropy # noqa
except ImportError:
issues["Convolution"] = 'python-astropy required to do convolution'
size = self.getProperty("Size").value
if len(size) != 1 and len(size) != 3:
issues["Size"] = 'Must provide 1 or 3 sizes'
if self.getProperty("SpaceGroup").value:
space_group=self.getProperty("SpaceGroup").value
try:
if not SpaceGroupFactory.isSubscribedNumber(int(space_group)):
issues["SpaceGroup"] = 'Space group number is not valid'
except ValueError:
if not SpaceGroupFactory.isSubscribedSymbol(space_group):
issues["SpaceGroup"] = 'Space group name is not valid'
sphereMin = self.getProperty("SphereMin").value
if len(sphereMin) != 1 and len(sphereMin) != 3:
issues["SphereMin"] = 'Must provide 1 or 3 diameters'
sphereMax = self.getProperty("SphereMax").value
if len(sphereMax) != 1 and len(sphereMax) != 3:
issues["SphereMax"] = 'Must provide 1 or 3 diameters'
if self.getProperty("WindowFunction").value == 'Tukey':
try:
ssignal.tukey
except AttributeError:
issues["WindowFunction"] = 'Tukey window requires scipy >= 0.16.0'
return issues
示例2: validateInputs
# 需要導入模塊: from mantid.geometry import SpaceGroupFactory [as 別名]
# 或者: from mantid.geometry.SpaceGroupFactory import isSubscribedNumber [as 別名]
def validateInputs(self):
issues = dict()
if self.getProperty("SymmetryOps").value:
syms=self.getProperty("SymmetryOps").value
try:
if not SpaceGroupFactory.isSubscribedNumber(int(syms)):
issues["SymmetryOps"] = 'Space group number '+syms+' is not valid'
except ValueError:
if not SpaceGroupFactory.isSubscribedSymbol(syms):
for sym in syms.split(';'):
if not SymmetryOperationFactory.exists(sym):
issues["SymmetryOps"] = sym+' is not valid symmetry or space group name'
return issues