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

multi-level replacement in Schema aliases

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw

      Description

      Schema aliases should support more than one level (i.e. an alias may resolve to another alias).

        Attachments

          Issue Links

            Activity

            Hide
            jbosch Jim Bosch added a comment -

            Daniel, up for a small review in afw?

            This adds recursive behavior to the afw::table alias system: instead of just replacing name lookups that begin with registered aliases with the alias target once, we do it repeatedly until we don't find another match. Should be straightforward and well-localized, so I don't think it should be a problem that there's a lot of unfamiliar code nearby.

            All changes are on afw branch u/jbosch/DM-1282:

            afw:u/jbosch/DM-1282 % git diff --stat master...u/jbosch/DM-1282
             python/lsst/afw/table/Base.i |    8 ++++----
             src/table/AliasMap.cc        |   37 +++++++++++++++++++++++++------------
             src/table/Schema.cc          |   10 +++++-----
             tests/testTableAliases.py    |   17 +++++++++++++++++
             4 files changed, 51 insertions(+), 21 deletions(-)

            Show
            jbosch Jim Bosch added a comment - Daniel, up for a small review in afw? This adds recursive behavior to the afw::table alias system: instead of just replacing name lookups that begin with registered aliases with the alias target once, we do it repeatedly until we don't find another match. Should be straightforward and well-localized, so I don't think it should be a problem that there's a lot of unfamiliar code nearby. All changes are on afw branch u/jbosch/ DM-1282 : afw:u/jbosch/DM-1282 % git diff --stat master...u/jbosch/DM-1282 python/lsst/afw/table/Base.i | 8 ++++---- src/table/AliasMap.cc | 37 +++++++++++++++++++++++++------------ src/table/Schema.cc | 10 +++++----- tests/testTableAliases.py | 17 +++++++++++++++++ 4 files changed, 51 insertions(+), 21 deletions(-)
            Hide
            danielw Daniel Wang [X] (Inactive) added a comment -

            Jim,
            I looked at the code, and it seems sensible, but I was wondering if we care about the efficiency of detecting cycles. Are AliasMaps going to be big? I get the impression that cycles are supposed to be an indication of a (hopefully) rare bug state, so it shouldn't matter that we walk through the cycle up to N hops to report a cycle in an N-sized map. Is this true? If so, then we don't care too much about efficiency, but we might put a comment saying that yes, we could get by with less hops if we're willing to do more bookkeeping, but it's not worth it in this case.

            Otherwise, great job, looks pretty clean.

            Show
            danielw Daniel Wang [X] (Inactive) added a comment - Jim, I looked at the code, and it seems sensible, but I was wondering if we care about the efficiency of detecting cycles. Are AliasMaps going to be big? I get the impression that cycles are supposed to be an indication of a (hopefully) rare bug state, so it shouldn't matter that we walk through the cycle up to N hops to report a cycle in an N-sized map. Is this true? If so, then we don't care too much about efficiency, but we might put a comment saying that yes, we could get by with less hops if we're willing to do more bookkeeping, but it's not worth it in this case. Otherwise, great job, looks pretty clean.
            Hide
            jbosch Jim Bosch added a comment -

            Exactly: it's a rare bug state, and I just didn't want it to result in an endless loop. I'll add the comment.

            Show
            jbosch Jim Bosch added a comment - Exactly: it's a rare bug state, and I just didn't want it to result in an endless loop. I'll add the comment.

              People

              Assignee:
              jbosch Jim Bosch
              Reporter:
              jbosch Jim Bosch
              Reviewers:
              Daniel Wang [X] (Inactive)
              Watchers:
              Daniel Wang [X] (Inactive), Jim Bosch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.