Skip to content

Duck-Typing In Certain Functions #41

@O957

Description

@O957

While Python does not require strict typing and while strict typing is useful in certain instances, there are some instances within forecasttool-py where the author's strict-typing approaches are overly pedantic. As a replacement for these situations, such as in add_time_coords_to_idata_dimension,

inputs = [
        (idata, az.InferenceData, "idata"),
        (group, str, "group"),
        (variable, str, "variable"),
        (dimension, str, "dimension"),
        (time_step, timedelta, "time_step"),
    ]
for value, expected_type, param_name in inputs:
    forecasttools.validate_input_type(
        value=value, expected_type=expected_type, param_name=param_name
    )

DHM suggests adhering to Duck typing.

Metadata

Metadata

Assignees

Labels

Low PriorityA task that is of lower relative priority.enhancementEnhancement to existing feature or aspect of the project.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions