Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

nanobind: Atom.GetNeighbors()[i] and Atom.GetBonds()[i] index the whole molecule

Offen
#9,645 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
cpp, python
Bereich
api

Rechercherichtung

Start by running the provided nanobind reproduction for Atom.GetNeighbors() and Atom.GetBonds(), then trace the bindings for these two Atom methods and compare their indexed behavior with iteration and the boost output. Done means indexed access returns the same neighbor and bond sequence as iteration under nanobind, with regression coverage if the relevant binding tests are found.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

Describe the bug
With nanobind, indexing Atom.GetNeighbors() or Atom.GetBonds() returns the wrong atoms/bonds: seq[i] gives the molecule's atom/bond i instead of the i-th neighbour/bond.

To Reproduce

from rdkit import Chem, rdBase

print(rdBase.rdkitVersion, rdBase._wrapperType)

mol = Chem.MolFromSmiles("CCNO")
atom = mol.GetAtomWithIdx(2)
nbrs = atom.GetNeighbors()

print("neighbours iterated:", [n.GetIdx() for n in nbrs])
print("neighbours indexed: ", [nbrs[i].GetIdx() for i in range(len(nbrs))])

bonds = atom.GetBonds()
print("bonds iterated:", [b.GetIdx() for b in bonds])
print("bonds indexed: ", [bonds[i].GetIdx() for i in range(len(bonds))])

nanobind:

2026.09.1b1 nanobind
neighbours iterated: [1, 3]
neighbours indexed:  [0, 1]
bonds iterated: [1, 2]
bonds indexed:  [0, 1]

boost:

2026.03.6
neighbours iterated: [1, 3]
neighbours indexed:  [1, 3]
bonds iterated: [1, 2]
bonds indexed:  [1, 2]
Vorherrschende Sprache
HTML
Sterne
3.6k
Forks
1.1k
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
36

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rdkit/rdkit

Alle Issues in rdkit/rdkit

Ähnliche Issues

Weitere Issues zu Backend & API Design

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.