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

Slit resolution calculation fails for q_length=0 and small q_width.

Aperta
#697 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start with resolution.py and inspect the li == 0 slit-resolution calculation described in the issue, especially how q_edges and wi determine the weights. Compare behavior as q_width becomes smaller than the q spacing, and check the analogous q_width=0 case. Decide whether to correct the calculation or disallow the configuration; done means small-width cases no longer produce incorrect weights or are explicitly rejected.

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

Descrizione

SasModels Infrastructure

The following comment will be added to resolution.py (#533):

elif li == 0:
    in_x = 1.0 * ((q_calc >= qi-wi) & (q_calc <= qi+wi))
    abs_x = 1.0*(q_calc < abs(qi - wi)) if qi < wi else 0.
    # TODO: need pixel fraction for the boundary pixels
    # Diff q_edges in the expression below gives the pixel width in
    # q. As wi drops below the width of a single pixel, the
    # numerator stays the same but the denominater gets smaller, leading
    # to ever increasing weights. We can't see this in SasView since
    # it explicitly excludes q_length < 10 q_width.
    weights[i, :] = (in_x + abs_x) * np.diff(q_edges) / (2*wi)

We should either fix the code or disallow this configuration of slits. As noted, SasView forces q_length > 10 q_width.

For q_width large relative to the q spacing the issue is not significant.

The same issue doesn't appear for q_width=0 and q_length small even though it uses a similar diff(u_edges) / length construction.

Lingua principale
Python
Stelle
23
Fork
32
Merge medio
7g 20h
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 SasView/sasmodels

Tutte le issue di SasView/sasmodels

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.