cp2k / cp2k-input-tools

Fully validating pure-python CP2K input file tools including preprocessing capabilities
MIT License
49 stars 10 forks source link

Multiple BASIS_SET_FILE_NAME values not taken into account #33

Closed sylviancadars closed 3 years ago

sylviancadars commented 3 years ago

Hi,

It seems that the cp2k-input-tools parser does not properly deals with the situation where multiple basis set file names are needed (different files for different elements in th system) :

&DFT BASIS_SET_FILE_NAME /gpfs/home/scadars/CP2K/CP2K6.1/data/GTH_BASIS_SETS BASIS_SET_FILE_NAME /gpfs/home/scadars/CP2K/CP2K6.1/data/BASIS_MOLOPT_UCL POTENTIAL_FILE_NAME /gpfs/home/scadars/CP2K/CP2K6.1/data/GTH_POTENTIALS

In this case the parse() method of the CP2KInputParserSimplified class with the following options :

parser = CP2KInputParserSimplified(key_trafo=str.upper, multi_value_unpack=False, repeated_section_unpack=False, level_reduction_blacklist=["KIND"])

returns a nested dict which contains among other key/value pairs of the dict value associated with the 'DFT' key :

'BASIS_SET_FILE_NAME': ['/gpfs/home/scadars/CP2K/CP2K6.1/data/BASIS_MOLOPT_UCL', '/gpfs/home/scadars/CP2K/CP2K6.1/data/BASIS_MOLOPT_UCL'], 'POTENTIAL_FILE_NAME': '/gpfs/home/scadars/CP2K/CP2K6.1/data/GTH_POTENTIALS'

It appears that the parser correctly interprets the fact that there are 2 values associated with 'BASIS_SET_FILE_NAME' but only the first value is used, and repeated, instead of using the second.

Another related issue is from the aiida-cp2k side, where the builder associated with cp2k code does not seem to accept lists of files as values for the 'basis' key in the builder.file (see aiida-cp2k issue 139 here : [(https://github.com/aiidateam/aiida-cp2k/issues/139)]).

Please note that, being unfamiliar with the CP2K code I don't know how common this situation, but I got sample my input files from a definitely experienced user, and the code itself is able to deal with such a situation.

Thank you very much for your help. Best regards.

Sylvian

sylviancadars commented 3 years ago

It appears that the same bug had just been raised by another user (Issue 32). My apologies for the redundancy ! Sylvian

dev-zero commented 3 years ago

Thanks for reporting, no worries. Turns out it is really the same issue as #32 (could also have been something else).

sylviancadars commented 3 years ago

Thank you so much for quickly solving this iussue in the parser.

Yet it seems to me that the problem remains on the aiida-cp2k side, in the sense that builder.file does not seem to accept a list of SingleFileData objects, as pointed out here.

Am I missing something ?

Thanks. All the best. Sylvian.