本文整理汇总了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