Skip to content

Commit

Permalink
DOC #567
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jan 9, 2022
1 parent cf2bdd9 commit c6eb447
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
Binary file modified .coverage
Binary file not shown.
35 changes: 35 additions & 0 deletions apstools/devices/tests/test_xia_slit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from ..xia_slit import XiaSlitController
# from ...utils import SlitGeometry

import pytest

IOC = "gp:"

# Full testing requires two XIA Slit controllers (a 2D H & V set)
# We don't have that for unit testing. Proceed with best efforts.


def test_XiaSlit(capsys):
slit1 = XiaSlitController("gp:hsc1:", name="slit1")
assert slit1 is not None

# slit1.wait_for_connection()
assert not slit1.connected
cns = """
inb out bot top
hsize vsize hcenter vcenter
hID horientation hbusy
vID vorientation vbusy
enable
error_code error_message message1 message2 message3
calibrate initialize locate stop_button
precision
""".split()
assert slit1.component_names == tuple(cns)

with pytest.raises(TypeError):
print(slit1.geometry)

captured = capsys.readouterr()
assert captured.out.split("\n") == [""]
assert captured.err.split("\n") == [""]
11 changes: 11 additions & 0 deletions apstools/synApps/db_2slit.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,14 @@ def geometry(self):
]

return SlitGeometry(*pppp)


# -----------------------------------------------------------------------------
# :author: Pete R. Jemian
# :email: jemian@anl.gov
# :copyright: (c) 2017-2022, UChicago Argonne, LLC
#
# Distributed under the terms of the Creative Commons Attribution 4.0 International Public License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
12 changes: 12 additions & 0 deletions docs/source/api/_devices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ Shutters
~apstools.devices.shutters.ShutterBase
~apstools.devices.shutters.SimulatedApsPssShutterWithStatus

.. _devices.slits:

Slits
++++++++

.. autosummary::

~apstools.synApps.db_2slit.Optics2Slit1D
~apstools.synApps.db_2slit.Optics2Slit2D_HV
~apstools.synApps.db_2slit.Optics2Slit2D_InbOutBotTop
~apstools.devices.xia_slit.XiaSlitController

synApps Support
++++++++++++++++++++

Expand Down

0 comments on commit c6eb447

Please sign in to comment.