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

Remove int and long from schema aliases

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Templates:
    • Story Points:
      0
    • Team:
      Data Release Production

      Description

      In python 3 all integers are 64 bit "long" integers, while in python 2, 32 and 64 bit integers are differentiated by the int and long types respectively. This causes confusion when adding a new field to a schema using addField in afw/table/Base.i in python 3, where the python type is converted into a C++ type using a dictionary

      aliases = {
          long: "L",
          int: "I",
          float: "D",
          str: "String",
          futurestr: "String",
          numpy.uint16: "U",
          numpy.int32: "I",
          numpy.int64: "L",
          numpy.float32: "F",
          numpy.float64: "D",
          Angle: "Angle",
      }
      

      In RFC-227 it was decided that int and long will be removed from aliases, leaving

      aliases = {
          str: "String",
          futurestr: "String",
          numpy.uint16: "U",
          numpy.int32: "I",
          numpy.int64: "L",
          numpy.float32: "F",
          numpy.float64: "D",
          Angle: "Angle",
      }
      

      All existing code using `type=long` will need to be updated as part of this ticket.

      This will be included in the pybind11 wrapped code, with a deprecation warning for users attempting to add fields using int or long.

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  fred3m Fred Moolekamp
                  Reporter:
                  fred3m Fred Moolekamp
                  Watchers:
                  Fred Moolekamp, Jim Bosch
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel