KDB bugs

eOn code for long time scale dynamics

Moderator: moderators

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

KDB bugs

Post by mjwaters »

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
graeme
Site Admin
Posts: 2253
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: KDB bugs

Post by graeme »

Thanks for the bug fixes! They have been added to the eon code.
Post Reply