aai-institute / aai-institute/pyDVL

Include shape in array types

Open
#541 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Python
Stars
146
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Using [nptyping and beartype](https://github.com/ramonhagenaars/nptyping/blob/master/USERDOCS.md#Quickstart) we can pin down the dimensions that we accept. For instance, the constructor of `ValuationResult` can only accept 1D arrays but we don't enforce that.

Alternatively, [jaxtyping](https://github.com/patrick-kidger/jaxtyping) supports jax, torch and numpy in one go. But python 3.9 is required so we'd have to wait until EOL for 3.8 at the very least.

Are there any other libraries?

Contributor guide

Open the contributing guide

Research direction

Look at the ValuationResult constructor to see how it currently handles arrays. Research nptyping and jaxtyping for shape enforcement. Check Python version constraints and project dependencies. Determine how to integrate a typing library to enforce 1D array dimensions in the constructor.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
backend-api-design, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.