[Chimera-users] Do attribute names have to be case sensitive?
Eric Pettersen
pett at cgl.ucsf.edu
Wed Feb 10 11:01:18 PST 2016
Hi Oliver,
Attributes in Python are simply case sensitive, so you can have two different attributes, one named “stickscale” and the other “stickScale” and they are completely different as far as Python is concerned.
Nonetheless, in ChimeraX the situation will be significantly improved for two reasons. One is that all the attributes that ChimeraX cares about will be completely lower case (e.g. in ChimeraX “stickScale” is instead “stick_scale”), so you would have to somehow inadvertently uppercase a letter — which is much harder to do — to run into the same problem you get in Chimera 1 by inadvertently lowercasing a letter. The second reason is that the setattr command will not by default create new attributes (there will be a keyword to allow creation), so accidental typos will be caught in most cases.
—Eric
Eric Pettersen
UCSF Computer Graphics Lab
> On Feb 10, 2016, at 7:43 AM, Oliver Clarke <olibclarke at gmail.com> wrote:
>
> Apologies for spamming the message board... in Chimera at present, attribute names (e.g. stickScale) are case sensitive. I understand that this is the way it was built and there is probably no changing it in the current version of Chimera, but assuming ChimeraX has a similar concept of attributes built in, would it be possible to make these case-insensitive? I can't imagine there are many situations where case would make a difference to the intended attribute (and if there are there probably should not be).
>
> I have many cases where I type e.g. "setattr m stickscale 2.0", nothing happens and there is no error message, and I am confused until I realise I should have typed "setattr m stickScale 2.0". Alternatively, raising an error message in the status bar when a user attempts to alter a nonexistent attribute would also be helpful.
>
> Cheers,
> Oli.
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20160210/86b2f84a/attachment.html>
More information about the Chimera-users
mailing list