Introduce Pydantic
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Read the dataclasses introduced before this issue and review the proposed follow-up in #172, then identify each dataclass import and its use. Check how Pydantic dataclasses behave with the project's existing types and tests; the issue defines done as replacing the standard dataclasses and gaining useful runtime type errors without affecting correctness.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I introduced dataclasses to replace Python dict in order to leverage more the static analyzer.
Now that they are in place (or even better, after #172) we could take one step more and make them pydantic.dataclasses.
They are designed as a drop-in replacement of standard library ones, and they perform a type check also at runtime, giving more helpful errors in case of issues.
Possible cons all stem from the consideration that "it is a further dependency, better one less than one more", but this consideration underlying motivations are mainly:
- reliability, but
pydanticis reliable, since it is used by big Python packages, and backed by known sponsors; so it might be not as reliable as NumPy, but reliable enough - extra complexity, but being a drop-in replacement, it should not require extra effort than usual
dataclass, we just need to change imports
Another concern might be the performance deterioration, but we never use dataclasses in performance critical code (or Python constructs in general), so this really does not apply.
On the other hand, the code where dataclasses are used is really a complex part, so the benefit of improving runtime errors is possibly huge.
Runtime errors are not needed if we have static analysis always in place, but I am rather convinced that there are several occasions in which static analysis is not really performed (including during development).
In this respect, more about this in #178.
- Lingua principale
- Python
- Stelle
- 13
- Fork
- 9
- Merge medio
- 6g 16h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NNPDF/eko
-
Update yaml reader in rustApertarust
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
physics
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
physics
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Improve Python workflowApertabenchmarks
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Centralize Maturin workflowsApertabenchmarks rust
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
ready-for-agent
Difficoltà 1/5 1-3 ore Idoneità per principianti 79/100
gregwebs/agent-vm-images#216 ·
I maintainer di solito rispondono entro 1 giorno
-
Layout accepts a step threshold of 0 or less, then in-toto-verify crashes with StopIterationForse già presa @BahaaMattar l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
gcivil-nyu-org/team5-mon-fall26#145 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gcivil-nyu-org/team3-mon-fall26#156 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
antlr/grammars-v4#5220 ·
I maintainer di solito rispondono entro 1 giorno