votca / votca

The source of the votca-csg and xtp packages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reduce warnings XML options not set in pyxtp

baumeier opened this issue · comments

When running a calculation with pyxtp from the shell, a ton of output of this kind is generated:

'NoneType' object has no attribute 'text'
archiveA  not found
'NoneType' object has no attribute 'text'
archiveB  not found
'NoneType' object has no attribute 'text'
dftpackage/charge  not found
'NoneType' object has no attribute 'text'
dftpackage/cleanup  not found

Basically for each element in the full options list that is not updated by the user.

Hey Bjoern, I can’t reproduce the issue on my laptop. Can you paste the command you used ? It might also be because of a different Python version or the version of the dependencies. Can you specify which Python version you use and the version of lxml and xml2dict ? Thanks !

# Set up a water molecule
from ase.build import molecule
co = molecule('CO')
co.rattle()

# Set up a XTP calculator
from pyxtp import xtp

# change options for the calculations
calc = xtp()
calc.options.dftpackage.functional = 'XC_HYB_GGA_XC_PBEH'
calc.options.dftpackage.basisset = 'def2-svp'
calc.options.dftpackage.auxbasisset = 'aux-def2-svp'
calc.options.logging_file = 'crap.log'

# specify the wich forces we want to use
calc.select_force(energy='singlets', level=0, dynamic=False)

# attach the calculator
co.calc = calc

# compute the energy terms
from ase.optimize import QuasiNewton
from ase.io import write
dyn = QuasiNewton(co, trajectory='test.traj')
dyn.run(fmax=0.01)
write('final.xyz', atoms)

and then just

python3 opt.py
  • python version 3.11.3
  • lxml version 4.9.2
  • xmltodict version 0.13.0

Thanks ! I get the same output now. I'll look into it asap and make a PR

fixed in #1074