Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-24378

Store instrument class with gen3 instrument registration and add API

    XMLWordPrintable

    Details

    • Story Points:
      1
    • Team:
      Architecture
    • Urgent?:
      No

      Description

      When designing the butler command line tools it is clear that life would be much simpler if an instrument could be referred to by name rather than by instrument class. It should only be instrument registration that requires the full class name. All other operations should work by specifying the name, looking up the name in registry and retrieving the class name, using doImport on that class, and instantiating the class for downstream usage.

      For this to work we need two changes:

      1. Add the instrument class full name text string to registry.
      2. Have an API (butler.registry.getInstrument?) that will return an instantiated gen3 Instrument (they don't need parameters) given the name of the instrument.

        Attachments

          Activity

          Hide
          tjenness Tim Jenness added a comment -

          Only a few lines to implement this. Nate Pease [X] once merged you should be able to use Instrument.fromName("HSC") to get the relevant instrument class once it's been registered. It does have to match case so LSSTCam and not lsstCam etc.

          Jim Bosch to get this working quickly I had to use lsst.daf.butler.core.utils.getFullyTypeName in Instrument classes. In theory that's naughty.

          Show
          tjenness Tim Jenness added a comment - Only a few lines to implement this. Nate Pease [X] once merged you should be able to use Instrument.fromName("HSC") to get the relevant instrument class once it's been registered. It does have to match case so LSSTCam and not lsstCam etc. Jim Bosch to get this working quickly I had to use lsst.daf.butler.core.utils.getFullyTypeName in Instrument classes. In theory that's naughty.
          Hide
          jbosch Jim Bosch added a comment -

          It might be best to just do from .core import utils in daf_butler someday so we can use the utils module outside daf_butler without feeling bad about it (and also don't pull all of its symbols in directly), but I don't care if we do that on this ticket or not.

          In fact, I'd love to just have this land quickly as I can use it immediately in my changes to ingest and visit definition.

          Show
          jbosch Jim Bosch added a comment - It might be best to just do from .core import utils in daf_butler someday so we can use the utils module outside daf_butler without feeling bad about it (and also don't pull all of its symbols in directly), but I don't care if we do that on this ticket or not. In fact, I'd love to just have this land quickly as I can use it immediately in my changes to ingest and visit definition.

            People

            Assignee:
            tjenness Tim Jenness
            Reporter:
            tjenness Tim Jenness
            Reviewers:
            Jim Bosch
            Watchers:
            Andy Salnikov, Jim Bosch, Nate Pease [X] (Inactive), Tim Jenness
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.