libAtoms / abcd

1 stars 4 forks source link

list object from info goes to arrays if length of it = n_atoms #80

Open stenczelt opened 4 years ago

stenczelt commented 4 years ago

Let's assume we have atoms objects with lists/numpy-arrays in the info, like PCA coordinates for instance. If the length of these properties are the same as the length of the atoms object (n_atoms) then they are moved to the Atoms.arrays of the atoms object on download instead the Atoms.info, hence the uploaded and downloaded xyz files differ.

This is especially bad if I have configurations with various number of atoms and a given length of list property in the info, like 10 PCA coordinates. Then the configs of length 10 will have it in their arrays and the rest in the info

gabor1 commented 4 years ago

This is a tough one. We decided to use a single dictionary in abcd, but ase (and extended XYZ for readability) uses two kinds of dictionaries. How to convert between the two? IT must be heuristic. One option (but we should think through how much complexity this brings) is to have a helper object that remembers the source of the data when ASE or XYZ objects are uploaded to abcd, ie whether each piece of data came from arrays or info, and when we convert back, if this information exists, it is used for the conversion. if it doesn't, then we fall back onto the n=n_atoms heuristic.

gabor1 commented 3 years ago

Check whether ASE_data_source mechanism is already implemented or not.