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
The way warnings are raised is not consistent throughout the codebase.
Some things I noticed:
_elastic_net_regression.py uses both from warnings import warn (in combination with calls to warn(...)) and import warnings (in combination with warnings.warn(...)).
Sometimes, UserWarning is explicitely passed as category keyword argument, sometimes it is left out (as UserWarning is the default value).
The warnings raised in the Transformer classes lack the trailing period.
The warnings raised in the Transformer class generally talk about columns even when there could be just one column that is mentioned. Saying column(s) might be more accurate in those cases.
Point 3 is actually somewhat important because it would make writing regexes easier if the warnings all had the same format.
Point 4 is probably the least important, might even decide to keep it as is, as the messages are probably easier to read this way.
To quickly find the warnings raised with warnings.warn:
grep -E -r -n 'warnings.warn' src
To quickly find those raised with warn:
grep -E -r -n 'from warnings import warn' src
Desired solution
Use the same style everywhere.
Ideally, find a way to have the linter enforce a consistent style.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
The way warnings are raised is not consistent throughout the codebase.
Some things I noticed:
_elastic_net_regression.py
uses bothfrom warnings import warn
(in combination with calls towarn(...)
) andimport warnings
(in combination withwarnings.warn(...)
).UserWarning
is explicitely passed ascategory
keyword argument, sometimes it is left out (asUserWarning
is the default value).Transformer
classes lack the trailing period.Transformer
class generally talk aboutcolumns
even when there could be just one column that is mentioned. Sayingcolumn(s)
might be more accurate in those cases.Point 3 is actually somewhat important because it would make writing regexes easier if the warnings all had the same format.
Point 4 is probably the least important, might even decide to keep it as is, as the messages are probably easier to read this way.
To quickly find the warnings raised with
warnings.warn
:grep -E -r -n 'warnings.warn' src
To quickly find those raised with
warn
:grep -E -r -n 'from warnings import warn' src
Desired solution
Use the same style everywhere.
Ideally, find a way to have the linter enforce a consistent style.
The text was updated successfully, but these errors were encountered: