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

Add FrameDict class

    Details

    • Type: Improvement
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: astshim
    • Story Points:
      2
    • Epic Link:
    • Sprint:
      Alert Production F17 - 11
    • Team:
      Alert Production

      Description

      Add a new class FrameDict to astshim that is a FrameSet with a table for looking up frame index by domain. This can greatly simplify much of the code in afw that manipulates FrameSets.

        Attachments

          Issue Links

            Activity

            rowen Russell Owen created issue -
            rowen Russell Owen made changes -
            Field Original Value New Value
            Epic Link DM-9679 [ 30784 ]
            rowen Russell Owen made changes -
            Link This issue relates to DM-10964 [ DM-10964 ]
            rowen Russell Owen made changes -
            Link This issue relates to DM-10765 [ DM-10765 ]
            rowen Russell Owen made changes -
            Reviewers Krzysztof Findeisen [ krzys ]
            Status To Do [ 10001 ] In Review [ 10004 ]
            rowen Russell Owen made changes -
            Comment [ Thank you for agreeing to review this.

            I have two questions:
            - It turns out that AST forces all domain names to uppercase. I'm tempted to do the same with lookup, thus permitting lowercase names in the code, e.g.: {{frameSet.getIndex("foo")}} will return the index of the frame with domain "FOO". This is especially useful if one specifies the frame domain using a lowercase string, e.g. {code}
            {{frame = ast.Frame(2, "Domain=foo")
            frameDict = ast.FrameDict(frame)
            assert frameDict.getIndex("foo") == 1
            {code}. What do you think?
            - Do you think I should add two more overloads of {{FrameDict.getMapping}}: one for {{(fromIndex, toDomain)}} and the other {{(fromDomain, toIndex)}}? The argument in favor is that it means one can use a domain name with {{FrameDict}} *anywhere* an index is required by {{FrameSet}}. The arguments against are that it adds internal clutter, and code that mixes index and domain may look a bit odd, e.g. {{frameSet.getMapping(1, "FOO")}} (looks ugly to me) or {{frameSet.getMapping(frameSet.CURRENT, "FOO")}} (not so bad, in my opinion).
            ]
            krzys Krzysztof Findeisen made changes -
            Status In Review [ 10004 ] In Progress [ 3 ]
            rowen Russell Owen made changes -
            Story Points 1 2
            rowen Russell Owen made changes -
            Status In Progress [ 3 ] In Review [ 10004 ]
            krzys Krzysztof Findeisen made changes -
            Status In Review [ 10004 ] Reviewed [ 10101 ]
            rowen Russell Owen made changes -
            Resolution Done [ 10000 ]
            Status Reviewed [ 10101 ] Done [ 10002 ]

              People

              • Assignee:
                rowen Russell Owen
                Reporter:
                rowen Russell Owen
                Reviewers:
                Krzysztof Findeisen
                Watchers:
                Krzysztof Findeisen, Russell Owen
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel