KDB bugs

Current eOn code and boinc distributed computing

Moderator: moderators

Post Reply
mjwaters
Posts: 4
Joined: Thu Jul 19, 2018 9:54 pm

KDB bugs

Post by mjwaters » Thu Jul 26, 2018 10:09 pm

Hi all,

I found 2 bugs in KDB and found a fix.

In kdb.py, on line 78:

Code: Select all

        
        #if ibox == None:   #old check, raises ValueError on ndarrays
        if type(ibox) != numpy.ndarray and type(ibox) != list and type(ibox) != tuple:  # my fix
            ibox = numpy.linalg.inv(box)
        vdir = numpy.dot(r, ibox)
In local_db.py, on line 156:

Code: Select all

        
        # if mode = None, create array of zeros.
        #if mode == None: #old check, raises ValueError on ndarrays
        if type(mode) != numpy.ndarray and type(mode) != list and type(mode) != tuple: # my fix
            mode = numpy.zeros((len(atoms),3))
        # get important data from ase.Atoms instance
A better solution is probably to try type casting the inputs to ndarrays and if they pass, check to see if they have the right dimensions. But I'm new around here and don't want raise a kerfuffle.

Best,
-Mike

Post Reply