djay0529 / mdanalysis

Automatically exported from code.google.com/p/mdanalysis
0 stars 0 forks source link

AtomGroup instant selectors should raise AttributeError and not SelectionError #220

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. import MDAnalysis as MDA; from MDAnalysis.tests.datafiles import PSF,DCD
2. u = MDA.Universe(PSF,DCD)
3. u.atoms.potential_attribute_name

What is the expected output? What do you see instead?

It would be less confusing if this raised an AttributeError because I suspect 
fewer people are using the instant selectors for atom names than are confused 
when they just mistyped or wrongly guessed an attribute or method name.

I get 

  SelectionError: No atoms or attributes with name potential_attribute_name

I think we should change that error to be in more line with what people expect 
of python objects.

Original issue reported on code.google.com by orbeckst on 19 Feb 2015 at 8:47