JaxGaussianProcesses / GPJax

Gaussian processes in JAX.
https://docs.jaxgaussianprocesses.com/
Apache License 2.0
436 stars 51 forks source link

Add generic typing information for gps objects #425

Closed frazane closed 9 months ago

frazane commented 9 months ago

Type of changes

Checklist

Description

This PR improves the static typing information using generic types. For now I only focused on Prior and Posterior objects since they are the most important. I also tried to work out how to do it for kernels (with compute_engine as a generic) but the fact that we use a default with dataclasses is making it very hard (see https://peps.python.org/pep-0696/).

thomaspinder commented 9 months ago

What's happened to codecov?!

frazane commented 9 months ago

What's happened to codecov?!

The parts of code in the TYPE_CHECKING blocks are not executed at runtime and result as "not tested" by coverage.py. I just added a configuration in the pyproject.toml in order to exclude those blocks from the reports 👍