schrodinger / pymol-open-source

Open-source foundation of the user-sponsored PyMOL molecular visualization system.
https://pymol.org/
Other
1.18k stars 279 forks source link

Inconsistent behaviour of pymol API's `delete` and `get_vis` with the name `sele` #123

Closed bzoracler closed 1 month ago

bzoracler commented 4 years ago

I understand that PyMOL strips characters like ( in the object name when loading in a new molecule object. However, since it is allowed to name objects "sele", this causes some behavioural issues if we have an object called "sele" in the session:

I'm guessing that the object name corrector which strips invalid characters also acts on arguments to pymol API functions like delete.


What I really wanted to do is to use pymol.viewing.get_vis() to check whether a named object is enabled or disabled (from the function pymol.viewing.enable/disable). Is there a better way to do this check?

Valdes-Tresanco-MS commented 4 years ago

I think that cmd.get_names(type, enabled_only, selection) gives you a better way.

https://pymolwiki.org/index.php/Get_Names