Skip to content

PlaneHistogram: normalise or refuse NumPy integer bin_count and limits #106

Open

Description

@guijacquemet

Context

#104's review found that a caller-built PlaneHistogram may carry a NumPy integer bin_count (or limits). The int64 path is now guarded (5373049): it is taken only for Python ints, so such histograms keep v0.7.0's values, types and refusals. For wide 64-bit ranges, though, that refusal is still a bare OverflowError rather than a clear, coded one.

Proposal

In PlaneHistogram, either convert bin_count and the integer limits to Python int (exact, after a range check), or refuse NumPy integers with a coded error that names the fix. Histograms computed or read by the library already use Python ints (validate_bin_count), so their outputs do not change.

Acceptance

  • A test with np.int64 / np.uint64 inputs: either equal results after conversion, or the coded refusal.
  • No change to any computed histogram (parity table unchanged).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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