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

Homogenize arguments for measurement tasks

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: faro
    • Labels:
      None

      Description

      There is a need for a consistent approach to handle arguments being passed to the measurement tasks. A single base class run method for a given analysis context (e.g., per-track metrics) will in general be used to call multiple different measurement tasks. Also, a given measurement task could be called by several base class run methods.

      One approach would be to always use keyword arguments. Another would be to enforce some arguments that will always be needed. I think the ones that will always be needed (for catalog-based metrics) are metric name and catalog.

        Attachments

          Issue Links

            Activity

            Hide
            kbechtol Keith Bechtol added a comment -

            If at all possible, we should avoid passing dataId's to the tasks that perform measurements. We should use FilterLabel or list of FilterLabels instead. See

            https://github.com/lsst/faro/pull/94#discussion_r675154516

            Show
            kbechtol Keith Bechtol added a comment - If at all possible, we should avoid passing dataId's to the tasks that perform measurements. We should use FilterLabel or list of FilterLabels instead. See https://github.com/lsst/faro/pull/94#discussion_r675154516
            Hide
            kbechtol Keith Bechtol added a comment -

            Below is an attempt to summarize the definitions of all the run methods, generated with a command like grep -rnw 'python/lsst/faro' -e 'def run' -A 10

            python/lsst/faro/measurement/VisitTableMeasurement.py:72: def run(self, catalog):

            python/lsst/faro/measurement/TractMeasurementTasks.py:50: def run(
            python/lsst/faro/measurement/TractMeasurementTasks.py-51- self, metricName, catalogs, photoCalibs=None, astromCalibs=None, dataIds=None
            python/lsst/faro/measurement/TractMeasurementTasks.py-52- ):

            python/lsst/faro/measurement/TractMeasurementTasks.py:127: def run(
            python/lsst/faro/measurement/TractMeasurementTasks.py-128- self, metricName, catalogs, photoCalibs=None, astromCalibs=None, dataIds=None
            python/lsst/faro/measurement/TractMeasurementTasks.py-129- ):

            python/lsst/faro/measurement/example_VisitMeasurementTasks.py:34: def run(self, catalog, metric_name, vIds):

            python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:110: def run(self, matchedCatalog, metricName):

            python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:203: def run(self, matchedCatalog, metricName):

            python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:291: def run(self, matchedCatalog, metric_name):

            python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:331: def run(self, matchedCatalog, metric_name):

            python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:365: def run(self, matchedCatalog, metric_name):

            python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:409: def run(self, matchedCatalogMulti, metric_name, in_id, out_id):

            python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:505: def run(self, matchedCatalog, metricName):

            python/lsst/faro/measurement/GeneralMeasurementTasks.py:35: def run(self, measurements, agg_name, package, metric):

            python/lsst/faro/measurement/MatchedCatalogMeasurement.py:134: def run(self, cat, in_id, out_id):

            python/lsst/faro/measurement/TractMeasurement.py:93: def run(self, catalogs, photoCalibs, astromCalibs, dataIds):

            python/lsst/faro/measurement/PatchMeasurement.py:67: def run(self, cat, vIds):

            python/lsst/faro/base/CatalogMeasurementBase.py:100: def run(self, catalog, **kwargs):

            python/lsst/faro/base/CatalogSummaryBase.py:72: def run(self, measurements):

            python/lsst/faro/base/BaseSubTasks.py:52: def run(self, metricName, catalog, **kwargs):

            python/lsst/faro/base/BaseSubTasks.py:84: def run(self, metricName, catalogs, photoCalibs, astromCalibs, **kwargs):

            python/lsst/faro/base/BaseSubTasks.py:103: def run(self, measurements, agg_name, package, metric):

            python/lsst/faro/base/MatchedCatalogBase.py:170: def run(
            python/lsst/faro/base/MatchedCatalogBase.py-171- self,
            python/lsst/faro/base/MatchedCatalogBase.py-172- sourceCatalogs,
            python/lsst/faro/base/MatchedCatalogBase.py-173- photoCalibs,
            python/lsst/faro/base/MatchedCatalogBase.py-174- astromCalibs,
            python/lsst/faro/base/MatchedCatalogBase.py-175- dataIds,
            python/lsst/faro/base/MatchedCatalogBase.py-176- wcs,
            python/lsst/faro/base/MatchedCatalogBase.py-177- box,
            python/lsst/faro/base/MatchedCatalogBase.py-178- doApplyExternalSkyWcs=False,
            python/lsst/faro/base/MatchedCatalogBase.py-179- doApplyExternalPhotoCalib=False,
            python/lsst/faro/base/MatchedCatalogBase.py-180- ):

            Next, search for where run methods are called with a command like grep -rnw 'python/lsst/faro' -e 'run(' | grep -v def

            python/lsst/faro/measurement/VisitMeasurement.py:86: outputs = self.run(**inputs)

            python/lsst/faro/measurement/MatchedCatalogMeasurement.py:149: outputs = self.run(**inputs)

            python/lsst/faro/measurement/TractMeasurement.py:94: return self.measure.run(
            python/lsst/faro/measurement/TractMeasurement.py-95- self.config.connections.metric, catalogs, photoCalibs, astromCalibs, dataIds
            python/lsst/faro/measurement/TractMeasurement.py-96- )

            python/lsst/faro/measurement/TractMeasurement.py:103: outputs = self.run(**inputs)

            python/lsst/faro/measurement/PatchMeasurement.py:73: outputs = self.run(**inputs)

            python/lsst/faro/measurement/DetectorMeasurement.py:174: outputs = self.run(**inputs)

            python/lsst/faro/base/CatalogSummaryBase.py:73: return self.agg.run(
            python/lsst/faro/base/CatalogSummaryBase.py-74- measurements,
            python/lsst/faro/base/CatalogSummaryBase.py-75- self.config.connections.agg_name,
            python/lsst/faro/base/CatalogSummaryBase.py-76- self.config.connections.package,
            python/lsst/faro/base/CatalogSummaryBase.py-77- self.config.connections.metric,
            python/lsst/faro/base/CatalogSummaryBase.py-78- )

            python/lsst/faro/base/MatchedCatalogBase.py:271: outputs = self.run(**inputs)

            Show
            kbechtol Keith Bechtol added a comment - Below is an attempt to summarize the definitions of all the run methods, generated with a command like grep -rnw 'python/lsst/faro' -e 'def run' -A 10 python/lsst/faro/measurement/VisitTableMeasurement.py:72: def run(self, catalog): python/lsst/faro/measurement/TractMeasurementTasks.py:50: def run( python/lsst/faro/measurement/TractMeasurementTasks.py-51- self, metricName, catalogs, photoCalibs=None, astromCalibs=None, dataIds=None python/lsst/faro/measurement/TractMeasurementTasks.py-52- ): python/lsst/faro/measurement/TractMeasurementTasks.py:127: def run( python/lsst/faro/measurement/TractMeasurementTasks.py-128- self, metricName, catalogs, photoCalibs=None, astromCalibs=None, dataIds=None python/lsst/faro/measurement/TractMeasurementTasks.py-129- ): python/lsst/faro/measurement/example_VisitMeasurementTasks.py:34: def run(self, catalog, metric_name, vIds): python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:110: def run(self, matchedCatalog, metricName): python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:203: def run(self, matchedCatalog, metricName): python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:291: def run(self, matchedCatalog, metric_name): python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:331: def run(self, matchedCatalog, metric_name): python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:365: def run(self, matchedCatalog, metric_name): python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:409: def run(self, matchedCatalogMulti, metric_name, in_id, out_id): python/lsst/faro/measurement/MatchedCatalogMeasurementTasks.py:505: def run(self, matchedCatalog, metricName): python/lsst/faro/measurement/GeneralMeasurementTasks.py:35: def run(self, measurements, agg_name, package, metric): python/lsst/faro/measurement/MatchedCatalogMeasurement.py:134: def run(self, cat, in_id, out_id): python/lsst/faro/measurement/TractMeasurement.py:93: def run(self, catalogs, photoCalibs, astromCalibs, dataIds): python/lsst/faro/measurement/PatchMeasurement.py:67: def run(self, cat, vIds): python/lsst/faro/base/CatalogMeasurementBase.py:100: def run(self, catalog, **kwargs): python/lsst/faro/base/CatalogSummaryBase.py:72: def run(self, measurements): python/lsst/faro/base/BaseSubTasks.py:52: def run(self, metricName, catalog, **kwargs): python/lsst/faro/base/BaseSubTasks.py:84: def run(self, metricName, catalogs, photoCalibs, astromCalibs, **kwargs): python/lsst/faro/base/BaseSubTasks.py:103: def run(self, measurements, agg_name, package, metric): python/lsst/faro/base/MatchedCatalogBase.py:170: def run( python/lsst/faro/base/MatchedCatalogBase.py-171- self, python/lsst/faro/base/MatchedCatalogBase.py-172- sourceCatalogs, python/lsst/faro/base/MatchedCatalogBase.py-173- photoCalibs, python/lsst/faro/base/MatchedCatalogBase.py-174- astromCalibs, python/lsst/faro/base/MatchedCatalogBase.py-175- dataIds, python/lsst/faro/base/MatchedCatalogBase.py-176- wcs, python/lsst/faro/base/MatchedCatalogBase.py-177- box, python/lsst/faro/base/MatchedCatalogBase.py-178- doApplyExternalSkyWcs=False, python/lsst/faro/base/MatchedCatalogBase.py-179- doApplyExternalPhotoCalib=False, python/lsst/faro/base/MatchedCatalogBase.py-180- ): Next, search for where run methods are called with a command like grep -rnw 'python/lsst/faro' -e 'run(' | grep -v def python/lsst/faro/measurement/VisitMeasurement.py:86: outputs = self.run(**inputs) python/lsst/faro/measurement/MatchedCatalogMeasurement.py:149: outputs = self.run(**inputs) python/lsst/faro/measurement/TractMeasurement.py:94: return self.measure.run( python/lsst/faro/measurement/TractMeasurement.py-95- self.config.connections.metric, catalogs, photoCalibs, astromCalibs, dataIds python/lsst/faro/measurement/TractMeasurement.py-96- ) python/lsst/faro/measurement/TractMeasurement.py:103: outputs = self.run(**inputs) python/lsst/faro/measurement/PatchMeasurement.py:73: outputs = self.run(**inputs) python/lsst/faro/measurement/DetectorMeasurement.py:174: outputs = self.run(**inputs) python/lsst/faro/base/CatalogSummaryBase.py:73: return self.agg.run( python/lsst/faro/base/CatalogSummaryBase.py-74- measurements, python/lsst/faro/base/CatalogSummaryBase.py-75- self.config.connections.agg_name, python/lsst/faro/base/CatalogSummaryBase.py-76- self.config.connections.package, python/lsst/faro/base/CatalogSummaryBase.py-77- self.config.connections.metric, python/lsst/faro/base/CatalogSummaryBase.py-78- ) python/lsst/faro/base/MatchedCatalogBase.py:271: outputs = self.run(**inputs)
            Hide
            kbechtol Keith Bechtol added a comment -

            Doing some clean-up of old tickets. This work was accomplished as part https://github.com/lsst/faro/pull/94

            Show
            kbechtol Keith Bechtol added a comment - Doing some clean-up of old tickets. This work was accomplished as part https://github.com/lsst/faro/pull/94
            Hide
            Parejkoj John Parejko added a comment -

            I saw I got a review request: is there something you want me to review here?

            Show
            Parejkoj John Parejko added a comment - I saw I got a review request: is there something you want me to review here?
            Hide
            kbechtol Keith Bechtol added a comment -

            Sorry for the confusion. There is nothing new to review here. Rather, I was going through old tickets from faro development and noticed that the work for this ticket had been done as part of a PR (https://github.com/lsst/faro/pull/94) that John Parejko had reviewed previously. I had meant to include this ticket at that time, but it slipped through the cracks. The request for review is simply to formally close this ticket.

            Show
            kbechtol Keith Bechtol added a comment - Sorry for the confusion. There is nothing new to review here. Rather, I was going through old tickets from faro development and noticed that the work for this ticket had been done as part of a PR ( https://github.com/lsst/faro/pull/94 ) that John Parejko had reviewed previously. I had meant to include this ticket at that time, but it slipped through the cracks. The request for review is simply to formally close this ticket.

              People

              Assignee:
              kbechtol Keith Bechtol
              Reporter:
              kbechtol Keith Bechtol
              Reviewers:
              John Parejko
              Watchers:
              John Parejko, Keith Bechtol
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.