Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,18 @@ Generate class files with:
gas_dosing_introspected.class_from_instance()
reactor_cell_introspected.class_from_instance()

This creates ``genNodeClass.py`` in your current working directory. You can specify a custom path:
This writes one file per SEC node into ``secop_ophyd_devs/`` in your current working
directory, e.g. ``Gas_dosing.py`` and ``Reactor_cell.py``, named after the generated node
class. An ``__init__.py`` is also (re)generated there, making the directory an importable
package that re-exports every generated node class. Regenerating always fully overwrites
that node's file. You can specify a custom output directory:

.. code-block:: python

gas_dosing_introspected.class_from_instance('/path/to/output/directory')


The generated class file contains declarative device definitions that match the
Each generated class file contains declarative device definitions that match the
structure of the SECoP node. Signals are annotated with their types,
and commands are exposed as method stubs that get overwritten on ``.connect()``.

Expand All @@ -121,7 +125,7 @@ Import the generated classes and instantiate your devices from the generated cla

.. code-block:: python

from genNodeClass import Gas_dosing, Reactor_cell
from secop_ophyd_devs import Gas_dosing, Reactor_cell

# once the class files are generated, instantiate your devices using the generated classes
with init_devices():
Expand Down Expand Up @@ -177,7 +181,7 @@ they're exposed as instance methods that return Bluesky plans.
Understanding Command Signatures
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Commands can have arguments and return values. From the generated ``genNodeClass.py``,
Commands can have arguments and return values. From the generated node class file,
you can see the signature:

.. code-block:: python
Expand Down
6 changes: 4 additions & 2 deletions docs/source/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,10 @@ Using Generated Classes

.. code-block:: python

# Import generated classes
from genNodeClass import MyDevice
# Import generated classes -- each node is written to its own file,
# named after the node class, inside secop_ophyd_devs/, which is an
# importable package
from secop_ophyd_devs import MyDevice

# Instatiate device using generated class
with init_devices():
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dynamic = ["version"]
description = "An Interface between bluesky and SECoP, using ophyd and frappy-client"

dependencies = [
'ophyd-async (>=0.13.1,<=0.18)',
'ophyd-async (>0.18,<=0.19.3)',
'frappy-core >= 0.20.8',
'black',
'Jinja2',
Expand Down
Loading
Loading