question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I would suggest (though it is again stylist and not required) to start adding type hints as it is being moved into the standard python world. This helps many code editors with completion and allows for robust tests using type checkers such as mypy.

Though this is not my field, I can see this code as being a framework where other researchers import it and build future models, thus type hinting would keep them from stumbling over the various inputs and outputs related to theano and pymc3 which are vital to the functionality of the code. I note that neither of these frameworks are typed, but the size of exoplanet is manageable enough (with lots of contributors) to slowly add this in.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dfmcommented, May 20, 2021

Great - yes, it really is awesome for code completion, etc. I have a few other projects (that don’t depend on numpy) where I’ve loved using Python typing.

I’m going to remove the joss label on this issue and leave it open as a future feature request. Hopefully sooner rather than later!

1reaction
dfmcommented, May 20, 2021

@grburgess: If you don’t mind, I propose splitting this into two issues: (1) Fill in some missing docstrings and (2) type annotations.

I would argue that type hinting is out of scope for now since the underlying libraries (numpy and theano/aesara) only have very limited support for typing at the moment (e.g. https://github.com/numpy/numpy/issues/7370 & https://github.com/pymc-devs/aesara/issues/200). Since these are the main return types of all of the exoplanet methods, I’ve found that the added benefit is currently somewhat limited. In the long run, I would very much like to add this so I’m following the conversations closely! What do you think about that @grburgess?

Read more comments on GitHub >

github_iconTop Results From Across the Web

typing — Support for type hints — Python 3.11.1 documentation
This module provides runtime support for type hints. The most fundamental support consists of the types Any , Union , Callable , TypeVar ......
Read more >
Type Hinting - Real Python
In this lesson, you'll learn about type hinting in Python. Type hinting is a formal solution to statically indicate the type of a...
Read more >
Type hinting in PyCharm - JetBrains
To add a type hint, follow these steps: · Select a code element. · Press Alt+Enter . · Select Add type hint for...
Read more >
Type hints cheat sheet - mypy 0.991 documentation
Type hints cheat sheet#. This document is a quick cheat sheet showing how to use type annotations for various common types in Python....
Read more >
12 Beginner Concepts About Type Hints To Improve Your ...
Type hints are performed using Python annotations (introduced since PEP 3107). They are used to add types to variables, parameters, function arguments as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found