Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

More precise mean_var for non-Dask dense arrays?

Open
#128 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start by reading src/fast_array_utils/stats/_mean_var.py around line 40 and the change described in #127. Compare the dense-in-core, Dask, and sparse-in-core paths, focusing on float32 versus float64 exponentiation and temporary allocations. Done means selecting and documenting one precision strategy for dense arrays, with its memory and performance trade-offs clear.

Written by the indexing model from the issue text.

Description

type: numpy/scipy

In #127, I changed how mean_var works just for Dask:

https://github.com/scverse/fast-array-utils/blob/940727fe307d7c6e0a3d0a2b8907860a285a11c0/src/fast_array_utils/stats/_mean_var.py#L40

We already have a custom numba implementation for sparse-in-core which operates on float64s, but doesn’t convert everything at once.

We could make the change also affect dense-in-core. Should we

  • leave things as they are and keep power for float32 dense arrays as float32? It takes less space and is faster, but less precise.
  • do exponentiation in 64 bit everywhere? this would allocate an exponentiated array of the input size in 64 bit, but I guess if people’s machines can handle a temporary 2n (prod(shape)×32×2), they can handle a temporary 3n (prod(shape)×32 + prod(shape)×64)?
  • implement a custom numba implementation for dense-in-core as well?
Dominant language
Python
Stars
15
Forks
5
Avg merge
10h 24m
Merged PRs (30d)
12

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from scverse/fast-array-utils

All issues in scverse/fast-array-utils

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.