Skip to content

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

@jypeter

Description

@jypeter

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions