grimme-lab / xtb-python

Python API for the extended tight binding program package
https://xtb-python.readthedocs.io
GNU Lesser General Public License v3.0
99 stars 30 forks source link

Silence console output #104

Open peastman opened 1 year ago

peastman commented 1 year ago

I am using the ASE interface like this:

atoms = ase.Atoms(positions=pos, numbers=numbers, charges=charges)
atoms.calc = XTB(method="GFN-FF")
ase.optimize.LBFGS(atoms, logfile=os.devnull).run(0.001, 20)

Despite directing the log to devnull, the optimizer still prints about a hundred lines of output every time I do this:

          ==================== Thresholds ====================
          CN  :   150.00000
          rep :   500.00000
          disp:  2500.00000
          HB1 :   250.00000
          HB2 :   450.00000

          Pauling EN used:
          Z : 1  EN :  2.20
          Z : 6  EN :  2.55
          Z : 7  EN :  3.04
          Z : 8  EN :  3.44
          Z :14  EN :  1.90
          electric field strengths (au): 0.000

           ------------------------------------------------- 
          |           Force Field Initialization            |
           ------------------------------------------------- 

and so on. Is there some way I can silence the output? Here are the relevant package versions (installed with conda).

ase                       3.22.1             pyhd8ed1ab_1    conda-forge
xtb                       6.5.1                h03160e7_1    conda-forge
xtb-python                22.1            py310h1fa729e_0    conda-forge