idaholab / MontePy

MontePy is the most user friendly Python library (API) to read, edit, and write MCNP input files.
https://www.montepy.org/
MIT License
32 stars 6 forks source link

Implement the use of function annotations #91

Open MicahGale opened 2 years ago

MicahGale commented 2 years ago

The following discussion from !37 should be addressed:

Tasks:

MicahGale commented 2 years ago

In GitLab by @tjlaboss on Jul 21, 2022, 14:50

Opinion: Type enforcement/coercion should not be done here. Coercion can still be used on a case-by-case basis, not part of a broad function annotation and type hinting update.

If there is a function annotation style guide for mcnpy, I can probably tackle the implementation between other tasks.

MicahGale commented 2 years ago

So are you in favor of just using typing notations as purely a developer/ user assistant?

Any good resources for developing a style guide?

MicahGale commented 2 years ago

marked the checklist item @MicahGale started a discussion: as completed

MicahGale commented 1 year ago

https://github.com/Instagram/MonkeyType This tool that @tjlaboss found could help with automating most of the work.

MicahGale commented 1 year ago

Oh right this issue is a little different now since the introduction of make_prop_pointer and make_prop_value_node has removed most of the property boiler plate type enforcement.

I think we are now at a stage that using this as a type enforcement scheme is unnecessary, but is just syntax sugar to help make it more usable for the end user.