skpro icon indicating copy to clipboard operation
skpro copied to clipboard

Allow scalar distributions to accept vector inputs

Open Aymuos22 opened this issue 3 weeks ago • 0 comments

Summary

  • Allow scalar (0‑D) distributions to accept vector inputs by relaxing the coercion helpers so they no longer broadcast every input to shape (), while still returning scalars for scalar calls.
  • Adjust the boilerplate to only unwrap true 0‑D numpy outputs, ensuring vectorized results remain arrays.
  • Add regression tests for scalar Normal and Poisson showing that pdf/log-pdf/cdf (and pmf/log-pmf) now work on numpy arrays without manual loops.

Testing

  • pytest skpro/distributions/tests/test_base_scalar.py

Aymuos22 avatar Dec 07 '25 20:12 Aymuos22