calc.descriptor.fingerprints accumulates the previous fingerprint existing in database

Issue #155 resolved
Javad Hashemi created an issue

We have 100 images in each of "training-2000k.traj" and "test-2300k.traj". If in ipython we run the following code:

import amp
from amp import Amp
from amp.descriptor.gaussian import Gaussian
from amp.model.neuralnetwork import NeuralNetwork

images = amp.hash_images('training-2000k.traj')
calc = Amp(descriptor=Gaussian(), model=NeuralNetwork())
calc.descriptor.calculate_fingerprints(images)
trainFingerPrints = calc.descriptor.fingerprints
trainFingerPrints.open()

then the number of images loaded is 100 as it should be:

In [2]: len(trainFingerPrints.d.keys())
Out[2]: 100

then if we change the name of the file from 'training-2000k.traj' to "test-2300k.traj" and run the code again without removing .ampdb folder we will have

In [4]: len(trainFingerPrints.d.keys())
Out[4]: 199

Although we should just get 100

Comments (2)

  1. Muammar El Khatib

    The two trajectory files don't have the same images present and therefore this should be the expected behavior.

  2. Log in to comment