Skip to content

Replace "validate" functions with nan for distributions #9

@ostromia

Description

@ostromia

Instead of raising exceptions within the "validate" functions when invalid arguments are used with the distribution functions, the nan value should be returned.

The reasoning behind this decision is to support large scale operations on arrays.

This makes identifying invalid arguments much more difficult, as the current "validate" functions provide detailed descriptions for why the arguments are rejected, so a more effective solution is welcome for discussion.

Example "validate" function, where each distribution function has its separate "validate" function:
https://github.com/berkay-yalin/promethium/blob/668cc829dfe48595d1f0672f35aa20d427f48d3b/src/promethium/distributions/binomial.py#L6-L18

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