xgi-org / xgi

CompleX Group Interactions (XGI) is a Python package for higher-order networks.
https://xgi.readthedocs.io
Other
185 stars 30 forks source link

Add type hints #409

Open leotrs opened 1 year ago

leotrs commented 1 year ago

There are many benefits to type hints that we can go over our next call. I've been holding off on proposing type hints until now because the main classes were still in flux.

However, I recently found a bug (#406) that is exactly the kind of bug that can be caught early when using type hints. I'm sure there are others we haven't caught yet.

Migrating the entire library to type hints is laborious but I can take on that challenge.

nwlandry commented 5 months ago

I don't know if this would be a bad idea, but the typing module provides support for the @overload decorator which could be used to differentiate between different class names, like Hypergraph and SimplicialComplex for example.