Skip to content

[ENH] Type hints for primitives and string arguments #1454

Open
@TonyBagnall

Description

@TonyBagnall

Describe the feature or idea you want to propose

we would like to increase the use of type hints, and a good first issue is to add them for the simplest case when arguments are primitives (int, float, bool) or strings. Pick a package, look through the code and add type hints. Just for primitives for now, more complex types need a bit of thought. Many have npt.ArrayLike types, but we have not decided on standardising on that, so leave these alone. Dont feel you have to do them all, this is a good first issue to get you started.

Describe your proposed solution

for example, the constructor for the anomaly detection algorithm STRAY has these type hints

    def __init__(
        self,
        alpha: float = 0.01,
        k: int = 10,
        knn_algorithm: str = "brute",
        p: float = 0.5,
        size_threshold: int = 50,
        outlier_tail: str = "max",
    ):

but the segmentation algorithm CLASP does not

def _is_trivial_match(candidate, change_points, n_timepoints, exclusion_radius=0.05):
    """Check if a candidate change point is in close proximity to other change points.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature, improvement request or other non-bug code enhancementgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions