splinepy icon indicating copy to clipboard operation
splinepy copied to clipboard

*WIP* Inline type hints

Open clemens-fricke opened this issue 1 year ago • 2 comments

!!! Currently no type hints !!!

I have started with the example overall similar to https://github.com/tataratat/gustaf/pull/197 to enable type hint tracing also in the examples. Example tracing with run_all_examples is not possible :(

Also, I wanted to enable us to run the examples in CI/CD to also check them.

Overview

Similar to #381 but not in stub-files but with inline type hinting.

Using https://github.com/dropbox/pyannotate to trace tests to automatically detect the types enables us to add type hints quicker.

Addressed issues

  • Type hints are available
  • Autocomplete in IDE is better
  • During further development adding type hints is easier than using stub-files
  • Secondary benefit, check which functions are called during tests and examples

Checklists

  • [ ] Documentations are up-to-date.
  • [ ] Added example(s)
  • [ ] Added test(s)

Dependencies

  • https://github.com/tataratat/gustaf/pull/197 -> Due to using the gustaf setting DEFAULT_OFFSCREEN

clemens-fricke avatar Feb 29 '24 17:02 clemens-fricke

I have now tried to add the inline annotations traced from just the tests (using pytest-annotate pytest plugin). This is not as trivial as I had hoped. Basically everything exploded and after fixing some format issues, I have a lot of circular dependency errors. I think it might be good if we look into this during the upcoming HackDayz.

clemens-fricke avatar Feb 29 '24 17:02 clemens-fricke

I have now tried to add the inline annotations traced from just the tests (using pytest-annotate pytest plugin). This is not as trivial as I had hoped. Basically everything exploded and after fixing some format issues, I have a lot of circular dependency errors. I think it might be good if we look into this during the upcoming HackDayz.

Can you post some circular dependency errors?

j042 avatar Mar 05 '24 14:03 j042

Closing this for now. Feel free to reopen

j042 avatar Jun 29 '24 10:06 j042