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

Make PropertySet/List more dict-like

    XMLWordPrintable

    Details

      Description

      Whilst working on DM-15653 it became clear that test code would be significantly simplified in places if more dunder methods were implements in PropertySet and PropertyList. This would also simplify the work on obs_metadata and make that less dependent on the LSST FITS header representation in DM-15646.

      For this ticket dict-like dunder methods will be added as well as others such as eq.

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment - - edited

            This ticket includes significant cleanups to the Python code and addition of many more tests (converted from the C++ at the end of the file). I also fix YAML serialization so that a PropertyList inside a PropertySet does not strip the comments (YAML and Pickle now recursively serialize rather than asking PropertySet/List to serialize at the top level). All dunder methods are implemented for dict-like behavior.

            We may decide that getitem should be removed for now until we can clarify what it should return. This relates to the discussion on community from DM-15705. There is also some experimental magic for handling dict access to comment values.

            Show
            tjenness Tim Jenness added a comment - - edited This ticket includes significant cleanups to the Python code and addition of many more tests (converted from the C++ at the end of the file). I also fix YAML serialization so that a PropertyList inside a PropertySet does not strip the comments (YAML and Pickle now recursively serialize rather than asking PropertySet/List to serialize at the top level). All dunder methods are implemented for dict-like behavior. We may decide that getitem should be removed for now until we can clarify what it should return. This relates to the discussion on community from DM-15705 . There is also some experimental magic for handling dict access to comment values.
            Hide
            tjenness Tim Jenness added a comment -

            Merged without the getter support for dict.

            Show
            tjenness Tim Jenness added a comment - Merged without the getter support for dict.

              People

              Assignee:
              tjenness Tim Jenness
              Reporter:
              tjenness Tim Jenness
              Reviewers:
              Jim Bosch
              Watchers:
              Jim Bosch, Kian-Tat Lim, Russell Owen, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.