Page 1 of 1

KDB bugs

Posted: Thu Jul 26, 2018 10:09 pm
by mjwaters
Hi all,

I found 2 bugs in KDB and found a fix.

In, 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 =, ibox)
In, 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.


Re: KDB bugs

Posted: Thu Aug 23, 2018 6:59 pm
by graeme
Thanks for the bug fixes! They have been added to the eon code.