PyElastica
PyElastica copied to clipboard
Type-hinting elastica
#255
Policy
- The entire purpose of
type-hintingpython library is to enhance the readability and to reduce ambiguity, not to increase the codebase.- Often if the function is writen to be generic, correctly hinting to satisfy
mypycan easily become cumbersome task. (https://www.reddit.com/r/Python/comments/10zdidm/why_type_hinting_sucks/) - If that is the case, simply put
Anyor# type: ignoreand we can discuss further during review stage.
- Often if the function is writen to be generic, correctly hinting to satisfy
Common Types Aliases
Any alias not listed here are subject to change in the future. included in
elastica/typing.py
-
SystemType: any generic object type for simulator (i.e.Rod,RigidBody, etc.) -
SystemCollectionType: object collection (i.e.BaseSystemCollectionor simulator that user defines) -
OperatorType: any genericstepused in timestepper -
SteppersOperationstype: collection ofOperatorTypeused to define specific timestepper
Note: Casting
- For now
- Use
np.floatingfor any float typing - Use
intfor any integer typing
- Use
Tasks (blocked by:)
- [x] Rod modules
elastica/rod#341 - [x]
elastica/timestepper#372 @skim0119- [x] #372
- [x] #373
- [ ]
elastica/memory_block@armantekinalp - [ ]
elastica/rigid_body@sy-cui - [ ]
elastica/mesh@Ali-7800 - [ ]
elastica/module@skim0119- [x] #379
- [ ] #382
- [ ]
examples - [ ] ....
Useful Links
- https://peps.python.org/pep-0544/