Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature request: strided array support for fill?

Aperta
#331 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cpp
Ambito
data

Direzione di ricerca

Non sono identificati file, test o punti di ingresso. Inizia leggendo le issue #327 e #303, quindi traccia la gestione di fill di boost-histogram per le incompatibilità degli span e gli array di input non densi. Il lavoro sarebbe completo con un design concordato per gli array con stride che supporti campioni scalari ed eviti copie non necessarie dell'input.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

In #327, the bug seems to be that single values are not supported correctly. In https://github.com/scikit-hep/hist/issues/303, scalars are currently not allowed for samples - in working on this, I found that h.fill(0.3, sample=[1, 2], weight=1) is not supported in boost-histogram, due to the spans not matching (may be solvable on the boost-histogram side).

A way to support this easily could be to support strided arrays, like NumPy, Eigen, Boost.MultiArray, etc. all provide. If an array is described by a stride and an offset, then setting that stride to 0 would allow a scalar value without having a scalar datatype. Then there would be half as many items in the fill variant, just arrays, no scalars anymore.

A related issue is that boost-histogram has to copy the input array if it's not already a dense 1D array. If describing an array with a starting pointer, stride, and offset was possible, then this would no longer be necessary, only the datatype would have to match to avoid a copy.

Thoughts?

Lingua principale
C++
Stelle
334
Fork
76
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di boostorg/histogram

Tutte le issue di boostorg/histogram

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.