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

utils raDecStr delimiters are untested and don't work

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: utils
    • Templates:
    • Story Points:
      2
    • Epic Link:
    • Sprint:
      DRP F16-4, DRP F16-5
    • Team:
      Data Release Production

      Description

      In working on DM-6320 I noticed that there do not seem to be any tests for the decStrToDeg and related functions. When I added the following test:

         def testDecStrToDegDelim(self):
              deg = lsstutils.decStrToDeg("+15_00_00.00", "_")
              self.assertAlmostEqual(deg, 15.0, 6)
      

      it failed with:

      Failed to parse +15_00_00.00 as a declination with delimiter '_' and regex '([\d]+)_(\d+)_([\d\.]+)'
      

      (I added some extra information to the exception).

      Furthermore, decStrToRad (and the equivalent RA version) do not pass through the delimiter at all:

      double ut::decStrToRad(std::string decStr, std::string delimiter) {
          return degToRad( decStrToDeg(decStr) );
      }
      

      Please add some tests. Alternatively, we could remove the delimiter option completely.

      It might also be worth removing the code duplication in the RA and Dec variants.

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  jmeyers314 Joshua Meyers
                  Reporter:
                  tjenness Tim Jenness
                  Reviewers:
                  Nate Lust
                  Watchers:
                  John Swinbank, Joshua Meyers, Nate Lust, Russell Owen, Tim Jenness, Xiuqin Wu
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel