Skip to content

Add type hinting for public functions. #476

@xingjian-zhang

Description

@xingjian-zhang

Is your feature request related to a problem? Please describe.
Currently, our codebase does not contain type hinting for some public functions such as save_task_node_regression :

gli/gli/io/node_task.py

Lines 5 to 17 in 2302ac0

def save_task_node_regression(name,
description,
feature,
target,
train_set=None,
val_set=None,
test_set=None,
train_ratio=0.8,
val_ratio=0.1,
test_ratio=0.1,
num_samples=None,
task_id=1,
save_dir="."):

It is highly important for every public functions to have explicit type hinting to ease the maintenance and increase readability.

Describe the solution you'd like
Add type hinting to every public functions that could potentially called by a user.
It should be straightforward to add type hinting given we already specify argument types in most docstrings, though we may need to consider if the docstrings have any misspecification.

Additional context
PEP 484

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions