Skip to content

Binning precision bug #1

Description

@kevinTWD

I think the offset in sort method should be added inside int(...) to correctly round ('floor', in fact) to the bin index. The current calculation is mathematically less precise, although it could be correct in many cases.

So the correction would be replacing

x = int(_[-3]/bin_interval) + offset
y = int(_[-2]/bin_interval) + offset
z = int(_[-1]/bin_interval) + offset

by

x = int(_[-3]/bin_interval + offset)
y = int(_[-2]/bin_interval + offset)
z = int(_[-1]/bin_interval + offset)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions