Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#4084 closed defect (fixed)

Wrong numpy parsing in Coulombic C++ module

Reported by: Tom Goddard Owned by: Eric Pettersen
Priority: moderate Milestone:
Component: Surface/Binding Analysis Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The code in Coulombic esp.cpp in potential_at_points() for parsing numpy arrays using parse_float_n3_array() and parse_float_n_array() is wrong. It is passing pointers to DArray when pointer to FArray is required. Then later it casts he double pointer to float. I can see how this code could function, but it easily could crash too.

Change History (4)

comment:1 by Eric Pettersen, 5 years ago

Status: assignedaccepted

comment:2 by Eric Pettersen, 5 years ago

Resolution: fixed
Status: acceptedclosed

Thanks, have fixed that up. I found the documentation in the various libarrays files fairly opaque. I few simple examples in some doc strings wouldn't hurt any...

in reply to:  3 ; comment:3 by goddard@…, 5 years ago

Ok, I put some example uses parsing FArray, IArray, float [] in the pythonarray.h header file.

comment:4 by Eric Pettersen, 5 years ago

Excellent!

Note: See TracTickets for help on using tickets.