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

Update deprecated use of time.clock()

    XMLWordPrintable

    Details

      Description

      In running some tests involving pipe_base I got this warning:

      /Volumes/ExternalSSD/Users/timj/work/lsstsw37/stack/DarwinX86/pipe_base/16.0-10-g0b41441+6/python/lsst/pipe/base/timer.py:91: DeprecationWarning: time.clock has been deprecated in Python 3.3 and will be removed from Python 3.8: use time.perf_counter or time.process_time instead
      

      Not urgent yet but the Python developers have now given an explicit timeline for when it will become a problem.

        Attachments

          Activity

          Hide
          Parejkoj John Parejko added a comment -

          Having just seen a mess of these warnings running jointcal tests, I'd like to clean them up. However, it's not clear to me whether our intended usage here is of the perf_counter or process_time variety. In fact, given that we're logging that value and not doing differences in this code, it seems to me that neither of those options is correct for us. Is the value of cpuTime logged by pipe.base.timer.logInfo() used anywhere?

          Show
          Parejkoj John Parejko added a comment - Having just seen a mess of these warnings running jointcal tests, I'd like to clean them up. However, it's not clear to me whether our intended usage here is of the perf_counter or process_time variety. In fact, given that we're logging that value and not doing differences in this code, it seems to me that neither of those options is correct for us. Is the value of cpuTime logged by pipe.base.timer.logInfo() used anywhere?
          Hide
          tjenness Tim Jenness added a comment -

          I didn't fix it because I had no idea what the right answer was. Russell Owen wrote the initial code so maybe he has some thoughts. time.process_time seems to be closest.

          Show
          tjenness Tim Jenness added a comment - I didn't fix it because I had no idea what the right answer was. Russell Owen wrote the initial code so maybe he has some thoughts. time.process_time seems to be closest.
          Hide
          Parejkoj John Parejko added a comment -

          Good, that makes three of us: Russell Owen also said he thought process_time was most appropriate.

          Tim Jenness: can you do this small review, please? It got rid of the warnings I was seeing in jointcal.

          Jenkins run: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/29612/pipeline

          Show
          Parejkoj John Parejko added a comment - Good, that makes three of us: Russell Owen also said he thought process_time was most appropriate. Tim Jenness : can you do this small review, please? It got rid of the warnings I was seeing in jointcal. Jenkins run: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/29612/pipeline
          Hide
          tjenness Tim Jenness added a comment -

          Looks okay to me given what we know about the problem.

          Show
          tjenness Tim Jenness added a comment - Looks okay to me given what we know about the problem.
          Hide
          Parejkoj John Parejko added a comment -

          Thanks for the quick review.

          Merged and done.

          Show
          Parejkoj John Parejko added a comment - Thanks for the quick review. Merged and done.

            People

            Assignee:
            Parejkoj John Parejko
            Reporter:
            tjenness Tim Jenness
            Reviewers:
            Tim Jenness
            Watchers:
            John Parejko, John Swinbank, Russell Owen, Tim Jenness
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.