unified help

This commit is contained in:
Martin Diehl 2021-07-18 15:42:36 +02:00
parent e54f032f1e
commit 2217c3d143
2 changed files with 12 additions and 9 deletions

View File

@ -35,14 +35,15 @@ class Crystal():
alpha = None,beta = None,gamma = None, alpha = None,beta = None,gamma = None,
degrees = False): degrees = False):
""" """
Lattice. Representation of crystal in terms of crystal family or Bravais lattice.
Parameters Parameters
---------- ----------
lattice : {'aP', 'mP', 'mS', 'oP', 'oS', 'oI', 'oF', 'tP', 'tI', 'hP', 'cP', 'cI', 'cF'}. family : {'triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic'}, optional.
Name of the Bravais lattice in Pearson notation.
family : {'triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic'}
Name of the crystal family. Name of the crystal family.
Will be infered if 'lattice' is given.
lattice : {'aP', 'mP', 'mS', 'oP', 'oS', 'oI', 'oF', 'tP', 'tI', 'hP', 'cP', 'cI', 'cF'}, optional.
Name of the Bravais lattice in Pearson notation.
a : float, optional a : float, optional
Length of lattice parameter 'a'. Length of lattice parameter 'a'.
b : float, optional b : float, optional
@ -61,6 +62,8 @@ class Crystal():
""" """
if family not in [None] + list(self._immutable.keys()): if family not in [None] + list(self._immutable.keys()):
raise KeyError(f'invalid crystal family "{family}"') raise KeyError(f'invalid crystal family "{family}"')
if lattice is not None and family is not None and family != lattice_symmetries[lattice]:
raise KeyError(f'incompatible family "{family}" for lattice "{lattice}"')
self.family = lattice_symmetries[lattice] if family is None else family self.family = lattice_symmetries[lattice] if family is None else family
self.lattice = lattice self.lattice = lattice

View File

@ -32,11 +32,11 @@ lattice_symmetries = {
_parameter_doc = \ _parameter_doc = \
""" """
family : {'triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic'} family : {'triclinic', 'monoclinic', 'orthorhombic', 'tetragonal', 'hexagonal', 'cubic'}, optional.
Crystal family. Mutually exclusive with 'lattice' parameter. Name of the crystal family.
lattice : {'aP', 'mP', 'mS', 'oP', 'oS', 'oI', 'oF', 'tP', 'tI', 'hP', 'cP', 'cI', 'cF'}. Will be infered if 'lattice' is given.
Bravais lattice in Pearson notation. lattice : {'aP', 'mP', 'mS', 'oP', 'oS', 'oI', 'oF', 'tP', 'tI', 'hP', 'cP', 'cI', 'cF'}, optional.
Mutually exclusive with 'family' parameter. Name of the Bravais lattice in Pearson notation.
a : float, optional a : float, optional
Length of lattice parameter 'a'. Length of lattice parameter 'a'.
b : float, optional b : float, optional