Skip to content

Commit

Permalink
Merge pull request #265 from bluesky/258-Bluesky-for-SPEC-users
Browse files Browse the repository at this point in the history
Make it easier to find the SPEC command cross-reference table

@mrakitin Thanks!
  • Loading branch information
prjemian authored Oct 6, 2023
2 parents a7ddc35 + a0a54bb commit 45dbf4e
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 36 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Fixes
Maintenance
-----------

* Move table with SPEC commands cross-reference to a HOWTO document.
* ``util.list_orientation_runs()`` added progress bar.
* Support Py3.8, 3.9, 3.10, & 3.11
* Support libhkl v5.0.0.3001 (& v5.0.0.3357 when ready)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/3/": None}
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
inheritance_graph_attrs = dict(rankdir="LR")
inheritance_node_attrs = dict(fontsize=24)
autosummary_generate = True
47 changes: 47 additions & 0 deletions docs/source/examples/notebooks/how_spec_commands.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. _spec_commands_map:

========================
SPEC commands in Bluesky
========================

Make it easier for users (especially SPEC users) to learn and remember
the new tools in Bluesky's *hklpy* package.

In addition to the comparison with SPEC commands, more *hklpy* commands
are listed in the :ref:`user` section.

.. index:: !Quick Reference Table

Quick Reference Table

============== ================================== ============
*SPEC* *hklpy* description
============== ================================== ============
-- :func:`~calc_UB` Compute the UB matrix with two reflections.
-- :func:`~change_sample` Pick a known sample to be the current selection.
-- :func:`~list_samples` List all defined crystal samples.
-- :func:`~new_sample` Define a new crystal sample.
-- :func:`~select_diffractometer` Select the default diffractometer.
``br h k l`` `DIFFRACTOMETER.move(h, k, l)` move the diffractometer motors to the given :math:`h, k, l`.
``ca h k l`` `cahkl(h, k, l)` Prints calculated motor settings for the given :math:`h, k, l`.
``cuts`` TODO: constraints
``cz`` TODO:
``freeze`` TODO: constraints
``g_sect`` TODO: constraints
``mz`` TODO:
``or_swap`` `or_swap()` Exchange primary & secondary orientation reflections.
``or0`` :func:`~setor` Define a crystal reflection and its motor positions.
``or1`` :func:`~setor` Define a crystal reflection and its motor positions.
``pa`` :func:`~pa` Report all diffractometer settings.
``pl`` TODO:
``reflex_beg`` TODO:
``reflex_end`` TODO:
``reflex`` TODO:
``setaz`` TODO:
``setlat`` :func:`~update_sample(...)` Update current sample lattice.
``setmode`` TODO: modes
``setsector`` TODO:
``sz`` TODO:
``unfreeze`` TODO: constraints
``wh`` :func:`~wh` Report (brief) where is the diffractometer.
============== ================================== ============
35 changes: 2 additions & 33 deletions docs/source/user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,8 @@ user
Make it easier for users (especially SPEC users) to learn and remember
the new tools in Bluesky's *hklpy* package.

.. index:: !Quick Reference Table

Quick Reference Table

============== =======================================
*SPEC* *hklpy*
============== =======================================
-- :func:`~calc_UB`
-- :func:`~new_sample`
-- :func:`~select_diffractometer`
``br`` TODO:
``cal`` :func:`cahkl`
``cuts`` TODO: constraints
``cz`` TODO:
``freeze`` TODO: constraints
``g_sect`` TODO: constraints
``mz`` TODO:
``or_swap`` TODO:
``or0`` :func:`~setor`
``or1`` :func:`~setor`
``pa`` :func:`~pa`
``pl`` TODO:
``reflex_beg`` TODO:
``reflex_end`` TODO:
``reflex`` TODO:
``setaz`` TODO:
``setlat`` :func:`~update_sample`
``setmode`` TODO: modes
``setsector`` TODO:
``sz`` TODO:
``unfreeze`` TODO: constraints
``wh`` :func:`~wh`
============== =======================================
See :ref:`spec_commands_map` for a table of SPEC commands and their counterparts
in *hklpy*.

.. automodule:: hkl.user
:members:
Expand Down
4 changes: 2 additions & 2 deletions hkl/user.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Provide a simplified UI for hklpy diffractometer users.
Provide a simplified interface for hklpy diffractometer users.
The user must define a diffractometer instance, then
register that instance here calling `select_diffractometer(instance)`.
register that instance here calling ``select_diffractometer(instance)``.
FUNCTIONS
Expand Down

0 comments on commit 45dbf4e

Please sign in to comment.