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

SCRIP 0/360 seam duplicates nodes, giving euler_characteristic = 1 on a closed sphere

Aperta
#1,782 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
numpy, python
Ambito
backend, data

Direzione di ricerca

Start by running the provided MCVE with the SCRIP fixtures under test/meshfiles/scrip and compare it with Grid.from_healpix(3). Trace the SCRIP reader reached through ux.open_grid to its coordinate deduplication logic. Done means 0/360 seam nodes are merged and both listed closed meshes report Euler characteristic 2 without breaking the HEALPix control.

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

Descrizione

Version

2026.9.0 (and main)

How did you install UXarray?

Source

What happened?

A closed global SCRIP mesh reports euler_characteristic = 1 instead of 2.

SCRIP files store corner longitudes in 0..360 and include both endpoints of the seam: outCSne8 has 30 corners at lon=0 and 30 at lon=360. Those are the same meridian, but the reader's dedup compares (lon, lat) pairs literally, so the seam gets two sets of nodes and the mesh is topologically split along it.

mesh duplicate node coords V E F χ
outCSne8 15 407 790 384 1
ne30pg2 119 21,727 43,326 21,600 1
HEALPix z3 (control) 0 770 1,536 768 2

The HEALPix control has no duplicates and gives the right answer, which locates the problem in the SCRIP path rather than in the Euler computation.

Both meshes are reported as closed: true, so a caller gets a closure verdict that disagrees with the characteristic printed beside it.

What did you expect to happen?

χ = 2 for a closed sphere, and nodes on the 0/360 seam merged.

Can you provide a MCVE to reproduce the bug?
import numpy as np, uxarray as ux

for name, path in [
    ("outCSne8", "test/meshfiles/scrip/outCSne8/outCSne8.nc"),
    ("ne30pg2", "test/meshfiles/scrip/ne30pg2/grid.nc"),
]:
    g = ux.open_grid(path)
    V, E, F = int(g.n_node), int(g.n_edge), int(g.n_face)
    nodes = np.stack([np.round(g.node_lon.values, 9),
                      np.round(g.node_lat.values, 9)], 1)
    dupes = V - len(np.unique(nodes, axis=0))
    print(f"{name}: V={V} E={E} F={F} chi={V-E+F} duplicate_nodes={dupes}")

g = ux.Grid.from_healpix(3)          # control: no duplicates
V, E, F = int(g.n_node), int(g.n_edge), int(g.n_face)
print(f"healpix3: V={V} E={E} F={F} chi={V-E+F}")
Note

Same class as #1692 (coincident nodes), but the trigger here is specifically the 0/360 seam in SCRIP rather than general coincidence, and it reproduces on the meshes already in test/meshfiles. Unchanged by #1775 — that PR swaps the dedup algorithm but compares the same (lon, lat) pairs, so it inherits the behaviour rather than causing it.

Lingua principale
Python
Stelle
228
Fork
55
Merge medio
4g 23h
PR unite (30g)
16

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 UXARRAY/uxarray

Tutte le issue di UXARRAY/uxarray

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.