当前位置: 首页>>代码示例>>Python>>正文


Python SpaceGroupFactory.isSubscribedNumber方法代码示例

本文整理汇总了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
开发者ID:mantidproject,项目名称:mantid,代码行数:52,代码来源:DeltaPDF3D.py

示例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
开发者ID:stuartcampbell,项目名称:mantid,代码行数:17,代码来源:SingleCrystalDiffuseReduction.py


注:本文中的mantid.geometry.SpaceGroupFactory.isSubscribedNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。