Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cdms2.setAutoBounds(wrong_param) should generate an error #429

Open
jypeter opened this issue Mar 29, 2021 · 0 comments
Open

cdms2.setAutoBounds(wrong_param) should generate an error #429

jypeter opened this issue Mar 29, 2021 · 0 comments

Comments

@jypeter
Copy link
Member

jypeter commented Mar 29, 2021

I had forgotten once again the exact parameters of cdms2.setAutoBounds and the help is still not showing much in cdms 3.2.5 (I remember an issue about help/docstrings, but can't find it)

>>> help(cdms2.setAutoBounds)
Help on function setAutoBounds in module cdms2.axis:
setAutoBounds(mode)
(END)

So I just thought I'd give a crappy argument to setAutoBounds and I would get an error message telling me what the allowed arguments are. Except that crappy arguments are just silently ignored! Printing an error message would be safer and more useful

>>> cdms2.setAutoBounds('crap')
>>> cdms2.getAutoBounds()
2
>>> cdms2.setAutoBounds(20)
>>> cdms2.getAutoBounds()
2
>>> cdms2.setAutoBounds('off')
>>> cdms2.getAutoBounds()
0
>>> cdms2.setAutoBounds(20)
>>> cdms2.getAutoBounds()
0
>>> cdms2.setAutoBounds(-3.14)
>>> cdms2.getAutoBounds()
0

I resorted to finding the setAutoBounds doc in readthedocs but I sometimes wonder if I'm the only person reading the documentation

BTW, the documentation says Note: In versions of CDMS prior to V4.0, the default mode was 'on' but nothing about the current default, which seems to be grid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant