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

add nanSafeEqual comparison function to AFW objects

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Won't Fix
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Team:
      Alert Production

      Description

      There are cases where we would like objects that contain floats whose value is NaN. The idea was to add a comparison method bool nanSafeEqual(<type> const & other) const; to AFW objects where if a data member is a float and in the body if this->myFloat != other.myFloat then it would also check to see if this->myFloat is NaN AND other.myFloat is NaN, in which case these two objects would be treated as equivalent.

      This was identified in obs_test/tests/testMetadataObjectAccess.py, which currently works around the problem by testing members of a VisitInfo object directly. Once this is done that test should be updated. Note that writing nanSafeEqual in VisitInfo will require writing nanSafeEqual for some of its data member types as well.

        Attachments

          Issue Links

            Activity

            Hide
            npease Nate Pease [X] (Inactive) added a comment -

            Jim Bosch suggested AlertProduction may be the right team to take this on.

            Show
            npease Nate Pease [X] (Inactive) added a comment - Jim Bosch suggested AlertProduction may be the right team to take this on.
            Hide
            rowen Russell Owen added a comment -

            I'm curious: do we think a method is better or a templated free function? I suppose the method is slightly more convenient, but the free function is arguably less API clutter (since it does not need access to internals).

            Show
            rowen Russell Owen added a comment - I'm curious: do we think a method is better or a templated free function? I suppose the method is slightly more convenient, but the free function is arguably less API clutter (since it does not need access to internals).
            Hide
            gpdf Gregory Dubois-Felsmann added a comment -

            To capture something else from Slack: depending on how these objects are used in the code (e.g., in STL containers or algorithms), a nanSafeLess function may also be needed.

            Show
            gpdf Gregory Dubois-Felsmann added a comment - To capture something else from Slack: depending on how these objects are used in the code (e.g., in STL containers or algorithms), a nanSafeLess function may also be needed.
            Hide
            swinbank John Swinbank added a comment -

            It's hard to imagine this becoming a priority, given that we've been ignoring it these last 3+ years. I'm inclined to close it as “Won't Fix”. Please reopen if you disagree.

            Show
            swinbank John Swinbank added a comment - It's hard to imagine this becoming a priority, given that we've been ignoring it these last 3+ years. I'm inclined to close it as “Won't Fix”. Please reopen if you disagree.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              npease Nate Pease [X] (Inactive)
              Watchers:
              Gregory Dubois-Felsmann, Jim Bosch, John Parejko, John Swinbank, Nate Pease [X] (Inactive), Russell Owen
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.