PEtab-dev / PEtab-dev/libpetab-python

Improve error handling in Problem.from_yaml - format_version

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

Dieses Issue hat noch niemand übernommen.

validation
Vorherrschende Sprache
Python
Sterne
18
Forks
9
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Missing format_version in the yaml file should provide a proper error message instead of just KeyError:

--> 250 if yaml_config[FORMAT_VERSION] not in {"1", 1, "1.0.0", "2.0.0"}:
    251     raise ValueError("Provided PEtab files are of unsupported version "
    252                      f"{yaml_config[FORMAT_VERSION]}. Expected "
    253                      f"{format_version.__format_version__}.")
    254 if yaml_config[FORMAT_VERSION] == "2.0.0":

KeyError: 'format_version'

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Start at the Problem.from_yaml entry point and reproduce the failure with a YAML file missing format_version. Trace the existing version validation and error handling, then make the missing field produce a proper error instead of KeyError; done means the reported case has a clear error and the relevant checks pass.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
data
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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