Skip to content

[ENH] Remove redundant scipy method overrides in Skellam and FDist distributions #944

@ANANYA542

Description

@ANANYA542

Describe the maintenance issue

Skellam and FDist both extend _ScipyAdapter and implement _get_scipy_param() correctly, but then manually override _pmf/_pdf, _cdf, _ppf, _mean, and _var with logic that is identical to what the adapter already provides natively.
Since _get_scipy_param() is already implemented correctly in both files, the adapter's inherited methods handle all routing automatically — exactly as they do for Normal, Cauchy, Exponential, and every other adapter-based distribution in the library. These manual overrides are pure duplication, adding roughly 25 redundant lines per file with no functional difference.
Affected files:
skpro/distributions/skellam.py
skpro/distributions/f_dist.py
The fix is to delete the redundant _pmf/_pdf, _cdf, _ppf, _mean, and _var overrides from both files and let _ScipyAdapter handle them natively as it was designed to. I validated this locally by removing the overrides and confirming the adapter computes all methods correctly without them.
A screenshot of the local validation output is attached below.
Image

If this looks good I am happy to open a PR cleaning up both files.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions