SINGROUP / pycp2k

Python Cp2k interface
GNU Lesser General Public License v3.0
86 stars 26 forks source link

Multiple Basis Set File Names #4

Closed cpashartis closed 5 years ago

cpashartis commented 5 years ago

Hello,

I have found a bug in your code. If you have multiple BASIS_SET_FILE_NAMEs in your input file and use the pycp2k parser, it reads only the last variable in that section. The variable probably requires a list implementation (I'm not sure how it currently works).

It would seem that you already have the idea of making the variable a list but it wasn't parsed correctly by CP2KInputParser.parse .

The variable is from the following tree: &FORCE_EVAL &DFT BASIS_SET_FILE_NAME BASIS_SET_FILE_NAME ....

lauri-codes commented 5 years ago

Hi @cpashartis!

Thank you for your interest in pycp2k. Indeed you are right. I have now introduced a fix for this problem in the master branch. Could you verify that this new version resolves your problem?

cpashartis commented 5 years ago

@lauri-codes

I am in process of verifying it, however I get the following error while doing the setup.py, off a new clone:

Traceback (most recent call last):
  File "setup.py", line 209, in <module>
    main()
  File "setup.py", line 172, in main
    (version, revision) = inputparser.main(xml_path)
  File "/imec/scratch/abinitio/pashar57/software/pycp2k/inputparser.py", line 342, in main
    with open('pycp2k/classes/{}.py'.format(class_name), 'w') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'pycp2k/classes/_each1.py'

Thank you for resolving the problem in a quick manner!

lauri-codes commented 5 years ago

Hi,

I cannot seem to reproduce this issue when doing a fresh install from the master branch. The error message seems to suggest that you don't either have the "/imec/scratch/abinitio/pashar57/software/pycp2k/pycp2k" folder or the "/imec/scratch/abinitio/pashar57/software/pycp2k/pycp2k/classes" folder. These should come when doing the git clone. Have you deleted/moved/renamed them by accident?

lauri-codes commented 5 years ago

@cpashartis

Another perhaps more likely option is that you are running the setup from another directory than the root directory "/imec/scratch/abinitio/pashar57/software/pycp2k/". Currently you should first cd to that root directory and run the "python setup.py install" there. If you run it from outside, e.g. "python pycp2k/setup.py install", then the installer gets confused with the folders.

cpashartis commented 5 years ago

@lauri-codes

Ah yes, you were right. The multiple parameters seems to work for me now. Thank you!