Skip to content

Clarify role of precision when specifying floats to subspace #847

@sadielbartholomew

Description

@sadielbartholomew

From #799 we have seen that specifying a float data value to reference a coordinate value to a method that attempts to match it to some data in the (meta)data, such as subspace, may fail due to the natural unreliability of floating point precision due to rounding, e.g where matching to 0.123 fails but cf.isclose(0.123) will pass.

This isn't covered at all in the documentation, but can mean that users get unexpected results, like with that issue. So it is important to advertise that it is safest to use methods such as isclose when specifying float values if there is reasonable chance for rounding mismatch.

I recommend we clarify this, in (at least) two locations:

  • in the docstrings of methods where float data values can be provided, which is at least subspace but perhaps includes other methods (to be investigated);
  • in the tutorial, as (I am thinking) a warning box with an example higlighting an example such as that from the linked Issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions