pymc-devs/pymc

Replace `assert` checks in `logprob.scan` with real error handling

Offen

#7.780 geöffnet am 09.05.2025

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Python (1.902 Forks)batch import
enhancementshackathonhelp wantedneeds infopytensor

Repository-Metriken

Stars
 (7.926 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 11T) (7 gemergte PRs in 30 T)

Beschreibung

Description

There are two annoying assert checks that I commonly run up against when writing time series models here and here. Other users are hitting them too, see for example here.

It would be much nicer to have a real error message that explains what has gone wrong and why, or at least gives some information about which parts of the graph are going wrong.

I'm not 100% sure how one ends up hitting these asserts, so I tagged this with needs info. It seems to have to do with having multiple outputs from the scan inner function in a custom dist.

Contributor Guide