Open AFg6K7h4fhy2 opened 1 week ago
From DHM comments in #35 :
(groups, (str, list), "groups"),
(variables, (str, list), "variables"),
(dimensions, (str, list), "dimensions"),
Again, I think this can be duck-typed, especially as you're going to call ensure_listlike on them
Why error if the user provides a numpy.array of strings, for instance?
and
forecasttools.validate_iter_has_expected_types(groups, str, "groups")
forecasttools.validate_iter_has_expected_types(variables, str, "variables")
forecasttools.validate_iter_has_expected_types(
dimensions, str, "dimensions"
)
Again, this feels like unnecessarily strong typing for a duck-y language, but I am less opposed here than I am above.
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 inadd_time_coords_to_idata_dimension
,DHM suggests adhering to Duck typing.