Pometry / Raphtory

Scalable graph analytics database powered by a multithreaded, vectorized temporal engine, written in Rust
https://raphtory.com
GNU General Public License v3.0
336 stars 54 forks source link

Add Python type stubs #1682

Closed hallofstairs closed 2 months ago

hallofstairs commented 3 months ago

What changes were proposed in this pull request?

This PR introduces an automated process (gen-stubs.py) for generating Python type stubs (__init__.pyi, algorithms/__init__.pyi, graph_gen/__init__.pyi, graph_loader/__init__.pyi, graphql/__init__.pyi, vectors/__init__.pyi) for Raphtory. These stubs provide type information for the Python interface of Raphtory, enhancing type checking and IDE support.

Also, a make stubs command was added to the Makefile to streamline the stub generation process, and a mypy test was implemented to verify the general correctness of the generated stubs.

Why are the changes needed?

The addition of auto-generated Python type stubs will:

Does this PR introduce any user-facing change? If yes is this documented?

This PR does not introduce any functional changes to the library, but it does improve the user experience for developers using type-aware tools. This change is self-documenting, as the type stubs themselves serve as documentation.

How was this patch tested?

Are there any further changes required?