-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add entry points documentation for RecordFactory
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters