diff --git a/pyproject.toml b/pyproject.toml index c2802f5ab..3bc44f9e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,9 @@ name = "lsst-obs-lsst" [project.entry-points.'butler.cli'] obs_lsst = "lsst.obs.lsst.cli:get_cli_subcommands" +[project.entry-points.astro_metadata_translators] +obs_lsst = "lsst.obs.lsst.translators:_register_translators" + [tool.ruff] line-length = 110 target-version = "py311" diff --git a/python/lsst/obs/lsst/translators/__init__.py b/python/lsst/obs/lsst/translators/__init__.py index 687262631..9677ad0a6 100644 --- a/python/lsst/obs/lsst/translators/__init__.py +++ b/python/lsst/obs/lsst/translators/__init__.py @@ -18,3 +18,26 @@ from .comCam import * from .comCamSim import * from .lsstCamSim import * + + +def _register_translators() -> list[str]: + """Ensure that the translators are loaded. + + When this function is imported we are guaranteed to also import the + translators which will automatically register themselves. + + Returns + ------- + translators : `list` [ `str` ] + The names of the translators provided by this package. + """ + return [ + LsstCamTranslator.name, + LatissTranslator.name, + LsstComCamTranslator.name, + LsstComCamSimTranslator.name, + LsstCamSimTranslator.name, + LsstCamImSimTranslator.name, + LsstUCDCamTranslator.name, + LsstCamPhoSimTranslator.name, + ]