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

add ability to run an obs_base command via the butler command

    XMLWordPrintable

    Details

    • Story Points:
      8
    • Sprint:
      DB_S20_02
    • Team:
      Data Access and Database
    • Urgent?:
      No

      Description

      Make the butler command in daf_butler able to call the register command in obs_base (at python/lsst/obs/base/instrument.py).

      To do this, when obs_base is setup, it should add a colon separated list of CLI python code modules or functions. For example set it to lsst.obs.base.cli.

      Then in butler command itself do something like:

      for module in os.environ["DAF_BUTLER_PLUGINS"].split(":"):
       blah = doImport(cls) 

      and maybe have the imported class import the subcommands to click somehow
      ...it may help to be explicit and have the env var contain the actual command function (so lsst.obs.base.cli.register or somesuch). 

        Attachments

          Issue Links

            Activity

            npease Nate Pease created issue -
            npease Nate Pease made changes -
            Field Original Value New Value
            Epic Link DM-22400 [ 427076 ]
            npease Nate Pease made changes -
            Component/s daf_butler [ 11300 ]
            Labels gen2-deprecation-blocker gen3-middleware
            tjenness Tim Jenness made changes -
            Component/s obs_base [ 10719 ]
            npease Nate Pease made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            npease Nate Pease made changes -
            Description Make the butler command in daf_butler able to call the register command in obs_base (at python/lsst/obs/base/instrument.py). To do this, when obs_base is setup, it should add its path (perhaps a path to its `cli` folder...) to an env var called DAF_BUTLER_PLUGINS. When the butler CLI command runs it should load plugins from that var and so be able to call the command in obs_base.
            Make the butler command in daf_butler able to call the register command in obs_base (at python/lsst/obs/base/instrument.py).

            To do this, when obs_base is setup, it should add a colon separated list of CLI python code modules or functions. For example set it to {{lsst.obs.base.cli}}.

            Then in butler command itself do something like:
             \{\{for module in os.environ["DAF_BUTLER_PLUGINS"].split(":"):
             blah = doImport(cls)}}
             and maybe have the imported class import the subcommands to click somehow
             ...it may help to be explicit and have the env var contain the actual command function (so lsst.obs.base.cli.register or somesuch). 
            npease Nate Pease made changes -
            Description Make the butler command in daf_butler able to call the register command in obs_base (at python/lsst/obs/base/instrument.py).

            To do this, when obs_base is setup, it should add a colon separated list of CLI python code modules or functions. For example set it to {{lsst.obs.base.cli}}.

            Then in butler command itself do something like:
             \{\{for module in os.environ["DAF_BUTLER_PLUGINS"].split(":"):
             blah = doImport(cls)}}
             and maybe have the imported class import the subcommands to click somehow
             ...it may help to be explicit and have the env var contain the actual command function (so lsst.obs.base.cli.register or somesuch). 
            Make the butler command in daf_butler able to call the register command in obs_base (at python/lsst/obs/base/instrument.py).

            To do this, when obs_base is setup, it should add a colon separated list of CLI python code modules or functions. For example set it to {{lsst.obs.base.cli}}.

            Then in butler command itself do something like:
            {code:java}
            for module in os.environ["DAF_BUTLER_PLUGINS"].split(":"):
             blah = doImport(cls) {code}
            and maybe have the imported class import the subcommands to click somehow
             ...it may help to be explicit and have the env var contain the actual command function (so lsst.obs.base.cli.register or somesuch). 
            npease Nate Pease made changes -
            Link This issue relates to DM-21898 [ DM-21898 ]
            npease Nate Pease made changes -
            Reviewers Tim Jenness [ tjenness ]
            Status In Progress [ 3 ] In Review [ 10004 ]
            tjenness Tim Jenness made changes -
            Status In Review [ 10004 ] Reviewed [ 10101 ]
            npease Nate Pease made changes -
            Resolution Done [ 10000 ]
            Status Reviewed [ 10101 ] Done [ 10002 ]

              People

              Assignee:
              npease Nate Pease
              Reporter:
              npease Nate Pease
              Reviewers:
              Tim Jenness
              Watchers:
              Jim Bosch, Nate Pease, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: