volcan01010 / bng

Python functions to convert osgb36 (EPSG:27700) coordinates to/from 4, 6, 8, or 10 figure grid references
GNU General Public License v3.0
9 stars 4 forks source link

Add type hints to function signatures #3

Open volcan01010 opened 2 years ago

volcan01010 commented 2 years ago

Summary

As a BNG user, I want type hints on the function signatures so that my IDE can tell me what types to expect.

Description

Adding type hints (https://realpython.com/lessons/type-hinting/) helps IDEs with autocompletion and gives users information about what inputs they are required to provide.

Acceptance criteria

Jukelyn commented 2 years ago

Did you want just those two functions to have type hints?

volcan01010 commented 2 years ago

Yes, please. Those are the only ones that end users will interact with.

On Mon, 18 Jul 2022, 08:54 Mehraz Ahmed, @.***> wrote:

Did you want just those two functions to have type hints?

— Reply to this email directly, view it on GitHub https://github.com/volcan01010/bng/issues/3#issuecomment-1186881919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC33O27VUO7EZ6OYKXLQYCTVUUERRANCNFSM53RL2BHQ . You are receiving this because you authored the thread.Message ID: @.***>

volcan01010 commented 2 years ago

Also, don't worry about backwards compatibility too much. The next release can be for Python >= 3.7.

On Mon, 18 Jul 2022, 08:54 Mehraz Ahmed, @.***> wrote:

Did you want just those two functions to have type hints?

— Reply to this email directly, view it on GitHub https://github.com/volcan01010/bng/issues/3#issuecomment-1186881919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC33O27VUO7EZ6OYKXLQYCTVUUERRANCNFSM53RL2BHQ . You are receiving this because you authored the thread.Message ID: @.***>

Jukelyn commented 2 years ago

I've done them and they work for newer Python 3 versions! commit above e714258

volcan01010 commented 2 years ago

Thanks!

We need to specify the type for figs as well.

Also, can you please update setup.py to specify Python 3.7 or greater?

John

On Tue, 19 Jul 2022, 05:28 Mehraz Ahmed, @.***> wrote:

I've done them and they work for newer Python 3 versions! commit above e714258 https://github.com/Jukelyn/bng/commit/e714258e799c82779c82b12a1a681dff64d9a4e6

— Reply to this email directly, view it on GitHub https://github.com/volcan01010/bng/issues/3#issuecomment-1188584315, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC33O24RBCBCIAONR6BVHWDVUYVIDANCNFSM53RL2BHQ . You are receiving this because you authored the thread.Message ID: @.***>

Jukelyn commented 2 years ago

Done! https://github.com/volcan01010/bng/commit/418f1f03a256bff4d4a8095468d47252bf797b67