Skip to content
Snippets Groups Projects
Commit 3b7267c6 authored by Michael Wedel's avatar Michael Wedel
Browse files

Refs #14121. Added python export.

parent 1d9dbb34
No related branches found
No related tags found
No related merge requests found
......@@ -54,10 +54,20 @@ void export_PointGroup() {
.value("Trigonal", PointGroup::CrystalSystem::Trigonal)
.value("Cubic", PointGroup::CrystalSystem::Cubic);
enum_<PointGroup::LatticeSystem>("LatticeSystem")
.value("Triclinic", PointGroup::LatticeSystem::Triclinic)
.value("Monoclinic", PointGroup::LatticeSystem::Monoclinic)
.value("Orthorhombic", PointGroup::LatticeSystem::Orthorhombic)
.value("Tetragonal", PointGroup::LatticeSystem::Tetragonal)
.value("Hexagonal", PointGroup::LatticeSystem::Hexagonal)
.value("Rhombohedral", PointGroup::LatticeSystem::Rhombohedral)
.value("Cubic", PointGroup::LatticeSystem::Cubic);
class_<PointGroup, boost::noncopyable, bases<Group>>("PointGroup", no_init)
.def("getName", &PointGroup::getName, arg("self"))
.def("getHMSymbol", &PointGroup::getSymbol, arg("self"))
.def("getCrystalSystem", &PointGroup::crystalSystem, arg("self"))
.def("getLatticeSystem", &PointGroup::latticeSystem, arg("self"))
.def("isEquivalent", &isEquivalent,
(arg("self"), arg("hkl1"), arg("hkl2")),
"Check whether the two HKLs are symmetrically equivalent.")
......
# pylint: disable=invalid-name,too-many-public-methods
import unittest
from mantid.geometry import PointGroup, PointGroupFactory
from mantid.kernel import V3D
class PointGroupTest(unittest.TestCase):
class PointGroupTest(unittest.TestCase):
def test_creation(self):
self.assertRaises(ValueError, PointGroupFactory.createPointGroup, "none")
......@@ -43,5 +44,13 @@ class PointGroupTest(unittest.TestCase):
pg = PointGroupFactory.createPointGroup("m-3m")
self.assertEquals(pg.getReflectionFamily(hkl1), pg.getReflectionFamily(hkl2))
def test_getLatticeSystem(self):
pg_rhombohedral = PointGroupFactory.createPointGroup("3m r")
pg_hexagonal = PointGroupFactory.createPointGroup("3m")
self.assertEquals(pg_rhombohedral.getLatticeSystem(), PointGroup.LatticeSystem.Rhombohedral)
self.assertEquals(pg_hexagonal.getLatticeSystem(), PointGroup.LatticeSystem.Hexagonal)
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment