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

Use a safer way to make a shallow copies

    XMLWordPrintable

    Details

      Description

      RampGenerator in ts_simactuators makes a shallow copy of a numpy array using [:] which turns out to not be safe. Use .copy() instead.

      ts_mthexapod and ts_salobj also use [:] to make a shallow copy. In those cases it's safe, but I'll fix ts_mthexapod in this ticket and fix ts_salobj in a different ticket because the best way to fix it is to use unittest.mock, and that should be applied to os.environ as well as sys.argv (so it's a bigger change)

        Attachments

          Issue Links

            Activity

            Hide
            rowen Russell Owen added a comment - - edited

            Since I was already working on ts_mthexapod I took the opportunity to fix DM-28804 as well: make azimuth and rotation coefficients required in the configuration, and add a unit test to check that any missing instance-specific item fails validation.

            Pull requests:

            Show
            rowen Russell Owen added a comment - - edited Since I was already working on ts_mthexapod I took the opportunity to fix DM-28804 as well: make azimuth and rotation coefficients required in the configuration, and add a unit test to check that any missing instance-specific item fails validation. Pull requests: https://github.com/lsst-ts/ts_simactuators/pull/13 https://github.com/lsst-ts/ts_mthexapod/pull/36
            Hide
            wvreeven Wouter van Reeven added a comment -

            Tiago Ribeiroand Wouter van Reeven approved both PRs involved with this ticket.

            Show
            wvreeven Wouter van Reeven added a comment - Tiago Ribeiro and Wouter van Reeven approved both PRs involved with this ticket.
            Hide
            rowen Russell Owen added a comment -

            I released ts_simactuators v2.2.1 after Tiago verified that it passes tests in his new Docker image.

            Release of ts_mthexapod awaits ts_xml 7.2. See DM-28604

            Show
            rowen Russell Owen added a comment - I released ts_simactuators v2.2.1 after Tiago verified that it passes tests in his new Docker image. Release of ts_mthexapod awaits ts_xml 7.2. See DM-28604

              People

              Assignee:
              rowen Russell Owen
              Reporter:
              rowen Russell Owen
              Reviewers:
              Wouter van Reeven
              Watchers:
              Russell Owen, Tiago Ribeiro, Wouter van Reeven
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.