fmaussion / salem

Add geolocalised subsetting, masking, and plotting operations to xarray
http://salem.readthedocs.io
Other
186 stars 44 forks source link

feat(types): Add type hints and code optimizations #248

Open benatouba opened 4 months ago

benatouba commented 4 months ago

DISCLAIMER: I know this is a lot of changes and might be rejected or a lot of changes requested. But I like to work with typed functions much better and think someone might also benefit from this. This will definitely require additional changes in the future, but I feel it could be a start. All tests passed locally (no google API key).

Python3.8 is almost end-of-life and backwards compatibility to versions before type hints is not a priority any more.

This commit is a start and by no means complete or correct for all instances.

Furthermore, I included code optimizations. These mainly regard raising of exceptions, pytest style tests and some minor refactoring.

fmaussion commented 4 months ago

Thanks! I'm away on leave starting tomorrow so I wont have a look until later in the summer, but a few things already:

benatouba commented 4 months ago

Ok. I will split this up into multiple, well organized commits. However, this will only happen in a couple of weeks.