NRCan / geo-deep-learning

Deep learning applied to georeferenced datasets
https://geo-deep-learning.readthedocs.io/en/latest/
MIT License
149 stars 49 forks source link

utils.py/get_key_def(): allow "expected_type=str" even with "to_path=True" param #484

Closed remtav closed 1 year ago

remtav commented 1 year ago

inference_segmentation.py: restore str as expected type to better reflect documentation

Documentation for "expected_type" in get_key_def(): :param expected_type: (type) type of the expected variable.

To me, this suggests that the input variable must bear this "expected_type". It feels confusing to expected a type that is actually one that is assigned during the get_key_def() function, "Path" in this case. @CharlesAuthier is this slight retroactive change ok to you?

CharlesAuthier commented 1 year ago

I dont care but change the test too if you want to pass the check

CharlesAuthier commented 1 year ago

https://github.com/NRCan/geo-deep-learning/blob/develop/tests/utils/test_utils.py#L54

CharlesAuthier commented 1 year ago

btw can you add a test to check that pls