Skip to content

Floating point equality in tests #38

@stsievert

Description

@stsievert

When I ran the tests, a couple tests failed because of floating point equality. The numbers were almost the same, but very slightly different. e.g., in test_msd_ratio

    assert ft.msd_ratio(dframe, 1, 9) == 0.09708430006771959
#   assert 0.09708430006771954 == 0.09708430006771959

This is only present in test_features.py in

  • test_msd_ratio
  • test_alpha_calc
  • test_gyration_tensor
  • test_boundness
  • test_efficiency

In all of these, static floating point values are on one side of the equality check ==.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions