Skip to content

Commit

Permalink
MNT Constraint is singular
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Feb 26, 2020
1 parent 23373f5 commit bfba4cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions apstools/diffractometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.. autosummary::
~Constraints
~Constraint
~DiffractometerMixin
"""
Expand All @@ -20,7 +20,7 @@
#-----------------------------------------------------------------------------

__all__ = [
'Constraints',
'Constraint',
'DiffractometerMixin',
]

Expand All @@ -31,8 +31,8 @@

logger = logging.getLogger(__file__)

Constraints = collections.namedtuple(
"Constraints",
Constraint = collections.namedtuple(
"Constraint",
("low_limit", "high_limit", "value", "fit"))


Expand Down
14 changes: 7 additions & 7 deletions docs/source/source/_diffractometer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Example : Constraints
Create a custom diffractometer class, adding the
mixin class as first argument::

from apstools.diffractometer import Constraints, DiffractometerMixin
from apstools.diffractometer import Constraint, DiffractometerMixin

class CustomE4CV(DiffractometerMixin, E4CV):
h = Component(PseudoSingle, '', labels=("hkl", "fourc"))
Expand Down Expand Up @@ -42,11 +42,11 @@ A set of constraints is defined as a dictionary with the
motor names as keys::

diffractometer_constraints = {
# axis: Constraints(lo_limit, hi_limit, value, fit)
"omega": Constraints(-120, 150, 0, True),
"chi": Constraints(-150, 120, 0, True),
# "phi": Constraints(0, 0, 0, False),
"tth": Constraints(-10, 142, 0, True),
# axis: Constraint(lo_limit, hi_limit, value, fit)
"omega": Constraint(-120, 150, 0, True),
"chi": Constraint(-150, 120, 0, True),
# "phi": Constraint(0, 0, 0, False),
"tth": Constraint(-10, 142, 0, True),
}

These constraints can be applied with command
Expand Down Expand Up @@ -108,7 +108,7 @@ For the (0 0 3/2) reflection, there is only one solution.
If we further restrict *omega* to non-negative values, we'll
only get one solution for all three reflections in the list::

e4cv.applyConstraints({"omega": Constraints(-0, 150, 0, True)})
e4cv.applyConstraints({"omega": Constraint(-0, 150, 0, True)})
print(e4cv.forwardSolutionsTable(
(
(0, 0, 0.5),
Expand Down

0 comments on commit bfba4cc

Please sign in to comment.