dftlibs / xcfun

XCFun: A library of exchange-correlation functionals with arbitrary-order derivatives
https://dftlibs.org/xcfun/
Mozilla Public License 2.0
57 stars 32 forks source link

Adding python interface for calculation of energy density only #93

Closed chjacob-tubs closed 5 years ago

chjacob-tubs commented 5 years ago

I extended the Python interface a but to allow the calculation of the energy density only (without calculating the potential). We are going to use this functionality in PyADF.

How Has This Been Tested?

A test of the interface is included in PyADF (as for the rest of the interface)

Types of changes

Questions

Status

chjacob-tubs commented 5 years ago

Thanks @robertodr I changed the error messages, will look at the tests tomorrow.

chjacob-tubs commented 5 years ago

OK, the python tests are a bigger task (see #43), but I promised earlier to look at this. Hope I will find some time for this tomorrow.

robertodr commented 5 years ago

In principle yes, but something similar to this line will suffice for the moment:

env PYTHONPATH=$HOME/Software/trash_xcfun/lib64/python:$PYTHONPATH python test/test.py 

I've tried it locally and it works. IMHO a) extending test/test.py to call your newly added interface functions, and b) adding this line to .travis.yml (disregard .appveyor.yml for the moment) it's enough to complete this PR and keeping it self-contained.

We can add to the wish list that Python tests should use pytest (of which I was not aware one year ago when #43 was opened).

codecov-io commented 5 years ago

Codecov Report

Merging #93 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #93   +/-   ##
=======================================
  Coverage   42.07%   42.07%           
=======================================
  Files          77       77           
  Lines        1785     1785           
=======================================
  Hits          751      751           
  Misses       1034     1034

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a486a3f...e2368fd. Read the comment docs.

chjacob-tubs commented 5 years ago

@robertodr I added tests of the Python interface and use Pytest for the tests now. The automatic tests still fail because pytest is not available in the test environment. How can I fix that?

robertodr commented 5 years ago

That's awesome, thanks! As for your question, you need to:

Unrelated question: you mentioned some time ago that you were still developing under Python 2.7 Is that still the case? Or can we drop Python 2.7 support?

chjacob-tubs commented 5 years ago

Thanks! I will merge this once the automatic tests pass.

On the Python 2.7 question: This is all part of a larger cleanup effort and I hope then we will be able to migrate all our code to Python 3. We are not completely there yet but getting closer...

bast commented 5 years ago

Thanks a lot for this!