You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I'm not sure if this is a bug per se, but it feels wrong to me — and I'm open to being wrong about that. I'm hesitant to report it as I'm a new user of arviz, but OTOH I'm an experienced enough python programmer that I thought perhaps I might have something to add. And if I don't, that's OK.)
In short, it seems to me that arviz is using SyntaxWarning in a bunch of places that have nothing to do with syntax, and that UserWarning would be a better choice in those cases.
How I came across this: I just tried to create an autocorrelation plot which, as it happened, consisted of 45 subplots. So I got this warning:
SyntaxWarning: rcParams['plot.max_subplots'] (40) is smaller than the number of variables to plot (45) in plot_autocorr, generating only 40 plots
I can work around it easily, of course, but I'm confused why it's a SyntaxWarning. The python docs say this is the "Base class for warnings about dubious syntax." As far as I can see there's no "dubious syntax" here. Nothing about the syntax of how I asked for this plot to be produced is at fault or needs changing; it's just that I happen to have a Dataset which unfolds to 45 plots.
Shouldn't this be a UserWarning?
It looks like there are 54 instances of SyntaxWarning in the codebase (some in tests). Is it really intentional to use SyntaxWarning in these cases? Or was it just an accidental historical choice by someone which somehow stuck? Or maybe it's some convention I'm not aware of...? I don't see this in matplotlib, for example (but maybe I'm missing something...)
(BTW, ironically, I'm glad it was a SyntaxWarning because I happen to have suppressed UserWarnings in this notebook, and thus wouldn't have noticed that I was only getting 40 plots instead of the expected 45. But I think that's incidental and it's still a good idea to use the appropriate warning type in general... :-) )
The text was updated successfully, but these errors were encountered:
(I'm not sure if this is a bug per se, but it feels wrong to me — and I'm open to being wrong about that. I'm hesitant to report it as I'm a new user of arviz, but OTOH I'm an experienced enough python programmer that I thought perhaps I might have something to add. And if I don't, that's OK.)
In short, it seems to me that arviz is using
SyntaxWarning
in a bunch of places that have nothing to do with syntax, and thatUserWarning
would be a better choice in those cases.How I came across this: I just tried to create an autocorrelation plot which, as it happened, consisted of 45 subplots. So I got this warning:
I can work around it easily, of course, but I'm confused why it's a
SyntaxWarning
. The python docs say this is the "Base class for warnings about dubious syntax." As far as I can see there's no "dubious syntax" here. Nothing about the syntax of how I asked for this plot to be produced is at fault or needs changing; it's just that I happen to have aDataset
which unfolds to 45 plots.Shouldn't this be a
UserWarning
?It looks like there are 54 instances of
SyntaxWarning
in the codebase (some in tests). Is it really intentional to useSyntaxWarning
in these cases? Or was it just an accidental historical choice by someone which somehow stuck? Or maybe it's some convention I'm not aware of...? I don't see this in matplotlib, for example (but maybe I'm missing something...)(BTW, ironically, I'm glad it was a
SyntaxWarning
because I happen to have suppressedUserWarning
s in this notebook, and thus wouldn't have noticed that I was only getting 40 plots instead of the expected 45. But I think that's incidental and it's still a good idea to use the appropriate warning type in general... :-) )The text was updated successfully, but these errors were encountered: