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

Check on StarGalaxyLabeller

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: pipe_tasks, qa_explorer
    • Labels:
      None

      Description

      Scary inline comment in about being backwards. Please double check and remove. Or remove functor if it's not used.

      class StarGalaxyLabeller(Labeller):
          _columns = ["base_ClassificationExtendedness_value"]
          _column = "base_ClassificationExtendedness_value"
       
          def _func(self, df):
              x = df[self._columns][self._column]
              mask = x.isnull()
              test = (x < 0.5).astype(int)
              test = test.mask(mask, 2)
       
              # are these backwards?
              categories = ['galaxy', 'star', self._null_label]
              label = pd.Series(pd.Categorical.from_codes(test, categories=categories),
                                index=x.index, name='label')
              if self._force_str:
                  label = label.astype(str)
              return label
      

        Attachments

          Activity

          Hide
          kannawad Arun Kannawadi added a comment -

          From my Github code searches so far in org:lsst and org:lsst-dm, the following functors are never used anywhere (except may be in their own unit tests) and can (should) be safely removed.

          • FootprintNPix
          • IDColumn
          • NanoMaggie
          • Mag
          • MagErr
          • Magnitude
          • MagnitudeErr
          • LocalMagnitude
          • LocalMagnitudeErr
          • Ratio

          John Parejko has also asked for some of these to be removed in DM-36182.

          The following ones are used only in lsst-dm/qa_explorer, which is where Yusra AlSayyad had moved from to pipe_tasks. I'm inclined to move them back to qa_explorer instead of removing them altogether. I know qa_explorer isn't actively developer or used, but I'd rather let these die along with the package rather than before.

          • Labeller
          • StarGalaxyLabeller
          • NumStarLabeller
          Show
          kannawad Arun Kannawadi added a comment - From my Github code searches so far in org:lsst and org:lsst-dm, the following functors are never used anywhere (except may be in their own unit tests) and can (should) be safely removed. FootprintNPix IDColumn NanoMaggie Mag MagErr Magnitude MagnitudeErr LocalMagnitude LocalMagnitudeErr Ratio John Parejko has also asked for some of these to be removed in DM-36182 . The following ones are used only in lsst-dm/qa_explorer, which is where Yusra AlSayyad had moved from to pipe_tasks. I'm inclined to move them back to qa_explorer instead of removing them altogether. I know qa_explorer isn't actively developer or used, but I'd rather let these die along with the package rather than before. Labeller StarGalaxyLabeller NumStarLabeller
          Hide
          kannawad Arun Kannawadi added a comment -

          I have removed/moved most of the functors listed. I am punting the removal of Mag, MagErr, MagDiff to another ticket (possibly DM-36182). It's a bit more involved to remove them due to their usage in unit tests to test other things.

          Show
          kannawad Arun Kannawadi added a comment - I have removed/moved most of the functors listed. I am punting the removal of Mag, MagErr, MagDiff to another ticket (possibly DM-36182 ). It's a bit more involved to remove them due to their usage in unit tests to test other things.
          Hide
          kannawad Arun Kannawadi added a comment -

          Thanks for agreeing to review, Lauren!

          PRs:

          Jenkins is ongoing: https://ci.lsst.codes/job/stack-os-matrix/38887/display/redirect

          qa_explorer looks broken anyway with the current stack. I am not trying to fix the broken aspects here, but trying to not break it furthermore. Either way, since it is not included in lsst_distrib, it should not break the build.

          Show
          kannawad Arun Kannawadi added a comment - Thanks for agreeing to review, Lauren! PRs: https://github.com/lsst/pipe_tasks/pull/790 https://github.com/lsst-dm/qa_explorer/pull/21 Jenkins is ongoing: https://ci.lsst.codes/job/stack-os-matrix/38887/display/redirect qa_explorer looks broken anyway with the current stack. I am not trying to fix the broken aspects here, but trying to not break it furthermore. Either way, since it is not included in lsst_distrib, it should not break the build.
          Hide
          lauren Lauren MacArthur added a comment -

          Some very minor comments on the PR. Otherwise, LGTM!

          Show
          lauren Lauren MacArthur added a comment - Some very minor comments on the PR. Otherwise, LGTM!
          Hide
          kannawad Arun Kannawadi added a comment -

          Addressed them and merged!

          Show
          kannawad Arun Kannawadi added a comment - Addressed them and merged!

            People

            Assignee:
            kannawad Arun Kannawadi
            Reporter:
            yusra Yusra AlSayyad
            Reviewers:
            Lauren MacArthur
            Watchers:
            Arun Kannawadi, Lauren MacArthur, Sophie Reed, Yusra AlSayyad
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.