Opened 8 years ago

Closed 8 years ago

#832 closed defect (fixed)

Bonds.visibles raises an error

Reported by: Tristan Croll Owned by: Conrad Huang
Priority: minor Milestone:
Component: Core Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

~/apps/chimerax/lib/python3.6/site-packages/chimerax/core/atomic/molc.py in get_prop(self)
    124         shape = ((n,) if vc == 1 or not per_object else (n,vc)) if per_object else (vc.sum(),)
    125         values = empty(shape, value_type)
--> 126         cget(self._c_pointers, n, pointer(values))
    127         return values if astype is None else astype(values)
    128 

ArgumentError: argument 3: <class 'TypeError'>: expected LP_c_bool instance instead of LP_c_int

I get the impression that this is simply an old and unused method, obsoleted by Bonds.showns?

Change History (4)

comment:1 by Conrad Huang, 8 years ago

Owner: changed from Conrad Huang to Tom Goddard

There is indeed a bug where in molarray.py, the type for Bonds.visibles is declared as int32 which conflicts with Connection::visible which returns bool. I'll get TomG decide what to do since he is the one who added that. (There is a reference to the "Never" constant in the visibles declaration. I think that's a remnant from earlier implementations but will defer to TomG.)

The difference between Bonds.visibles and Bonds.shown is that the former returns whether the bonds are visible regardless of whether the atoms are shown, whereas the latter takes everything into account.

comment:2 by Tom Goddard, 8 years ago

Owner: changed from Tom Goddard to Conrad Huang

Conrad changed bond_visibles to int32 and added this Never return value two years ago. The git commit says something about hiding backbone atoms.

https://www.rbvi.ucsf.edu/trac/ChimeraX/changeset/082298fe74359499ad22d2c2cdf741251f11196b

I'll let Conrad fix that since he should know best what the intent was.

It is strange that we did not see this problem earlier. It appears that Bonds.visibles is never used, so perhaps it should be deleted, but should check with Tristan if that is really what he needs rather than Bonds.showns.

in reply to:  3 ; comment:3 by tic20@…, 8 years ago

No, I don't need it. I called it by accident because I forgot about Bonds.showns.

 
 
Tristan Croll
Research Fellow
Cambridge Institute for Medical Research
University of Cambridge CB2 0XY
 

 

comment:4 by Conrad Huang, 8 years ago

Resolution: fixed
Status: assignedclosed

Fixed (both code and comment) in 320c40e12.

Note: See TracTickets for help on using tickets.