Skip to content

Commit

Permalink
Add entry points documentation for RecordFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jan 18, 2025
1 parent 7188910 commit a7af72e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions doc/lsst.daf.butler/dev/entryPoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _lsst.daf.butler-dev_entry_points:

.. py:currentmodule:: lsst.daf.butler
Support Entry Points
--------------------

Some functionality is enabled by utilizing the Python entry points system.
Entry points are managed by the ``project.entry_points`` section of the ``pyproject.toml`` file.


Command Line Subcommands
^^^^^^^^^^^^^^^^^^^^^^^^

The entry points that support command-line subcommands are documented in :ref:`daf_butler_cli-entry-points`.

ObsCore RecordFactory
^^^^^^^^^^^^^^^^^^^^^

`lsst.daf.butler.registry.obscore.RecordFactory` is the class that generates ObsCore records from Butler datasets.
This conversion generally requires decisions to be made that depend on the dimension universe for the butler.
The default implementation only works with the ``daf_butler`` dimension universe namespace.
Alternative implementations can be registered using the ``butler.obscore_factory`` entry point group.
The label associated with the entry point should correspond to the universe namespace.

For example, a hypothetical entry point for the default namespace could be written in the ``pyproject.toml`` file as:

.. code-block:: TOML
[project.entry-points.'butler.obscore_factory']
daf_butler = "lsst.daf.butler.registry.obscore._records.DafButlerRecordFactory"
The function listed for the entry point should return the Python type that should be used to generate records.
It is required to be a subclass of `lsst.daf.butler.registry.obscore.RecordFactory`.
1 change: 1 addition & 0 deletions doc/lsst.daf.butler/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ You can find Jira issues for this module under the `daf_butler <https://jira.lss
:maxdepth: 1

dev/dataCoordinate.rst
dev/entryPoints.rst

Butler Command Line Interface Development
-----------------------------------------
Expand Down

0 comments on commit a7af72e

Please sign in to comment.