openkim / kliff

KIM-based Learning-Integrated Fitting Framework for interatomic potentials.
https://kliff.readthedocs.io
GNU Lesser General Public License v2.1
34 stars 20 forks source link

"T/F" of PBC when reading ".xyz" datasets #169

Closed hghermes closed 5 months ago

hghermes commented 5 months ago

The official manual for Kliff states that the pbc of the dataset can be read as a boolean (True/False) type, but in reality, errors occur when attempting to do so.

Additional context This can be solved by changing the 239 line of "kliff/dataset/extxyz.py

            value = [int(i) for i in value]

to

            if(all(i in ['T','F'] for i in value)):
                value = [1 if i =='T' else 0 for i in value]
            else:
                value = [int(i) for i in value]
mjwen commented 5 months ago

Thanks @hghermes !

Do you want to make a PR to fix it?

hghermes commented 5 months ago

@mjwen No. It's okay, thanks. I just wanted to share a simple error and fix. Always grateful for you and KLIFF.

mjwen commented 5 months ago

Thanks for reporting! Got it fixed in #170