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

context.entities should be keyed based on the entity long name

Offen
#80 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
python
Bereich
backend

Rechercherichtung

Beginne mit der Prüfung des Datentyp-zu-Modalität-Mappings in context.py und der im Issue erwähnten schema.objects.entities-Daten. Lies den Ansatz von PR #74 mit BIDSSchemaAdapter und untersuche, wie das Dataset-Objekt ihn enthalten könnte. Als erledigt gilt die Änderung, wenn Entity-Schlüssel lange Namen wie "subject" statt kurze Namen wie "sub" verwenden und das Schema-Mapping über die relevanten privaten Funktionen wiederverwendet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Noticed while reviewing #71: entities["sub"] is populated, rather than entities["subject"].

The schema consistently uses the long name, not the short name. This means we'll need to look up the mapping from schema.objects.entities, and we should probably do that once per schema.

I recently introduced https://github.com/childmindresearch/bids2table/pull/74 as a method for mapping schema specifiers onto an adapter class that extracts the bits the library actually needs. The basic idea is:

SchemaSpec: ty.TypeAlias = Namespace | os.PathLike[str] | str | None

def load_bids_schema(spec: SchemaSpec = None) -> BIDSSchemaAdapter: ...

def public_function(*args, schema: SchemaSpec = None) -> ReturnType:
    return _private_function(*args, adapter=load_bids_schema(schema))

def _private_function(*args, adapter: BIDSSchemaAdapter) -> ReturnType: ...

BIDSSchemaAdapter is never exposed as a public API, but is able to be passed around cheaply throughout private functions.

We can start by replacing the datatype-to-modality map:

https://github.com/bids-standard/python-validator/blob/e85ad33d52bb113952b0e45a11e0051fe870917a/src/bids_validator/context.py#L54-L63

And a short-to-long entity name map would be good to have.

Need to consider how to actually thread this through. I suspect we attach the adapter to the Dataset object, so it's always available to the individual context.

Vorherrschende Sprache
Python
Sterne
10
Forks
7
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

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 bids-standard/python-validator

Alle Issues in bids-standard/python-validator

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

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