Verbose Information on TypeError runtime crashes?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Non sono indicati file, test o punti di ingresso. Inizia individuando dove viene prodotto il testo del TypeError di conversione di PyArray, quindi determina se i parametri di tipo e i nomi degli argomenti sono disponibili in quel punto; il lavoro sarà completato quando sarà definito e testato un approccio per fornire il contesto aggiuntivo richiesto senza un costo di esecuzione non specificato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Thank you for pyo3.
Using pyo3, when my python code sends the wrong shape (can typically happen given python's dynamic typing during any development work) I get a python backtrace going down to my line of code calling into my rust, and a text error description like:
TypeError: 'float64' object cannot be converted to 'PyArray<T, D>'
Is there a more verbose mode to pyo3 runtime for cases like this?
Of course if my dev workflow is linear enough, I know I should check my types at that line and have good context in mind for quickly resolving it even without re-running with try-except for logging more details.
However it would be nice to have more information already in the error description if possible:
- What are the type values of
TandD? - Which function argument is the error arising for?
Of course, user code can always try-except the offending python call and we can work to reproduce that crash in repeat runs, even if it's outside the development cycle. But having more information by default provides more peace of mind knowing that before you have managed to reproduce you have some more details than the line of user code. All-in-all this is an enhancement which some may object if it adds runtime cost, especially for release builds.
Consider that when we expose rust code to python, some python developers would much appreciate knowing more about the expected types than those developers who understand pyo3 or can directly work with the rust code.
- Lingua principale
- Rust
- Stelle
- 1.4k
- Fork
- 141
- Merge medio
- 16m
- PR unite (30g)
- 3
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 PyO3/rust-numpy
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
PyO3/rust-numpy#565 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
PyO3/rust-numpy#563 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
PyO3/rust-numpy#557 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
PyO3/rust-numpy#547 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 20/100
PyO3/rust-numpy#535 ·
Tutte le issue di PyO3/rust-numpy
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
nautechsystems/nautilus_trader#5095 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
stellar/rs-soroban-env#1739 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug good first issue package: quic
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100