From 11d394fd5bb9c6de5fd857043600e2c5efa1af77 Mon Sep 17 00:00:00 2001
From: Alexander Hampel
Date: Wed, 10 Jun 2020 17:45:53 +0200
Subject: [PATCH] synchronize dfttools with app4triqs structure
* moved the plovasp C++ code to c++/triqs_dft_tools/converters/vasp
* added global header triqs_dft_tools/triqs_dft_tools.hpp
* python dir based on single cmakelist file
* registered C++ tests for plovasp
* corrected imports for py3 tests for plovasp
* corrected block order in sigma_from_file and srvo3_Gloc
* exchanged ref files for sigma_from_file, srvo3_Gloc, SrVO3.ref.h5
* moved vasp converter bash scripts from dir shells to bin dir
---
.clang-tidy | 2 +
.dockerignore | 2 +
.github/ISSUE_TEMPLATE/bug.md | 2 +-
.gitignore | 2 +
.travis.yml | 45 +-
CMakeLists.txt | 218 +-
ChangeLog.md | 1 +
Dockerfile | 11 +-
Jenkinsfile | 33 +-
README.txt => README.md | 0
{shells => bin}/CMakeLists.txt | 4 +-
shells/plovasp.bash.in => bin/plovasp.in | 0
shells/vasp_dmft.bash.in => bin/vasp_dmft.in | 0
c++/plovasp/atm/.gitignore | 5 -
c++/plovasp/atm/CMakeLists.txt | 7 -
c++/plovasp/atm/test/CMakeLists.txt | 13 -
c++/triqs_dft_tools/CMakeLists.txt | 81 +
c++/triqs_dft_tools/converters/vasp.hpp | 3 +
.../converters/vasp}/__init__.py | 0
.../converters/vasp}/argsort.cpp | 0
.../converters/vasp}/argsort.hpp | 0
.../converters/vasp}/dos_tetra3d.cpp | 0
.../converters/vasp}/dos_tetra3d.hpp | 8 +-
.../converters/vasp}/makefile.linux | 0
.../converters/vasp}/setup.py | 0
c++/triqs_dft_tools/triqs_dft_tools.hpp | 3 +
doc/CMakeLists.txt | 83 +-
doc/_templates/sideb.html | 2 +-
doc/changelog.rst | 2 +-
doc/conf.py.in | 32 +-
doc/contents.rst | 1 +
doc/install.rst | 97 +-
doc/issues.rst | 7 +-
.../__pycache__/autorun.cpython-38.pyc | Bin 0 -> 2990 bytes
doc/sphinxext/autorun/autorun.py | 104 +
doc/sphinxext/autorun/pycon.py | 34 +
.../__pycache__/docscrape.cpython-38.pyc | Bin 0 -> 14820 bytes
.../docscrape_sphinx.cpython-38.pyc | Bin 0 -> 4620 bytes
.../__pycache__/numpydoc.cpython-38.pyc | Bin 0 -> 3426 bytes
doc/sphinxext/numpydoc/apigen.py | 427 ++++
doc/sphinxext/numpydoc/docscrape.py | 497 +++++
doc/sphinxext/numpydoc/docscrape_sphinx.py | 136 ++
doc/sphinxext/numpydoc/inheritance_diagram.py | 407 ++++
.../numpydoc/ipython_console_highlighting.py | 114 ++
doc/sphinxext/numpydoc/numpydoc.py | 116 ++
doc/sphinxext/numpydoc/plot_directive.py | 773 +++++++
doc/sphinxext/triqs_example/triqs_example.py | 123 ++
doc/themes/agogo/layout.html | 92 +
doc/themes/agogo/static/agogo.css_t | 519 +++++
doc/themes/agogo/theme.conf | 20 +
doc/themes/triqs/layout.html | 52 +
doc/themes/triqs/static/cufon-yui.js | 7 +
.../triqs/static/spaceman.cufonfonts.js | 8 +
doc/themes/triqs/static/triqs.css | 449 +++++
doc/themes/triqs/theme.conf | 4 +
fortran/dmftproj/CMakeLists.txt | 5 +-
python/CMakeLists.txt | 19 -
python/converters/.gitignore | 1 -
python/converters/CMakeLists.txt | 10 -
python/converters/plovasp/CMakeLists.txt | 19 -
python/triqs_dft_tools/CMakeLists.txt | 25 +
python/{ => triqs_dft_tools}/__init__.py | 0
.../{ => triqs_dft_tools}/block_structure.py | 0
.../{ => triqs_dft_tools}/clear_h5_output.py | 0
.../converters/__init__.py | 0
.../converters/converter_tools.py | 0
.../converters/hk_converter.py | 0
.../converters/plovasp/.gitignore | 0
.../converters/plovasp/__init__.py | 0
.../converters/plovasp/atm_desc.py | 5 +-
.../converters/plovasp/converter.py | 0
.../converters/plovasp/elstruct.py | 0
.../converters/plovasp/inpconf.py | 0
.../converters/plovasp/plotools.py | 0
.../converters/plovasp/proj_group.py | 0
.../converters/plovasp/proj_shell.py | 8 +-
.../converters/plovasp/sc_dmft.py | 0
.../converters/plovasp/vaspio.py | 0
.../converters/vasp_converter.py | 0
.../converters/wannier90_converter.py | 0
.../converters/wien2k_converter.py | 0
python/{ => triqs_dft_tools}/sumk_dft.py | 0
.../{ => triqs_dft_tools}/sumk_dft_tools.py | 0
python/{ => triqs_dft_tools}/symmetry.py | 0
python/{ => triqs_dft_tools}/trans_basis.py | 0
.../{ => triqs_dft_tools}/update_archive.py | 0
python/{ => triqs_dft_tools}/version.py.in | 11 +-
share/CMakeLists.txt | 28 +
share/cmake/CMakeLists.txt | 10 +
share/cmake/Modules/FindSphinx.cmake | 37 +
share/cmake/extract_flags.cmake | 102 +
.../triqs_dft_tools-config-version.cmake.in | 13 +
share/cmake/triqs_dft_tools-config.cmake.in | 32 +
share/replace_and_rename.py | 45 +
{cmake => share}/sitecustomize.py | 0
share/squash_history.sh | 6 +
share/triqs_dft_tools.modulefile.in | 39 +
share/triqs_dft_toolsvars.sh.in | 10 +
test/CMakeLists.txt | 27 +-
test/c++/CMakeLists.txt | 35 +
.../c++/converters/vasp}/reorder_flag.cpp | 0
.../c++/converters/vasp}/reorder_inds.cpp | 0
.../c++/converters/vasp}/testing.hpp | 0
.../c++/converters/vasp}/tet_weights.cpp | 0
.../c++/converters/vasp}/weights1.cpp | 0
test/plovasp/.gitignore | 1 -
test/plovasp/converter/lunio3.out.h5_old | Bin 372392 -> 0 bytes
test/plovasp/converter/runtest.sh | 1 -
test/plovasp/inpconf/.gitignore | 1 -
test/plovasp/inpconf/parse_shells_5.cfg~ | 18 -
test/plovasp/inpconf/runtest.sh | 1 -
test/plovasp/plocar_io/runtest.sh | 1 -
test/plovasp/plotools/runtest.sh | 1 -
test/plovasp/proj_group/projgroups.out | 1788 -----------------
test/plovasp/proj_group/runtest.sh | 1 -
test/plovasp/proj_shell/runtest.sh | 1 -
test/plovasp/run_all.sh | 1 -
test/plovasp/vaspio/__init__.py | 0
test/plovasp/vaspio/runtest.sh | 1 -
test/python/CMakeLists.txt | 19 +
test/{ => python}/LaVO3-Pnma.inp | 0
test/{ => python}/LaVO3-Pnma_hr.dat | 0
test/{ => python}/SrIrO3_rot.h5 | Bin
test/{ => python}/SrVO3.ctqmcout | 0
test/{ => python}/SrVO3.h5 | Bin
test/{ => python}/SrVO3.oubwin | 0
test/{ => python}/SrVO3.outputs | 0
test/{ => python}/SrVO3.parproj | 0
test/{ => python}/SrVO3.pmat | 0
test/python/SrVO3.ref.h5 | Bin 0 -> 859481 bytes
test/{ => python}/SrVO3.struct | 0
test/{ => python}/SrVO3.sympar | 0
test/{ => python}/SrVO3.symqmc | 0
test/{ => python}/SrVO3_Sigma.h5 | Bin
.../analyse_block_structure_from_gf.py | 0
.../analyse_block_structure_from_gf.ref.h5 | Bin
.../analyse_block_structure_from_gf2.py | 0
test/{ => python}/blockstructure.in.h5 | Bin
test/{ => python}/blockstructure.py | 0
test/{ => python}/blockstructure.ref.h5 | Bin
test/{ => python}/hk_convert.py | 0
test/{ => python}/hk_convert.ref.h5 | Bin
test/{ => python}/hk_convert_hamiltonian.hk | 0
{c++ => test/python}/plovasp/.gitignore | 0
test/{ => python}/plovasp/CMakeLists.txt | 7 +-
test/{ => python}/plovasp/atm/mytest.py | 0
test/{ => python}/plovasp/atm/test_atm.py | 0
.../plovasp/converter/example.cfg | 0
.../{ => python}/plovasp/converter/lunio3.cfg | 0
.../plovasp/converter/lunio3.ref.h5} | Bin
.../plovasp/converter/lunio3/DOSCAR | 0
.../plovasp/converter/lunio3/IBZKPT | 0
.../plovasp/converter/lunio3/LOCPROJ | 0
.../plovasp/converter/lunio3/POSCAR | 0
.../plovasp/converter/lunio3/readme.txt | 0
.../plovasp/converter/lunio3/rot_dz2_dx2 | 0
.../converter/lunio3/test_lunio3.tar.gz | Bin
test/{ => python}/plovasp/converter/mytest.py | 0
.../plovasp/converter/one_site/DOSCAR | 0
.../plovasp/converter/one_site/IBZKPT | 0
.../plovasp/converter/one_site/LOCPROJ | 0
.../plovasp/converter/one_site/POSCAR | 0
.../plovasp/converter/one_site/PROJCAR | 0
.../plovasp/converter/one_site/readme.txt | 0
.../plovasp/converter/pg_output.ref.h5} | Bin
test/{ => python}/plovasp/converter/rpath.py | 0
.../plovasp/converter/test_all.py | 0
.../converter/test_converter_lunio3.py | 4 +-
.../converter/test_converter_one_site.py | 2 +-
.../python/plovasp/inpconf}/.gitignore | 0
.../python/plovasp/inpconf}/__init__.py | 0
.../{ => python}/plovasp/inpconf/arraytest.py | 0
test/{ => python}/plovasp/inpconf/example.cfg | 0
.../plovasp/inpconf/example_nogroup.cfg | 0
.../plovasp/inpconf/input_test_1.cfg | 0
.../plovasp/inpconf/input_test_2.cfg | 0
.../plovasp/inpconf/input_test_3.cfg | 0
.../plovasp/inpconf/input_test_4.cfg | 0
.../plovasp/inpconf/parse_groups_1.cfg | 0
.../plovasp/inpconf/parse_shells_1.cfg | 0
.../plovasp/inpconf/parse_shells_2.cfg | 0
.../plovasp/inpconf/parse_shells_3.cfg | 0
.../plovasp/inpconf/parse_shells_4.cfg | 0
.../plovasp/inpconf/parse_shells_5.cfg | 0
test/{ => python}/plovasp/inpconf/rpath.py | 0
test/{ => python}/plovasp/inpconf/test1.cfg | 0
test/{ => python}/plovasp/inpconf/test_all.py | 0
.../plovasp/inpconf/test_general.py | 4 +-
.../plovasp/inpconf/test_groups.py | 4 +-
.../plovasp/inpconf/test_input.py | 4 +-
.../plovasp/inpconf/test_parameter_set.py | 6 +-
.../plovasp/inpconf/test_shells.py | 4 +-
.../plovasp/inpconf/test_special_parsers.py | 4 +-
.../plovasp/inpconf/tmatrix_file.dat | 0
.../{ => python}/plovasp/plocar_io/.gitignore | 0
.../plovasp/plocar_io/PLOCAR.example | Bin
.../plovasp/plocar_io/PLOCAR.example.out | 0
.../plovasp/plocar_io/PLOCAR.noprec | 0
.../plovasp/plocar_io/PLOCAR.prec8 | Bin
.../plovasp/plocar_io/PLOCAR.prec8.out | 0
.../plovasp/plocar_io/PLOCAR.trunc | Bin
test/{ => python}/plovasp/plocar_io/mytest.py | 0
.../plovasp/plocar_io/test_fileio.py | 0
.../plovasp/plocar_io/test_plocar_io.py | 0
test/{ => python}/plovasp/plotools/.gitignore | 0
test/{ => python}/plovasp/plotools/DOSCAR | 0
test/{ => python}/plovasp/plotools/EIGENVAL | 0
test/{ => python}/plovasp/plotools/IBZKPT | 0
test/{ => python}/plovasp/plotools/OUTCAR | 0
test/{ => python}/plovasp/plotools/PLOCAR | Bin
test/{ => python}/plovasp/plotools/POSCAR | 0
.../plovasp/plotools/POSCAR.complex | 0
.../{ => python}/plovasp/plotools/example.cfg | 0
test/{ => python}/plovasp/plotools/mytest.py | 0
test/{ => python}/plovasp/plotools/rpath.py | 0
.../{ => python}/plovasp/plotools/test_all.py | 0
.../plovasp/plotools/test_consistency.py | 2 +-
.../plovasp/plotools/wrong_shell.cfg | 0
.../plovasp/proj_group/.gitignore | 0
.../plovasp/proj_group}/__init__.py | 0
.../plovasp/proj_group/block_matrix.cfg | 0
.../plovasp/proj_group/example.cfg | 0
.../plovasp/proj_group/example_two_site.cfg | 0
.../plovasp/proj_group/hk.ref.h5} | Bin
.../{ => python}/plovasp/proj_group/mytest.py | 0
.../plovasp/proj_group/one_site/DOSCAR | 0
.../plovasp/proj_group/one_site/EIGENVAL | 0
.../plovasp/proj_group/one_site/IBZKPT | 0
.../plovasp/proj_group/one_site/LOCPROJ | 0
.../plovasp/proj_group/one_site/POSCAR | 0
.../plovasp/proj_group/projortho.ref.h5} | Bin
.../proj_group/projortho_2site.ref.h5} | Bin
.../proj_group/projortho_normion.ref.h5} | Bin
test/{ => python}/plovasp/proj_group/rpath.py | 0
.../plovasp/proj_group/simple.cfg | 0
.../plovasp/proj_group/simple/DOSCAR | 0
.../plovasp/proj_group/simple/IBZKPT | 0
.../plovasp/proj_group/simple/LOCPROJ | 0
.../plovasp/proj_group/simple/POSCAR | 0
.../plovasp/proj_group/test_all.py | 0
.../plovasp/proj_group/test_block_map.py | 4 +-
.../plovasp/proj_group/test_one_site.py | 16 +-
.../plovasp/proj_group/test_one_site_compl.py | 34 +-
.../plovasp/proj_group/test_select_bands.py | 4 +-
.../plovasp/proj_group/test_two_site.py | 20 +-
.../plovasp/proj_group/two_site/DOSCAR | 0
.../plovasp/proj_group/two_site/IBZKPT | 0
.../plovasp/proj_group/two_site/LOCPROJ | 0
.../plovasp/proj_group/two_site/POSCAR | 0
.../plovasp/proj_shell/.gitignore | 0
.../plovasp/proj_shell}/__init__.py | 0
.../plovasp/proj_shell/densmat.out | 0
.../plovasp/proj_shell/example.cfg | 0
.../{ => python}/plovasp/proj_shell/mytest.py | 0
.../plovasp/proj_shell/one_site/DOSCAR | 0
.../plovasp/proj_shell/one_site/IBZKPT | 0
.../plovasp/proj_shell/one_site/LOCPROJ | 0
.../plovasp/proj_shell/one_site/POSCAR | 0
.../plovasp/proj_shell/one_site/PROJCAR | 0
.../plovasp/proj_shell/one_site/readme.txt | 0
.../plovasp/proj_shell/projshells.out | 0
test/{ => python}/plovasp/proj_shell/rpath.py | 0
.../plovasp/proj_shell/test_all.py | 0
.../plovasp/proj_shell/test_projshells.py | 6 +-
test/{ => python}/plovasp/run_suite.py | 0
test/{ => python}/plovasp/vaspio/.gitignore | 0
.../plovasp/vaspio/DOSCAR.example | 0
.../plovasp/vaspio/EIGENVAL.example | 0
.../plovasp/vaspio/EIGENVAL.example.out | 0
.../plovasp/vaspio/EIGENVAL.wrong | 0
.../plovasp/vaspio/IBZKPT.example | 0
.../plovasp/vaspio/IBZKPT.example.out | 0
test/{ => python}/plovasp/vaspio/IBZKPT.notet | 0
.../plovasp/vaspio/IBZKPT.notet.out | 0
.../plovasp/vaspio/POSCAR.complex | 0
.../plovasp/vaspio/POSCAR.example | 0
.../plovasp/vaspio/POSCAR.example.out | 0
.../plovasp/vaspio}/__init__.py | 0
test/{ => python}/plovasp/vaspio/mytest.py | 0
test/{ => python}/plovasp/vaspio/rpath.py | 0
test/{ => python}/plovasp/vaspio/test_all.py | 0
.../plovasp/vaspio/test_doscar.py | 4 +-
.../plovasp/vaspio/test_eigenval.py | 4 +-
.../plovasp/vaspio/test_kpoints.py | 4 +-
.../plovasp/vaspio/test_poscar.py | 4 +-
test/{ => python}/sigma_from_file.py | 3 +-
test/python/sigma_from_file.ref.h5 | Bin 0 -> 40320 bytes
test/{ => python}/srvo3_Gloc.py | 3 +-
test/python/srvo3_Gloc.ref.h5 | Bin 0 -> 193780 bytes
test/{ => python}/srvo3_transp.py | 0
test/{ => python}/srvo3_transp.ref.h5 | Bin
test/{ => python}/sumkdft_basic.py | 0
test/{ => python}/sumkdft_basic.ref.h5 | Bin
test/{ => python}/w90_convert.py | 0
test/{ => python}/w90_convert.ref.h5 | Bin
test/{ => python}/wien2k_convert.py | 0
test/{ => python}/wien2k_convert.ref.h5 | Bin
test/sigma_from_file.ref.h5 | Bin 53696 -> 0 bytes
test/srvo3_Gloc.ref.h5 | Bin 150944 -> 0 bytes
299 files changed, 4801 insertions(+), 2214 deletions(-)
create mode 100644 .clang-tidy
create mode 100644 .gitignore
create mode 120000 ChangeLog.md
rename README.txt => README.md (100%)
rename {shells => bin}/CMakeLists.txt (80%)
rename shells/plovasp.bash.in => bin/plovasp.in (100%)
rename shells/vasp_dmft.bash.in => bin/vasp_dmft.in (100%)
delete mode 100644 c++/plovasp/atm/.gitignore
delete mode 100644 c++/plovasp/atm/CMakeLists.txt
delete mode 100644 c++/plovasp/atm/test/CMakeLists.txt
create mode 100644 c++/triqs_dft_tools/CMakeLists.txt
create mode 100644 c++/triqs_dft_tools/converters/vasp.hpp
rename c++/{plovasp/atm => triqs_dft_tools/converters/vasp}/__init__.py (100%)
rename c++/{plovasp/atm => triqs_dft_tools/converters/vasp}/argsort.cpp (100%)
rename c++/{plovasp/atm => triqs_dft_tools/converters/vasp}/argsort.hpp (100%)
rename c++/{plovasp/atm => triqs_dft_tools/converters/vasp}/dos_tetra3d.cpp (100%)
rename c++/{plovasp/atm => triqs_dft_tools/converters/vasp}/dos_tetra3d.hpp (86%)
rename c++/{plovasp/atm => triqs_dft_tools/converters/vasp}/makefile.linux (100%)
rename c++/{plovasp/atm => triqs_dft_tools/converters/vasp}/setup.py (100%)
create mode 100644 c++/triqs_dft_tools/triqs_dft_tools.hpp
create mode 100644 doc/sphinxext/autorun/__pycache__/autorun.cpython-38.pyc
create mode 100644 doc/sphinxext/autorun/autorun.py
create mode 100644 doc/sphinxext/autorun/pycon.py
create mode 100644 doc/sphinxext/numpydoc/__pycache__/docscrape.cpython-38.pyc
create mode 100644 doc/sphinxext/numpydoc/__pycache__/docscrape_sphinx.cpython-38.pyc
create mode 100644 doc/sphinxext/numpydoc/__pycache__/numpydoc.cpython-38.pyc
create mode 100644 doc/sphinxext/numpydoc/apigen.py
create mode 100644 doc/sphinxext/numpydoc/docscrape.py
create mode 100644 doc/sphinxext/numpydoc/docscrape_sphinx.py
create mode 100644 doc/sphinxext/numpydoc/inheritance_diagram.py
create mode 100644 doc/sphinxext/numpydoc/ipython_console_highlighting.py
create mode 100644 doc/sphinxext/numpydoc/numpydoc.py
create mode 100644 doc/sphinxext/numpydoc/plot_directive.py
create mode 100644 doc/sphinxext/triqs_example/triqs_example.py
create mode 100644 doc/themes/agogo/layout.html
create mode 100644 doc/themes/agogo/static/agogo.css_t
create mode 100644 doc/themes/agogo/theme.conf
create mode 100644 doc/themes/triqs/layout.html
create mode 100644 doc/themes/triqs/static/cufon-yui.js
create mode 100644 doc/themes/triqs/static/spaceman.cufonfonts.js
create mode 100644 doc/themes/triqs/static/triqs.css
create mode 100644 doc/themes/triqs/theme.conf
delete mode 100644 python/CMakeLists.txt
delete mode 100644 python/converters/.gitignore
delete mode 100644 python/converters/CMakeLists.txt
delete mode 100644 python/converters/plovasp/CMakeLists.txt
create mode 100644 python/triqs_dft_tools/CMakeLists.txt
rename python/{ => triqs_dft_tools}/__init__.py (100%)
rename python/{ => triqs_dft_tools}/block_structure.py (100%)
rename python/{ => triqs_dft_tools}/clear_h5_output.py (100%)
rename python/{ => triqs_dft_tools}/converters/__init__.py (100%)
rename python/{ => triqs_dft_tools}/converters/converter_tools.py (100%)
rename python/{ => triqs_dft_tools}/converters/hk_converter.py (100%)
rename python/{ => triqs_dft_tools}/converters/plovasp/.gitignore (100%)
rename python/{ => triqs_dft_tools}/converters/plovasp/__init__.py (100%)
rename python/{ => triqs_dft_tools}/converters/plovasp/atm_desc.py (82%)
rename python/{ => triqs_dft_tools}/converters/plovasp/converter.py (100%)
rename python/{ => triqs_dft_tools}/converters/plovasp/elstruct.py (100%)
rename python/{ => triqs_dft_tools}/converters/plovasp/inpconf.py (100%)
rename python/{ => triqs_dft_tools}/converters/plovasp/plotools.py (100%)
rename python/{ => triqs_dft_tools}/converters/plovasp/proj_group.py (100%)
rename python/{ => triqs_dft_tools}/converters/plovasp/proj_shell.py (98%)
rename python/{ => triqs_dft_tools}/converters/plovasp/sc_dmft.py (100%)
rename python/{ => triqs_dft_tools}/converters/plovasp/vaspio.py (100%)
rename python/{ => triqs_dft_tools}/converters/vasp_converter.py (100%)
rename python/{ => triqs_dft_tools}/converters/wannier90_converter.py (100%)
rename python/{ => triqs_dft_tools}/converters/wien2k_converter.py (100%)
rename python/{ => triqs_dft_tools}/sumk_dft.py (100%)
rename python/{ => triqs_dft_tools}/sumk_dft_tools.py (100%)
rename python/{ => triqs_dft_tools}/symmetry.py (100%)
rename python/{ => triqs_dft_tools}/trans_basis.py (100%)
rename python/{ => triqs_dft_tools}/update_archive.py (100%)
rename python/{ => triqs_dft_tools}/version.py.in (73%)
create mode 100644 share/CMakeLists.txt
create mode 100644 share/cmake/CMakeLists.txt
create mode 100644 share/cmake/Modules/FindSphinx.cmake
create mode 100644 share/cmake/extract_flags.cmake
create mode 100644 share/cmake/triqs_dft_tools-config-version.cmake.in
create mode 100644 share/cmake/triqs_dft_tools-config.cmake.in
create mode 100755 share/replace_and_rename.py
rename {cmake => share}/sitecustomize.py (100%)
create mode 100755 share/squash_history.sh
create mode 100644 share/triqs_dft_tools.modulefile.in
create mode 100644 share/triqs_dft_toolsvars.sh.in
create mode 100644 test/c++/CMakeLists.txt
rename {c++/plovasp/atm/test => test/c++/converters/vasp}/reorder_flag.cpp (100%)
rename {c++/plovasp/atm/test => test/c++/converters/vasp}/reorder_inds.cpp (100%)
rename {c++/plovasp/atm/test => test/c++/converters/vasp}/testing.hpp (100%)
rename {c++/plovasp/atm/test => test/c++/converters/vasp}/tet_weights.cpp (100%)
rename {c++/plovasp/atm/test => test/c++/converters/vasp}/weights1.cpp (100%)
delete mode 100644 test/plovasp/.gitignore
delete mode 100644 test/plovasp/converter/lunio3.out.h5_old
delete mode 100755 test/plovasp/converter/runtest.sh
delete mode 100644 test/plovasp/inpconf/.gitignore
delete mode 100644 test/plovasp/inpconf/parse_shells_5.cfg~
delete mode 100755 test/plovasp/inpconf/runtest.sh
delete mode 100755 test/plovasp/plocar_io/runtest.sh
delete mode 100755 test/plovasp/plotools/runtest.sh
delete mode 100644 test/plovasp/proj_group/projgroups.out
delete mode 100755 test/plovasp/proj_group/runtest.sh
delete mode 100755 test/plovasp/proj_shell/runtest.sh
delete mode 100755 test/plovasp/run_all.sh
delete mode 100644 test/plovasp/vaspio/__init__.py
delete mode 100755 test/plovasp/vaspio/runtest.sh
create mode 100644 test/python/CMakeLists.txt
rename test/{ => python}/LaVO3-Pnma.inp (100%)
rename test/{ => python}/LaVO3-Pnma_hr.dat (100%)
rename test/{ => python}/SrIrO3_rot.h5 (100%)
rename test/{ => python}/SrVO3.ctqmcout (100%)
rename test/{ => python}/SrVO3.h5 (100%)
rename test/{ => python}/SrVO3.oubwin (100%)
rename test/{ => python}/SrVO3.outputs (100%)
rename test/{ => python}/SrVO3.parproj (100%)
rename test/{ => python}/SrVO3.pmat (100%)
create mode 100644 test/python/SrVO3.ref.h5
rename test/{ => python}/SrVO3.struct (100%)
rename test/{ => python}/SrVO3.sympar (100%)
rename test/{ => python}/SrVO3.symqmc (100%)
rename test/{ => python}/SrVO3_Sigma.h5 (100%)
rename test/{ => python}/analyse_block_structure_from_gf.py (100%)
rename test/{ => python}/analyse_block_structure_from_gf.ref.h5 (100%)
rename test/{ => python}/analyse_block_structure_from_gf2.py (100%)
rename test/{ => python}/blockstructure.in.h5 (100%)
rename test/{ => python}/blockstructure.py (100%)
rename test/{ => python}/blockstructure.ref.h5 (100%)
rename test/{ => python}/hk_convert.py (100%)
rename test/{ => python}/hk_convert.ref.h5 (100%)
rename test/{ => python}/hk_convert_hamiltonian.hk (100%)
rename {c++ => test/python}/plovasp/.gitignore (100%)
rename test/{ => python}/plovasp/CMakeLists.txt (52%)
rename test/{ => python}/plovasp/atm/mytest.py (100%)
rename test/{ => python}/plovasp/atm/test_atm.py (100%)
rename test/{ => python}/plovasp/converter/example.cfg (100%)
rename test/{ => python}/plovasp/converter/lunio3.cfg (100%)
rename test/{plovasp/converter/lunio3.out.h5 => python/plovasp/converter/lunio3.ref.h5} (100%)
rename test/{ => python}/plovasp/converter/lunio3/DOSCAR (100%)
rename test/{ => python}/plovasp/converter/lunio3/IBZKPT (100%)
rename test/{ => python}/plovasp/converter/lunio3/LOCPROJ (100%)
rename test/{ => python}/plovasp/converter/lunio3/POSCAR (100%)
rename test/{ => python}/plovasp/converter/lunio3/readme.txt (100%)
rename test/{ => python}/plovasp/converter/lunio3/rot_dz2_dx2 (100%)
rename test/{ => python}/plovasp/converter/lunio3/test_lunio3.tar.gz (100%)
rename test/{ => python}/plovasp/converter/mytest.py (100%)
rename test/{ => python}/plovasp/converter/one_site/DOSCAR (100%)
rename test/{ => python}/plovasp/converter/one_site/IBZKPT (100%)
rename test/{ => python}/plovasp/converter/one_site/LOCPROJ (100%)
rename test/{ => python}/plovasp/converter/one_site/POSCAR (100%)
rename test/{ => python}/plovasp/converter/one_site/PROJCAR (100%)
rename test/{ => python}/plovasp/converter/one_site/readme.txt (100%)
rename test/{plovasp/converter/pg_output.out.h5 => python/plovasp/converter/pg_output.ref.h5} (100%)
rename test/{ => python}/plovasp/converter/rpath.py (100%)
rename test/{ => python}/plovasp/converter/test_all.py (100%)
rename test/{ => python}/plovasp/converter/test_converter_lunio3.py (90%)
rename test/{ => python}/plovasp/converter/test_converter_one_site.py (95%)
rename {python => test/python/plovasp/inpconf}/.gitignore (100%)
rename {c++/plovasp => test/python/plovasp/inpconf}/__init__.py (100%)
rename test/{ => python}/plovasp/inpconf/arraytest.py (100%)
rename test/{ => python}/plovasp/inpconf/example.cfg (100%)
rename test/{ => python}/plovasp/inpconf/example_nogroup.cfg (100%)
rename test/{ => python}/plovasp/inpconf/input_test_1.cfg (100%)
rename test/{ => python}/plovasp/inpconf/input_test_2.cfg (100%)
rename test/{ => python}/plovasp/inpconf/input_test_3.cfg (100%)
rename test/{ => python}/plovasp/inpconf/input_test_4.cfg (100%)
rename test/{ => python}/plovasp/inpconf/parse_groups_1.cfg (100%)
rename test/{ => python}/plovasp/inpconf/parse_shells_1.cfg (100%)
rename test/{ => python}/plovasp/inpconf/parse_shells_2.cfg (100%)
rename test/{ => python}/plovasp/inpconf/parse_shells_3.cfg (100%)
rename test/{ => python}/plovasp/inpconf/parse_shells_4.cfg (100%)
rename test/{ => python}/plovasp/inpconf/parse_shells_5.cfg (100%)
rename test/{ => python}/plovasp/inpconf/rpath.py (100%)
rename test/{ => python}/plovasp/inpconf/test1.cfg (100%)
rename test/{ => python}/plovasp/inpconf/test_all.py (100%)
rename test/{ => python}/plovasp/inpconf/test_general.py (95%)
rename test/{ => python}/plovasp/inpconf/test_groups.py (97%)
rename test/{ => python}/plovasp/inpconf/test_input.py (98%)
rename test/{ => python}/plovasp/inpconf/test_parameter_set.py (97%)
rename test/{ => python}/plovasp/inpconf/test_shells.py (98%)
rename test/{ => python}/plovasp/inpconf/test_special_parsers.py (99%)
rename test/{ => python}/plovasp/inpconf/tmatrix_file.dat (100%)
rename test/{ => python}/plovasp/plocar_io/.gitignore (100%)
rename test/{ => python}/plovasp/plocar_io/PLOCAR.example (100%)
rename test/{ => python}/plovasp/plocar_io/PLOCAR.example.out (100%)
rename test/{ => python}/plovasp/plocar_io/PLOCAR.noprec (100%)
rename test/{ => python}/plovasp/plocar_io/PLOCAR.prec8 (100%)
rename test/{ => python}/plovasp/plocar_io/PLOCAR.prec8.out (100%)
rename test/{ => python}/plovasp/plocar_io/PLOCAR.trunc (100%)
rename test/{ => python}/plovasp/plocar_io/mytest.py (100%)
rename test/{ => python}/plovasp/plocar_io/test_fileio.py (100%)
rename test/{ => python}/plovasp/plocar_io/test_plocar_io.py (100%)
rename test/{ => python}/plovasp/plotools/.gitignore (100%)
rename test/{ => python}/plovasp/plotools/DOSCAR (100%)
rename test/{ => python}/plovasp/plotools/EIGENVAL (100%)
rename test/{ => python}/plovasp/plotools/IBZKPT (100%)
rename test/{ => python}/plovasp/plotools/OUTCAR (100%)
rename test/{ => python}/plovasp/plotools/PLOCAR (100%)
rename test/{ => python}/plovasp/plotools/POSCAR (100%)
rename test/{ => python}/plovasp/plotools/POSCAR.complex (100%)
rename test/{ => python}/plovasp/plotools/example.cfg (100%)
rename test/{ => python}/plovasp/plotools/mytest.py (100%)
rename test/{ => python}/plovasp/plotools/rpath.py (100%)
rename test/{ => python}/plovasp/plotools/test_all.py (100%)
rename test/{ => python}/plovasp/plotools/test_consistency.py (98%)
rename test/{ => python}/plovasp/plotools/wrong_shell.cfg (100%)
rename test/{ => python}/plovasp/proj_group/.gitignore (100%)
rename test/{plovasp/inpconf => python/plovasp/proj_group}/__init__.py (100%)
rename test/{ => python}/plovasp/proj_group/block_matrix.cfg (100%)
rename test/{ => python}/plovasp/proj_group/example.cfg (100%)
rename test/{ => python}/plovasp/proj_group/example_two_site.cfg (100%)
rename test/{plovasp/proj_group/hk.out.h5 => python/plovasp/proj_group/hk.ref.h5} (100%)
rename test/{ => python}/plovasp/proj_group/mytest.py (100%)
rename test/{ => python}/plovasp/proj_group/one_site/DOSCAR (100%)
rename test/{ => python}/plovasp/proj_group/one_site/EIGENVAL (100%)
rename test/{ => python}/plovasp/proj_group/one_site/IBZKPT (100%)
rename test/{ => python}/plovasp/proj_group/one_site/LOCPROJ (100%)
rename test/{ => python}/plovasp/proj_group/one_site/POSCAR (100%)
rename test/{plovasp/proj_group/projortho.out.h5 => python/plovasp/proj_group/projortho.ref.h5} (100%)
rename test/{plovasp/proj_group/projortho_2site.out.h5 => python/plovasp/proj_group/projortho_2site.ref.h5} (100%)
rename test/{plovasp/proj_group/projortho_normion.out.h5 => python/plovasp/proj_group/projortho_normion.ref.h5} (100%)
rename test/{ => python}/plovasp/proj_group/rpath.py (100%)
rename test/{ => python}/plovasp/proj_group/simple.cfg (100%)
rename test/{ => python}/plovasp/proj_group/simple/DOSCAR (100%)
rename test/{ => python}/plovasp/proj_group/simple/IBZKPT (100%)
rename test/{ => python}/plovasp/proj_group/simple/LOCPROJ (100%)
rename test/{ => python}/plovasp/proj_group/simple/POSCAR (100%)
rename test/{ => python}/plovasp/proj_group/test_all.py (100%)
rename test/{ => python}/plovasp/proj_group/test_block_map.py (98%)
rename test/{ => python}/plovasp/proj_group/test_one_site.py (92%)
rename test/{ => python}/plovasp/proj_group/test_one_site_compl.py (92%)
rename test/{ => python}/plovasp/proj_group/test_select_bands.py (98%)
rename test/{ => python}/plovasp/proj_group/test_two_site.py (77%)
rename test/{ => python}/plovasp/proj_group/two_site/DOSCAR (100%)
rename test/{ => python}/plovasp/proj_group/two_site/IBZKPT (100%)
rename test/{ => python}/plovasp/proj_group/two_site/LOCPROJ (100%)
rename test/{ => python}/plovasp/proj_group/two_site/POSCAR (100%)
rename test/{ => python}/plovasp/proj_shell/.gitignore (100%)
rename test/{plovasp/proj_group => python/plovasp/proj_shell}/__init__.py (100%)
rename test/{ => python}/plovasp/proj_shell/densmat.out (100%)
rename test/{ => python}/plovasp/proj_shell/example.cfg (100%)
rename test/{ => python}/plovasp/proj_shell/mytest.py (100%)
rename test/{ => python}/plovasp/proj_shell/one_site/DOSCAR (100%)
rename test/{ => python}/plovasp/proj_shell/one_site/IBZKPT (100%)
rename test/{ => python}/plovasp/proj_shell/one_site/LOCPROJ (100%)
rename test/{ => python}/plovasp/proj_shell/one_site/POSCAR (100%)
rename test/{ => python}/plovasp/proj_shell/one_site/PROJCAR (100%)
rename test/{ => python}/plovasp/proj_shell/one_site/readme.txt (100%)
rename test/{ => python}/plovasp/proj_shell/projshells.out (100%)
rename test/{ => python}/plovasp/proj_shell/rpath.py (100%)
rename test/{ => python}/plovasp/proj_shell/test_all.py (100%)
rename test/{ => python}/plovasp/proj_shell/test_projshells.py (98%)
rename test/{ => python}/plovasp/run_suite.py (100%)
mode change 100644 => 100755
rename test/{ => python}/plovasp/vaspio/.gitignore (100%)
rename test/{ => python}/plovasp/vaspio/DOSCAR.example (100%)
rename test/{ => python}/plovasp/vaspio/EIGENVAL.example (100%)
rename test/{ => python}/plovasp/vaspio/EIGENVAL.example.out (100%)
rename test/{ => python}/plovasp/vaspio/EIGENVAL.wrong (100%)
rename test/{ => python}/plovasp/vaspio/IBZKPT.example (100%)
rename test/{ => python}/plovasp/vaspio/IBZKPT.example.out (100%)
rename test/{ => python}/plovasp/vaspio/IBZKPT.notet (100%)
rename test/{ => python}/plovasp/vaspio/IBZKPT.notet.out (100%)
rename test/{ => python}/plovasp/vaspio/POSCAR.complex (100%)
rename test/{ => python}/plovasp/vaspio/POSCAR.example (100%)
rename test/{ => python}/plovasp/vaspio/POSCAR.example.out (100%)
rename test/{plovasp/proj_shell => python/plovasp/vaspio}/__init__.py (100%)
rename test/{ => python}/plovasp/vaspio/mytest.py (100%)
rename test/{ => python}/plovasp/vaspio/rpath.py (100%)
rename test/{ => python}/plovasp/vaspio/test_all.py (100%)
rename test/{ => python}/plovasp/vaspio/test_doscar.py (95%)
rename test/{ => python}/plovasp/vaspio/test_eigenval.py (97%)
rename test/{ => python}/plovasp/vaspio/test_kpoints.py (97%)
rename test/{ => python}/plovasp/vaspio/test_poscar.py (97%)
rename test/{ => python}/sigma_from_file.py (93%)
create mode 100644 test/python/sigma_from_file.ref.h5
rename test/{ => python}/srvo3_Gloc.py (97%)
create mode 100644 test/python/srvo3_Gloc.ref.h5
rename test/{ => python}/srvo3_transp.py (100%)
rename test/{ => python}/srvo3_transp.ref.h5 (100%)
rename test/{ => python}/sumkdft_basic.py (100%)
rename test/{ => python}/sumkdft_basic.ref.h5 (100%)
rename test/{ => python}/w90_convert.py (100%)
rename test/{ => python}/w90_convert.ref.h5 (100%)
rename test/{ => python}/wien2k_convert.py (100%)
rename test/{ => python}/wien2k_convert.ref.h5 (100%)
delete mode 100644 test/sigma_from_file.ref.h5
delete mode 100644 test/srvo3_Gloc.ref.h5
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 00000000..03368ffa
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,2 @@
+Checks: '-*,modernize-*,cppcoreguidelines-*,-modernize-use-trailing-return-type'
+HeaderFilterRegex: 'triqs_dft_tools'
diff --git a/.dockerignore b/.dockerignore
index 6e7a76a5..b627e92a 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,2 +1,4 @@
+.travis.yml
Dockerfile
Jenkinsfile
+.git/objects/pack
diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md
index 79dfa304..db102d9e 100644
--- a/.github/ISSUE_TEMPLATE/bug.md
+++ b/.github/ISSUE_TEMPLATE/bug.md
@@ -32,7 +32,7 @@ Please provide the application version that you used.
You can get this information from copy and pasting the output of
```bash
-python -c "from app4triqs.version import *; show_version(); show_git_hash();"
+python -c "from triqs_dft_tools.version import *; show_version(); show_git_hash();"
```
from the command line. Also, please include the OS you are running and its version.
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..226118b4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+compile_commands.json
+doc/cpp2rst_generated
diff --git a/.travis.yml b/.travis.yml
index 1b2df662..7ffe737b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,47 +1,34 @@
language: cpp
sudo: required
-dist: trusty
+dist: bionic
compiler:
- gcc
- # - clang
+ - clang
before_install:
- - sudo add-apt-repository 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main' -y
- - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
- - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update
- - sudo apt-get install -y --allow-unauthenticated g++-7 clang-5.0
- - export LIBRARY_PATH=/usr/lib/llvm-5.0/lib:$LIBRARY_PATH
- - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
- - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-5.0
- - sudo apt-get install -y --allow-unauthenticated libboost-all-dev cmake git libgfortran3 gfortran openmpi-bin openmpi-common openmpi-doc libopenmpi-dev libblas-dev liblapack-dev libfftw3-dev libgmp-dev hdf5-tools libhdf5-serial-dev python-h5py python-dev python-numpy python-scipy python-jinja2 python-virtualenv python-matplotlib python-tornado python-zmq python-mpi4py python-mako clang-format-5.0 libclang-5.0-dev python-clang-5.0 python-sphinx libjs-mathjax valgrind libnfft3-dev
+ - sudo apt-get install -y --allow-unauthenticated libblas-dev libboost-all-dev libfftw3-dev libgfortran3 libhdf5-serial-dev libgmp-dev liblapack-dev libopenmpi-dev libclang-dev python-clang-6.0 python-dev python-h5py python-mako python-matplotlib python-mpi4py python-numpy python-scipy python-sphinx libjs-mathjax libnfft3-dev
install: true
script:
- # ===== Set up Cpp2Py
- - git clone https://github.com/triqs/cpp2py
- - mkdir cpp2py/build && cd cpp2py/build
- - git checkout master
- - cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/${CXX} -DPYTHON_INTERPRETER=/usr/bin/python -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/root_install
- - make -j8 install
- - cd $TRAVIS_BUILD_DIR
- - source root_install/share/cpp2pyvars.sh
+ - export INSTALL_DIR=$HOME/root_install # We install outside the repository
# ===== Set up TRIQS
- - git clone https://github.com/TRIQS/triqs --branch $TRAVIS_BRANCH
- - mkdir triqs/build && cd triqs/build
- - cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/${CXX} -DBuild_Tests=OFF -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/root_install -DCMAKE_BUILD_TYPE=Debug
- - make -j8 install
- cd $TRAVIS_BUILD_DIR
- - source root_install/share/triqsvars.sh
- # ===== Set up dft_tools and Test using fsanitize=address
+ - git clone https://github.com/TRIQS/triqs --branch unstable
+ - mkdir triqs/build && cd triqs/build
+ - cmake .. -DBuild_Tests=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR
+ - make -j2 install
+ - source $INSTALL_DIR/share/triqsvars.sh
+ # ===== Set up triqs_dft_tools and test
+ - cd $TRAVIS_BUILD_DIR
- mkdir build && cd build
- - cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/${CXX} -DCMAKE_CXX_FLAGS='-fsanitize=address -fno-omit-frame-pointer -fuse-ld=gold'
- - make -j8
- - export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-5.0/bin/llvm-symbolizer
+ - cmake .. -DASAN=ON -DUBSAN=ON
+ - export UBSAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
+ - export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
+ - export UBSAN_OPTIONS=symbolize=1:print_stacktrace=1
- export ASAN_OPTIONS=symbolize=1:detect_leaks=0
- export CTEST_OUTPUT_ON_FAILURE=1
- - if [ "$CXX" = g++ ]; then export LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/7/libasan.so; elif [ "$CXX" = clang++ ]; then export LD_PRELOAD=/usr/lib/llvm-5.0/lib/clang/5.0.1/lib/linux/libclang_rt.asan-x86_64.so; fi
- - cd test && ctest
+ - make -j2 && make test
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 669c61a2..dbb5f1ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,105 +1,167 @@
-# Start configuration
-cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
-project(triqs_dft_tools C CXX Fortran)
+# ##############################################################################
+#
+# triqs_dft_tools - An example application using triqs and cpp2py
+#
+# Copyright (C) ...
+#
+# triqs_dft_tools is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
+#
+# triqs_dft_tools is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# triqs_dft_tools (in the file COPYING.txt in this directory). If not, see
+# .
+#
+# ##############################################################################
+
+cmake_minimum_required(VERSION 3.3.2 FATAL_ERROR)
+cmake_policy(VERSION 3.3.2)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
+if(POLICY CMP0077)
+ cmake_policy(SET CMP0077 NEW)
+endif()
+
+# ############
+# Define Project
+project(triqs_dft_tools VERSION 3.0.0 LANGUAGES C CXX Fortran)
+get_directory_property(IS_SUBPROJECT PARENT_DIRECTORY)
+
+# ############
+# Load TRIQS and CPP2PY
+find_package(TRIQS 3.0 REQUIRED)
+
+# Get the git hash & print status
+triqs_get_git_hash_of_source_dir(PROJECT_GIT_HASH)
+message(STATUS "${PROJECT_NAME} version : ${PROJECT_VERSION}")
+message(STATUS "${PROJECT_NAME} Git hash: ${PROJECT_GIT_HASH}")
+
+# Enforce Consistent Versioning
+if(NOT ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} VERSION_EQUAL ${TRIQS_VERSION_MAJOR}.${TRIQS_VERSION_MINOR})
+ message(FATAL_ERROR "The ${PROJECT_NAME} version ${PROJECT_VERSION} is not compatible with TRIQS version ${TRIQS_VERSION}.")
+endif()
+
+# Default Install directory to TRIQS_ROOT if not given or invalid.
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR (NOT IS_ABSOLUTE ${CMAKE_INSTALL_PREFIX}))
+ message(STATUS "No install prefix given (or invalid). Defaulting to TRIQS_ROOT")
+ set(CMAKE_INSTALL_PREFIX ${TRIQS_ROOT} CACHE PATH "default install path" FORCE)
+ set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE)
+endif()
+if(NOT IS_SUBPROJECT)
+ message(STATUS "-------- CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} --------")
+endif()
+set(${PROJECT_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR} CACHE STRING "Binary directory of the ${PROJECT_NAME} Project")
+
+
+# ############
+# Options
+
+# Make additional Find Modules available
+list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/share/cmake/Modules)
# Default to Release build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build" FORCE)
endif()
-message( STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} --------")
-
-# Use shared libraries
-set(BUILD_SHARED_LIBS ON)
-
-# Load TRIQS and Cpp2Py
-find_package(TRIQS 2.2 REQUIRED)
-find_package(Cpp2Py 1.6 REQUIRED)
-
-if (NOT ${TRIQS_WITH_PYTHON_SUPPORT})
- MESSAGE(FATAL_ERROR "dft_tools require Python support in TRIQS")
+if(NOT IS_SUBPROJECT)
+ message(STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} --------")
endif()
-# Default Install directory to TRIQS_ROOT if not given. Checks an absolute name is given.
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR (NOT IS_ABSOLUTE ${CMAKE_INSTALL_PREFIX}))
- message(STATUS " No install prefix given (or invalid). Defaulting to TRIQS_ROOT")
- set(CMAKE_INSTALL_PREFIX ${TRIQS_ROOT} CACHE PATH "default install path" FORCE)
+# Python Support
+option(PythonSupport "Build with Python support" ON)
+if(PythonSupport AND NOT TRIQS_WITH_PYTHON_SUPPORT)
+ message(FATAL_ERROR "TRIQS was installed without Python support. Cannot build the Python Interface. Disable the build with -DPythonSupport=OFF")
endif()
-message(STATUS "-------- CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} -------------")
-# Define the dft_tools version numbers and get the git hash
-set(DFT_TOOLS_VERSION_MAJOR 2)
-set(DFT_TOOLS_VERSION_MINOR 2)
-set(DFT_TOOLS_VERSION_PATCH 0)
-set(DFT_TOOLS_VERSION ${DFT_TOOLS_VERSION_MAJOR}.${DFT_TOOLS_VERSION_MINOR}.${DFT_TOOLS_VERSION_PATCH})
-triqs_get_git_hash_of_source_dir(DFT_TOOLS_GIT_HASH)
-message(STATUS "Dft_tools version : ${DFT_TOOLS_VERSION}")
-message(STATUS "Git hash: ${DFT_TOOLS_GIT_HASH}")
+# Documentation
+option(Build_Documentation "Build documentation" OFF)
+# Testing
+option(Build_Tests "Build tests" ON)
+if(Build_Tests)
+ enable_testing()
+endif()
+
+# Export the list of compile-commands into compile_commands.json
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+# Global compiler options
+option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" OFF)
+add_compile_options(
+ $<$:-Og>
+ $<$:-ggdb3>
+)
+
+# Create an Interface target for compiler warnings
+add_library(${PROJECT_NAME}_warnings INTERFACE)
+target_compile_options(${PROJECT_NAME}_warnings
+ INTERFACE
+ -Wall
+ -Wextra
+ -Wpedantic
+ -Wno-sign-compare
+ $<$:-Wshadow=local>
+ $<$:-Wno-attributes>
+ $<$:-Wshadow>
+ $<$:-Wno-gcc-compat>
+ $<$:-Wshadow>
+ $<$:-Wno-gcc-compat>
+)
+
+# #############
+# Build Project
+
+# Find / Build dependencies
+add_subdirectory(deps)
+
+# Build and install the library
+add_subdirectory(c++/${PROJECT_NAME})
+
+# add here stuff for the Fortran part in DFTTools
add_subdirectory(fortran/dmftproj)
-# Add the compiling options (-D... ) for C++
-message(STATUS "TRIQS : Adding compilation flags detected by the library (C++11/14, libc++, etc...) ")
-
-add_subdirectory(c++)
-add_subdirectory(python python/triqs_dft_tools)
-add_subdirectory(shells)
-
-#------------------------
-# tests
-#------------------------
-
-option(TEST_COVERAGE "Analyze the coverage of tests" OFF)
-
-# perform tests with coverage info
-if (${TEST_COVERAGE})
- # we try to locate the coverage program
- find_program(PYTHON_COVERAGE python-coverage)
- find_program(PYTHON_COVERAGE coverage)
- if(NOT PYTHON_COVERAGE)
- message(FATAL_ERROR "Program coverage (or python-coverage) not found.\nEither set PYTHON_COVERAGE explicitly or disable TEST_COVERAGE!\nYou need to install the python package coverage, e.g. with\n pip install coverage\nor with\n apt install python-coverage")
- endif()
-
- message(STATUS "Setting up test coverage")
- add_custom_target(coverage ${PYTHON_COVERAGE} combine --append .coverage plovasp/.coverage || true COMMAND ${PYTHON_COVERAGE} html COMMAND echo "Open ${CMAKE_BINARY_DIR}/test/htmlcov/index.html in browser!" WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test)
+# Tests
+if(Build_Tests)
+ add_subdirectory(test)
endif()
-enable_testing()
-
-option(Build_Tests "Build the tests of the library " ON)
-if (Build_Tests)
- message(STATUS "-------- Preparing tests -------------")
- add_subdirectory(test)
+# Python
+if(PythonSupport)
+ add_subdirectory(python/${PROJECT_NAME})
endif()
-#------------------------
-# Documentation
-#------------------------
-option(Build_Documentation "Build documentation" OFF)
-if(${Build_Documentation})
- if(NOT ${TRIQS_WITH_DOCUMENTATION})
- message("Error: TRIQS library has not been compiled with its documentation")
- endif()
+# Docs
+if(Build_Documentation)
add_subdirectory(doc)
endif()
-#--------------------------------------------------------
-# Packaging
-#--------------------------------------------------------
+# dfttols vasp interface bash scripts
+add_subdirectory(bin)
+
+# Additional configuration files
+add_subdirectory(share)
+
+# #############
+# Debian Package
+
option(BUILD_DEBIAN_PACKAGE "Build a deb package" OFF)
-if(BUILD_DEBIAN_PACKAGE)
+if(BUILD_DEBIAN_PACKAGE AND NOT IS_SUBPROJECT)
if(NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr")
message(FATAL_ERROR "CMAKE_INSTALL_PREFIX must be /usr for packaging")
endif()
- SET(CPACK_GENERATOR "DEB")
- SET(CPACK_PACKAGE_VERSION ${DFT_TOOLS_VERSION})
- SET(CPACK_PACKAGE_CONTACT "https://github.com/TRIQS/dft_tools")
- EXECUTE_PROCESS(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CMAKE_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
- SET(CPACK_DEBIAN_PACKAGE_DEPENDS "triqs (>= 2.2)")
- SET(CPACK_DEBIAN_PACKAGE_CONFLICTS "dft_tools")
- SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
- SET(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
- INCLUDE(CPack)
+ set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
+ set(CPACK_GENERATOR "DEB")
+ set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
+ set(CPACK_PACKAGE_CONTACT "https://github.com/TRIQS/${PROJECT_NAME}")
+ execute_process(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CMAKE_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "triqs (>= 3.0)")
+ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
+ set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
+ include(CPack)
endif()
diff --git a/ChangeLog.md b/ChangeLog.md
new file mode 120000
index 00000000..9e080e26
--- /dev/null
+++ b/ChangeLog.md
@@ -0,0 +1 @@
+doc/ChangeLog.md
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 1d7149fb..a72f847f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,15 @@
# See ../triqs/packaging for other options
-FROM flatironinstitute/triqs:master-ubuntu-clang
+FROM flatironinstitute/triqs:unstable-ubuntu-clang
+ARG APPNAME=triqs_dft_tools
-ARG APPNAME
-COPY . $SRC/$APPNAME
+COPY requirements.txt /src/$APPNAME/requirements.txt
+RUN pip3 install -r /src/$APPNAME/requirements.txt
+
+COPY --chown=build . $SRC/$APPNAME
WORKDIR $BUILD/$APPNAME
RUN chown build .
USER build
ARG BUILD_DOC=0
-RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Documentation=${BUILD_DOC} && make -j2 && make test CTEST_OUTPUT_ON_FAILURE=1
+RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Documentation=${BUILD_DOC} && make -j2
USER root
RUN make install
diff --git a/Jenkinsfile b/Jenkinsfile
index 0cf7bdea..b5d89979 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,5 +1,6 @@
-def projectName = "dft_tools" /* set to app/repo name */
+def projectName = "triqs_dft_tools" /* set to app/repo name */
+def dockerName = projectName.toLowerCase();
/* which platform to build documentation on */
def documentationPlatform = "ubuntu-clang"
/* depend on triqs upstream branch/project */
@@ -37,7 +38,12 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
mv -f Dockerfile.jenkins Dockerfile
"""
/* build and tag */
- def img = docker.build("flatironinstitute/${projectName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} .")
+ def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} .")
+ catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
+ img.inside() {
+ sh "make -C \$BUILD/${projectName} test CTEST_OUTPUT_ON_FAILURE=1"
+ }
+ }
if (!keepInstall) {
sh "docker rmi --no-prune ${img.imageName()}"
}
@@ -48,7 +54,7 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
/****************** osx builds (on host) */
def osxPlatforms = [
["gcc", ['CC=gcc-9', 'CXX=g++-9', 'FC=gfortran-9']],
- ["clang", ['CC=$BREW/opt/llvm/bin/clang', 'CXX=$BREW/opt/llvm/bin/clang++', 'CXXFLAGS=-I$BREW/opt/llvm/include', 'LDFLAGS=-L$BREW/opt/llvm/lib', 'FC=gfortran-9']]
+ ["clang", ['CC=$BREW/opt/llvm/bin/clang', 'CXX=$BREW/opt/llvm/bin/clang++', 'FC=gfortran-9', 'CXXFLAGS=-I$BREW/opt/llvm/include', 'LDFLAGS=-L$BREW/opt/llvm/lib']]
]
for (int i = 0; i < osxPlatforms.size(); i++) {
def platformEnv = osxPlatforms[i]
@@ -72,15 +78,15 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
"CMAKE_PREFIX_PATH=$triqsDir/lib/cmake/triqs"]) {
deleteDir()
/* note: this is installing into the parent (triqs) venv (install dir), which is thus shared among apps and so not be completely safe */
- sh "pip install -r $srcDir/requirements.txt"
+ sh "pip3 install -r $srcDir/requirements.txt"
sh "cmake $srcDir -DCMAKE_INSTALL_PREFIX=$installDir -DTRIQS_ROOT=$triqsDir"
- sh "make -j3"
- try {
+ sh "make -j2"
+ catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') { try {
sh "make test CTEST_OUTPUT_ON_FAILURE=1"
} catch (exc) {
archiveArtifacts(artifacts: 'Testing/Temporary/LastTest.log')
throw exc
- }
+ } }
sh "make install"
} }
} }
@@ -95,15 +101,20 @@ try {
stage("publish") { timeout(time: 5, unit: 'MINUTES') {
def commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
def release = env.BRANCH_NAME == "master" || env.BRANCH_NAME == "unstable" || sh(returnStdout: true, script: "git describe --exact-match HEAD || true").trim()
- def workDir = pwd()
+ def workDir = pwd(tmp:true)
lock('triqs_publish') {
/* Update documention on gh-pages branch */
dir("$workDir/gh-pages") {
def subdir = "${projectName}/${env.BRANCH_NAME}"
git(url: "ssh://git@github.com/TRIQS/TRIQS.github.io.git", branch: "master", credentialsId: "ssh", changelog: false)
sh "rm -rf ${subdir}"
- docker.image("flatironinstitute/${projectName}:${env.BRANCH_NAME}-${documentationPlatform}").inside() {
- sh "cp -rp \$INSTALL/share/doc/triqs_${projectName} ${subdir}"
+ docker.image("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${documentationPlatform}").inside() {
+ sh """#!/bin/bash -ex
+ base=\$INSTALL/share/doc
+ dir="${projectName}"
+ [[ -d \$base/triqs_\$dir ]] && dir=triqs_\$dir || [[ -d \$base/\$dir ]]
+ cp -rp \$base/\$dir ${subdir}
+ """
}
sh "git add -A ${subdir}"
sh """
@@ -149,7 +160,7 @@ Changes:
End of build log:
\${BUILD_LOG,maxLines=60}
""",
- to: 'mzingl@flatironinstitute.org, hstrand@flatironinstitute.org, nwentzell@flatironinstitute.org, dsimon@flatironinstitute.org',
+ to: 'nwentzell@flatironinstitute.org',
recipientProviders: [
[$class: 'DevelopersRecipientProvider'],
],
diff --git a/README.txt b/README.md
similarity index 100%
rename from README.txt
rename to README.md
diff --git a/shells/CMakeLists.txt b/bin/CMakeLists.txt
similarity index 80%
rename from shells/CMakeLists.txt
rename to bin/CMakeLists.txt
index 42e6bc38..0d5af60b 100644
--- a/shells/CMakeLists.txt
+++ b/bin/CMakeLists.txt
@@ -1,9 +1,9 @@
-configure_file(plovasp.bash.in plovasp)
+configure_file(plovasp.in plovasp)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plovasp DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
-configure_file(vasp_dmft.bash.in vasp_dmft)
+configure_file(vasp_dmft.in vasp_dmft)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/vasp_dmft DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/shells/plovasp.bash.in b/bin/plovasp.in
similarity index 100%
rename from shells/plovasp.bash.in
rename to bin/plovasp.in
diff --git a/shells/vasp_dmft.bash.in b/bin/vasp_dmft.in
similarity index 100%
rename from shells/vasp_dmft.bash.in
rename to bin/vasp_dmft.in
diff --git a/c++/plovasp/atm/.gitignore b/c++/plovasp/atm/.gitignore
deleted file mode 100644
index 675673c3..00000000
--- a/c++/plovasp/atm/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-makefile
-Makefile
-*.so
-*.o
-*.pyc
diff --git a/c++/plovasp/atm/CMakeLists.txt b/c++/plovasp/atm/CMakeLists.txt
deleted file mode 100644
index afcb0176..00000000
--- a/c++/plovasp/atm/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-add_library(atm_c dos_tetra3d.hpp dos_tetra3d.cpp argsort.hpp argsort.cpp)
-target_link_libraries(atm_c triqs)
-target_compile_options(atm_c PRIVATE -std=c++17)
-
-install(TARGETS atm_c DESTINATION lib)
-
-add_subdirectory(test)
diff --git a/c++/plovasp/atm/test/CMakeLists.txt b/c++/plovasp/atm/test/CMakeLists.txt
deleted file mode 100644
index d592f23c..00000000
--- a/c++/plovasp/atm/test/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-enable_testing()
-
-FILE(GLOB TestList RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
-FOREACH( TestName1 ${TestList} )
- STRING(REPLACE ".cpp" "" TestName ${TestName1})
- add_executable( ${TestName} ${TestName}.cpp )
- target_link_libraries( ${TestName} atm_c triqs)
- triqs_set_rpath_for_target( ${TestName} )
- add_test(NAME ${TestName} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${t})
-ENDFOREACH( TestName1 ${TestList} )
-
-
-
diff --git a/c++/triqs_dft_tools/CMakeLists.txt b/c++/triqs_dft_tools/CMakeLists.txt
new file mode 100644
index 00000000..e847bf2f
--- /dev/null
+++ b/c++/triqs_dft_tools/CMakeLists.txt
@@ -0,0 +1,81 @@
+file(GLOB_RECURSE sources *.cpp)
+add_library(${PROJECT_NAME}_c ${sources})
+add_library(${PROJECT_NAME}::${PROJECT_NAME}_c ALIAS ${PROJECT_NAME}_c)
+
+# Link against triqs and enable warnings
+target_link_libraries(${PROJECT_NAME}_c PUBLIC triqs PRIVATE $)
+
+# Configure target and compilation
+set_property(TARGET ${PROJECT_NAME}_c PROPERTY POSITION_INDEPENDENT_CODE ON)
+target_include_directories(${PROJECT_NAME}_c PUBLIC $)
+target_include_directories(${PROJECT_NAME}_c SYSTEM INTERFACE $)
+target_compile_definitions(${PROJECT_NAME}_c PUBLIC
+ TRIQS_DFT_TOOLS_GIT_HASH=${PROJECT_GIT_HASH}
+ TRIQS_GIT_HASH=${TRIQS_GIT_HASH}
+ $<$:TRIQS_DFT_TOOLS_DEBUG>
+ $<$:TRIQS_DEBUG>
+ $<$:TRIQS_ARRAYS_ENFORCE_BOUNDCHECK>
+ )
+
+# Install library and headers
+install(TARGETS ${PROJECT_NAME}_c EXPORT ${PROJECT_NAME}-targets DESTINATION lib)
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h")
+
+
+# ========= Static Analyzer Checks ==========
+
+option(ANALYZE_SOURCES OFF "Run static analyzer checks if found (clang-tidy, cppcheck)")
+if(ANALYZE_SOURCES)
+
+ # Locate static analyzer tools
+ find_program(CPPCHECK_EXECUTABLE NAMES "cppcheck" PATHS ENV PATH)
+ find_program(CLANG_TIDY_EXECUTABLE NAMES "clang-tidy" PATHS ENV PATH)
+
+ # Run clang-tidy if found
+ if(CLANG_TIDY_EXECUTABLE)
+ message(STATUS "clang-tidy found: ${CLANG_TIDY_EXECUTABLE}")
+ set_target_properties(${PROJECT_NAME}_c PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE}")
+ else()
+ message(STATUS "clang-tidy not found in $PATH. Please consider installing clang-tidy for additional checks!")
+ endif()
+
+ # Run cppcheck if found
+ if(CPPCHECK_EXECUTABLE)
+ message(STATUS "cppcheck found: ${CPPCHECK_EXECUTABLE}")
+ add_custom_command(
+ TARGET ${PROJECT_NAME}_c
+ COMMAND ${CPPCHECK_EXECUTABLE}
+ --enable=warning,style,performance,portability
+ --std=c++17
+ --template=gcc
+ --verbose
+ --force
+ --quiet
+ ${sources}
+ WORKING_DIRECTORY
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+ else()
+ message(STATUS "cppcheck not found in $PATH. Please consider installing cppcheck for additional checks!")
+ endif()
+
+endif()
+
+
+# ========= Dynamic Analyzer Checks ==========
+
+option(ASAN OFF "Compile library and executables with LLVM Address Sanitizer")
+option(UBSAN OFF "Compile library and executables with LLVM Undefined Behavior Sanitizer")
+
+if(ASAN)
+ if(NOT TARGET asan)
+ find_package(sanitizer REQUIRED "asan")
+ endif()
+ target_link_libraries(${PROJECT_NAME}_c PUBLIC $)
+endif()
+if(UBSAN)
+ if(NOT TARGET ubsan)
+ find_package(sanitizer REQUIRED "ubsan")
+ endif()
+ target_link_libraries(${PROJECT_NAME}_c PUBLIC $)
+endif()
diff --git a/c++/triqs_dft_tools/converters/vasp.hpp b/c++/triqs_dft_tools/converters/vasp.hpp
new file mode 100644
index 00000000..0aa018d7
--- /dev/null
+++ b/c++/triqs_dft_tools/converters/vasp.hpp
@@ -0,0 +1,3 @@
+#pragma once
+#include "./vasp/argsort.hpp"
+#include "./vasp/dos_tetra3d.hpp"
diff --git a/c++/plovasp/atm/__init__.py b/c++/triqs_dft_tools/converters/vasp/__init__.py
similarity index 100%
rename from c++/plovasp/atm/__init__.py
rename to c++/triqs_dft_tools/converters/vasp/__init__.py
diff --git a/c++/plovasp/atm/argsort.cpp b/c++/triqs_dft_tools/converters/vasp/argsort.cpp
similarity index 100%
rename from c++/plovasp/atm/argsort.cpp
rename to c++/triqs_dft_tools/converters/vasp/argsort.cpp
diff --git a/c++/plovasp/atm/argsort.hpp b/c++/triqs_dft_tools/converters/vasp/argsort.hpp
similarity index 100%
rename from c++/plovasp/atm/argsort.hpp
rename to c++/triqs_dft_tools/converters/vasp/argsort.hpp
diff --git a/c++/plovasp/atm/dos_tetra3d.cpp b/c++/triqs_dft_tools/converters/vasp/dos_tetra3d.cpp
similarity index 100%
rename from c++/plovasp/atm/dos_tetra3d.cpp
rename to c++/triqs_dft_tools/converters/vasp/dos_tetra3d.cpp
diff --git a/c++/plovasp/atm/dos_tetra3d.hpp b/c++/triqs_dft_tools/converters/vasp/dos_tetra3d.hpp
similarity index 86%
rename from c++/plovasp/atm/dos_tetra3d.hpp
rename to c++/triqs_dft_tools/converters/vasp/dos_tetra3d.hpp
index abdda06b..5420f9f2 100644
--- a/c++/plovasp/atm/dos_tetra3d.hpp
+++ b/c++/triqs_dft_tools/converters/vasp/dos_tetra3d.hpp
@@ -22,16 +22,14 @@
#include
-using triqs::arrays::array;
-using triqs::arrays::array_view;
/// DOS of a band by analytical tetrahedron method
///
/// Returns corner weights for all tetrahedra for a given band and real energy.
-array
-dos_tetra_weights_3d(array_view eigk, /// Band energies for each k-point
+triqs::arrays::array
+dos_tetra_weights_3d(triqs::arrays::array_view eigk, /// Band energies for each k-point
double en, /// Energy at which DOS weights are to be calculated
- array_view itt /// Tetrahedra defined by k-point indices
+ triqs::arrays::array_view itt /// Tetrahedra defined by k-point indices
);
//array
//dos_tetra_weights_3d(array eigk, /// Band energies for each k-point
diff --git a/c++/plovasp/atm/makefile.linux b/c++/triqs_dft_tools/converters/vasp/makefile.linux
similarity index 100%
rename from c++/plovasp/atm/makefile.linux
rename to c++/triqs_dft_tools/converters/vasp/makefile.linux
diff --git a/c++/plovasp/atm/setup.py b/c++/triqs_dft_tools/converters/vasp/setup.py
similarity index 100%
rename from c++/plovasp/atm/setup.py
rename to c++/triqs_dft_tools/converters/vasp/setup.py
diff --git a/c++/triqs_dft_tools/triqs_dft_tools.hpp b/c++/triqs_dft_tools/triqs_dft_tools.hpp
new file mode 100644
index 00000000..ee70a5dc
--- /dev/null
+++ b/c++/triqs_dft_tools/triqs_dft_tools.hpp
@@ -0,0 +1,3 @@
+#pragma once
+#include "./converters/vasp.hpp"
+
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 0e137f0e..efd0c2ca 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,23 +1,80 @@
-# generate the conf.py
+# Generate the sphinx config file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY)
+# -----------------------------------------------------------------------------
+# Create an optional target that allows us to regenerate the C++ doc with c++2rst
+# -----------------------------------------------------------------------------
+add_custom_target(${PROJECT_NAME}_docs_cpp2rst)
+include(${PROJECT_SOURCE_DIR}/share/cmake/extract_flags.cmake)
+extract_flags(${PROJECT_NAME}_c BUILD_INTERFACE)
+separate_arguments(${PROJECT_NAME}_c_CXXFLAGS)
+macro(generate_docs header_file)
+ add_custom_command(
+ TARGET ${PROJECT_NAME}_docs_cpp2rst
+ COMMAND rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
+ COMMAND
+ PYTHONPATH=${CPP2PY_BINARY_DIR}:$ENV{PYTHONPATH}
+ ${CPP2PY_BINARY_DIR}/bin/c++2rst
+ ${header_file}
+ -N ${PROJECT_NAME}
+ --output_directory ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
+ -I${PROJECT_SOURCE_DIR}/c++
+ --cxxflags="${${PROJECT_NAME}_c_CXXFLAGS}"
+ )
+endmacro(generate_docs)
+
+generate_docs(${PROJECT_SOURCE_DIR}/c++/${PROJECT_NAME}/${PROJECT_NAME}.hpp)
+
+# --------------------------------------------------------
+# Build & Run the C++ doc examples and capture the output
+# --------------------------------------------------------
+
+add_custom_target(${PROJECT_NAME}_docs_example_output)
+file(GLOB_RECURSE ExampleList RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
+foreach(example ${ExampleList})
+ get_filename_component(f ${example} NAME_WE)
+ get_filename_component(d ${example} DIRECTORY)
+ add_executable(${PROJECT_NAME}_doc_${f} EXCLUDE_FROM_ALL ${example})
+ set_property(TARGET ${PROJECT_NAME}_doc_${f} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${d})
+ target_link_libraries(${PROJECT_NAME}_doc_${f} triqs)
+ add_custom_command(TARGET ${PROJECT_NAME}_doc_${f}
+ COMMAND ${PROJECT_NAME}_doc_${f} > ${CMAKE_CURRENT_SOURCE_DIR}/${d}/${f}.output 2>/dev/null
+ WORKING_DIRECTORY ${d}
+ )
+ add_dependencies(${PROJECT_NAME}_docs_example_output ${PROJECT_NAME}_doc_${f})
+endforeach()
+
# ---------------------------------
# Top Sphinx target
# ---------------------------------
-# Sources
-file(GLOB_RECURSE sources *.rst)
+if(NOT DEFINED SPHINXBUILD_EXECUTABLE)
+ find_package(Sphinx)
+endif()
-# create documentation target
-set(sphinx_top ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
-add_custom_command(OUTPUT ${sphinx_top} DEPENDS ${sources}
- COMMAND ${TRIQS_SPHINXBUILD_EXECUTABLE} -c . -j8 -b html ${CMAKE_CURRENT_SOURCE_DIR} html)
-add_custom_target(doc_sphinx ALL DEPENDS ${sphinx_top} ${CMAKE_CURRENT_BINARY_DIR})
+# Sphinx has internal caching, always run it
+add_custom_target(${PROJECT_NAME}_docs_sphinx ALL)
+add_custom_command(
+ TARGET ${PROJECT_NAME}_docs_sphinx
+ COMMAND PYTHONPATH=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SPHINXBUILD_EXECUTABLE} -c . -j8 -b html ${CMAKE_CURRENT_SOURCE_DIR} html
+)
+
+option(Sphinx_Only "When building the documentation, skip the Python Modules and the generation of C++ Api and example outputs" OFF)
+if(NOT Sphinx_Only)
+ # Autodoc usage requires the python modules to be built first
+ get_property(CPP2PY_MODULES_LIST GLOBAL PROPERTY CPP2PY_MODULES_LIST)
+ if(CPP2PY_MODULES_LIST)
+ add_dependencies(${PROJECT_NAME}_docs_sphinx ${CPP2PY_MODULES_LIST})
+ endif()
+
+ # Generation of C++ Api and Example Outputs
+ add_dependencies(${PROJECT_NAME}_docs_sphinx ${PROJECT_NAME}_docs_cpp2rst ${PROJECT_NAME}_docs_example_output)
+endif()
# ---------------------------------
# Install
# ---------------------------------
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ COMPONENT documentation DESTINATION share/doc/triqs_dft_tools
- FILES_MATCHING
- REGEX "\\.(html|pdf|png|gif|jpg|js|xsl|css|py|txt|inv|bib|cfg)$"
- PATTERN "_*"
- )
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ COMPONENT documentation DESTINATION share/doc/${PROJECT_NAME}
+ FILES_MATCHING
+ REGEX "\\.(html|pdf|png|gif|jpg|svg|js|xsl|css|py|txt|inv|bib)$"
+ PATTERN "_*"
+)
diff --git a/doc/_templates/sideb.html b/doc/_templates/sideb.html
index 24d2ffc2..563bba82 100644
--- a/doc/_templates/sideb.html
+++ b/doc/_templates/sideb.html
@@ -10,5 +10,5 @@
-
+
diff --git a/doc/changelog.rst b/doc/changelog.rst
index b1e75038..7465fef9 100644
--- a/doc/changelog.rst
+++ b/doc/changelog.rst
@@ -3,6 +3,6 @@
Changelog
=========
-This document describes the main changes in DFTTools.
+This document describes the main changes in TRIQS_DFT_TOOLS.
.. include:: ChangeLog.md
diff --git a/doc/conf.py.in b/doc/conf.py.in
index 111490f5..46897e7f 100644
--- a/doc/conf.py.in
+++ b/doc/conf.py.in
@@ -3,34 +3,36 @@
# TRIQS documentation build configuration file
import sys
-sys.path.insert(0, "@TRIQS_SPHINXEXT_PATH@/numpydoc")
+sys.path.insert(0, "@CMAKE_CURRENT_SOURCE_DIR@/sphinxext/autorun")
+sys.path.insert(0, "@CMAKE_CURRENT_SOURCE_DIR@/sphinxext/numpydoc")
sys.path.insert(0, "@CMAKE_BINARY_DIR@/python")
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.intersphinx',
- 'matplotlib.sphinxext.plot_directive',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
- 'nbsphinx',
- 'numpydoc',
'sphinx.ext.githubpages',
- 'IPython.sphinxext.ipython_console_highlighting'
- ]
+ 'matplotlib.sphinxext.plot_directive',
+ 'autorun',
+ 'nbsphinx',
+ 'IPython.sphinxext.ipython_console_highlighting',
+ 'numpydoc']
source_suffix = '.rst'
-project = 'TRIQS DFTTools'
-copyright = '2011-2019'
-version = '@DFT_TOOLS_VERSION@'
+project = '@PROJECT_NAME@'
+version = '@PROJECT_VERSION@'
-mathjax_path = "@TRIQS_MATHJAX_PATH@/MathJax.js?config=default"
-templates_path = ['@CMAKE_SOURCE_DIR@/doc/_templates']
+copyright = '2011-2020'
+
+mathjax_path = "https://raw.githubusercontent.com/mathjax/MathJax/2.7.8/MathJax.js"
+templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_templates']
html_theme = 'triqs'
-html_theme_path = ['@TRIQS_THEMES_PATH@']
+html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/themes']
html_show_sphinx = False
html_context = {'header_title': 'dft tools',
'header_subtitle': 'connecting TRIQS to DFT packages',
@@ -39,9 +41,9 @@ html_context = {'header_title': 'dft tools',
['Tutorials', 'tutorials'],
['Issues', 'issues'],
['About DFTTools', 'about']]}
-html_static_path = ['@CMAKE_SOURCE_DIR@/doc/_static']
+html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_static']
html_sidebars = {'index': ['sideb.html', 'searchbox.html']}
-htmlhelp_basename = 'TRIQSDFTToolsdoc'
+htmlhelp_basename = '@PROJECT_NAME@doc'
-intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None), 'triqslibs': ('http://triqs.github.io/triqs/latest', None), 'triqscthyb': ('https://triqs.github.io/cthyb/latest', None)}
+intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None), 'triqslibs': ('https://triqs.github.io/triqs/latest', None), 'triqscthyb': ('https://triqs.github.io/cthyb/latest', None)}
diff --git a/doc/contents.rst b/doc/contents.rst
index 4f990b6a..7b55d920 100644
--- a/doc/contents.rst
+++ b/doc/contents.rst
@@ -7,6 +7,7 @@ Table of contents
index
install
documentation
+ tutorials
issues
changelog
about
diff --git a/doc/install.rst b/doc/install.rst
index 8d2a1bc0..0def24bd 100644
--- a/doc/install.rst
+++ b/doc/install.rst
@@ -37,34 +37,41 @@ Compiling DFTTools from source
Prerequisites
-------------
-#. The :ref:`TRIQS ` toolbox.
-
+#. The :ref:`TRIQS ` library, see :ref:`TRIQS installation instruction `.
+ In the following, we assume that TRIQS is installed in the directory ``path_to_triqs``.
#. Likely, you will also need at least one impurity solver, e.g. the :ref:`CTHYB solver `.
-Installation steps
+Installation steps
------------------
-#. Download the source code by cloning the ``TRIQS/dft_tools`` repository from GitHub::
-
- $ git clone https://github.com/TRIQS/dft_tools.git dft_tools.src
-
+#. Download the source code of the latest stable version by cloning the ``TRIQS/dft_tools`` repository from GitHub::
+
+ $ git clone https://github.com/TRIQS/dft_tools dft_tools.src
+
+#. Make sure that all additional dependencies are installed on your system and available in your environment.
+ Alternatively build the dependencies from source instead with::
+
+ $ (cd deps && ./download.sh)
+
+ In this case they will be installed together with your application.
+
#. Create and move to a new directory where you will compile the code::
-
+
$ mkdir dft_tools.build && cd dft_tools.build
-
+
#. Ensure that your shell contains the TRIQS environment variables by sourcing the ``triqsvars.sh`` file from your TRIQS installation::
$ source path_to_triqs/share/triqsvarsh.sh
-
+
#. In the build directory call cmake, including any additional custom CMake options, see below::
$ cmake ../dft_tools.src
-
-#. Compile the code, run the tests and install the application::
-
- $ make
- $ make test
- $ make install
+
+#. Compile the code, run the tests and install the application::
+
+ $ make
+ $ make test
+ $ make install
Installation steps for the use with WIEN2K version 14.2 and older
@@ -114,37 +121,41 @@ Finally, you will have to change the calls to :program:`python_with_DMFT` to
your :program:`python` installation in the Wien2k :file:`path_to_Wien2k/run*` files.
-Version compatibility
+Version compatibility
---------------------
-
-Be careful that the version of the TRIQS library and of the :program:`DFTTools` must be
-compatible (more information on the :ref:`TRIQS website `.
-If you want to use a version of the :program:`DFTTools` that is not the latest one, go
-into the directory with the sources and look at all available versions::
-
- $ cd src && git tag
-
-Checkout the version of the code that you want, for instance::
-
- $ git co 2.1
-
-Then follow the steps 2 to 5 described above to compile the code.
+
+Keep in mind that the version of ``dft_tools`` must be compatible with your TRIQS library version,
+see :ref:`TRIQS website `.
+In particular the Major and Minor Version numbers have to be the same.
+To use a particular version, go into the directory with the sources, and look at all available versions::
+
+ $ cd dft_tools.src && git tag
+
+Checkout the version of the code that you want::
+
+ $ git checkout 2.1.0
+
+and follow steps 2 to 4 above to compile the code.
Custom CMake options
--------------------
-Functionality of ``dft_tools`` can be tweaked using extra compile-time options passed to CMake::
+The compilation of ``dft_tools`` can be configured using CMake-options::
- cmake -DOPTION1=value1 -DOPTION2=value2 ... ../dft_tools.src
+ cmake ../dft_tools.src -DOPTION1=value1 -DOPTION2=value2 ...
-+---------------------------------------------------------------+-----------------------------------------------+
-| Options | Syntax |
-+===============================================================+===============================================+
-| Disable testing (not recommended) | -DBuild_Tests=OFF |
-+---------------------------------------------------------------+-----------------------------------------------+
-| Build the documentation locally | -DBuild_Documentation=ON |
-+---------------------------------------------------------------+-----------------------------------------------+
-| Check test coverage when testing | -DTEST_COVERAGE=ON |
-| (run ``make coverage`` to show the results; requires the | |
-| python ``coverage`` package) | |
-+---------------------------------------------------------------+-----------------------------------------------+
++-----------------------------------------------------------------+-----------------------------------------------+
+| Options | Syntax |
++=================================================================+===============================================+
+| Specify an installation path other than path_to_triqs | -DCMAKE_INSTALL_PREFIX=path_to_dft_tools|
++-----------------------------------------------------------------+-----------------------------------------------+
+| Build in Debugging Mode | -DCMAKE_BUILD_TYPE=Debug |
++-----------------------------------------------------------------+-----------------------------------------------+
+| Disable testing (not recommended) | -DBuild_Tests=OFF |
++-----------------------------------------------------------------+-----------------------------------------------+
+| Build the documentation | -DBuild_Documentation=ON |
++-----------------------------------------------------------------+-----------------------------------------------+
+| Check test coverage when testing | -DTEST_COVERAGE=ON |
+| (run ``make coverage`` to show the results; requires the | |
+| python ``coverage`` package) | |
++-----------------------------------------------------------------+-----------------------------------------------+
diff --git a/doc/issues.rst b/doc/issues.rst
index efe3e9ca..d89de6d2 100644
--- a/doc/issues.rst
+++ b/doc/issues.rst
@@ -1,13 +1,14 @@
+.. _issues:
Reporting issues
================
Please report all problems and bugs directly at the github issue page
-``_. In order to make it easier
-for us to solve the issue please follow these guidelines:
+``_. In order to make it easier for us
+to solve the issue please follow these guidelines:
#. In all cases specify which version of the application you are using. You can
- find the version number in the file :file:`README.txt` at the root of the
+ find the version number in the file :file:`CMakeLists.txt` at the root of the
application sources.
#. If you have a problem during the installation, give us information about
diff --git a/doc/sphinxext/autorun/__pycache__/autorun.cpython-38.pyc b/doc/sphinxext/autorun/__pycache__/autorun.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..282cb6b9306fbdc9c845f588c418aa97dbea5c57
GIT binary patch
literal 2990
zcmZuzUymF)5x3ocr|0i(_5wjCZiG0ALCP%RkT}6A3UC(=>9ni}$4M=q)jRgg^rokK
zV!M;gs0SgE6Yy}~VdpV?0zL*$Jopiw^3D@HK$UxDclM5M*gM9=4GXa=~N4OBXFLVlPBXSir#=<$mxg~@2p&k!nkKY
zJNs}%jaPsk1w`wEOp1xlo(W(gzGHBz{n%Rgp_HXW$$2)L=g>6HoxRZWviMkB3Y_bH
zq!;<4QZ7;rc1&>5{f7ec5Ski5CkTXx#EjF}vCeQz7k2k!G}*4T>VYHd4u%5PJ{`Fx
zOp+p9h$Jylk}OJIho0cccZF5;staqEu>?tAwj?LhkpG<6rcnp}`8TGI=5K`xvPgq=^NHXJ0a%G%!xx9&@Jb)EUXZu@{
z6`B49E^IAgtD~(`#`^-NqrU8bknCdDLj|l<#$Bd*Zi4h&SptAH%`BMQxsbxR7iCtM
z01^RFC2?oQ<=I5bdq}n?d8*Vx0Qk9l2Nho4*?r36YkRJmlAO*5d)7*
zkY|M`N;N@t_w<24sA34!+c2Za1zl4JBIM;gvSu}_>61WyQ$vo{>@Gm?4-nj%-6L1-
zhO8a#tihnQSJNx6X50nn0+9bqw!8w<2r|-wzTd5LvlD)iY!U1^zxSy(QC5#7U8(`))
z)!Tld)ZK~@LID%{J&e%TpsUGm4k1GHPmoxjK^%TXD0#{-$s}UU!Vj{CjlW}D4Ebwn
zI{OKKgHO{snTbMNF6Dzqs2!Ja2_vg_b^sd7su-U@MNV_|V0D3>~e8aC=1SBZRTmzM9NqzmgS
z)5{7lIN*(w;4skF63RBHm)42M(
zC}sfW`V;zv}(N$+ZGN+^V
z7b{zPo~i_@Ec(tIO7XOUlbk2lJ~xMrXTVc8WA~<6u{V%BpM&{O7AHdbV5f1Xc{(%g
z=Fdbe#YBD#YgomBbfLWG<(E{um$@vM%@3pp2XQ(=*C*)L9@pP`m-iiP(d`*
z5Q;S8Ov9nMqds*U=pw=Mhk@mvsGz76_}BZ_CEz;sj2lk01Z
zHN=9ffJ;w$
zBnjLkl0*)HH<7B&5kx|%J(PzaQRysK4Tz6+?05+Wvyf^mm6qt9CJx=^S~9k`AtkYH
z8#w-FO*Vzd_IK40@$&(|*l=ne)y{2wH@45|PC
literal 0
HcmV?d00001
diff --git a/doc/sphinxext/autorun/autorun.py b/doc/sphinxext/autorun/autorun.py
new file mode 100644
index 00000000..cbd29742
--- /dev/null
+++ b/doc/sphinxext/autorun/autorun.py
@@ -0,0 +1,104 @@
+# -*- coding: utf-8 -*-
+"""
+sphinxcontirb.autorun
+~~~~~~~~~~~~~~~~~~~~~~
+
+Run the code and insert stdout after the code block.
+
+
+"""
+import os
+from subprocess import Popen,PIPE
+
+from docutils import nodes
+from docutils.parsers.rst import Directive
+from docutils.parsers.rst import directives
+from sphinx.errors import SphinxError
+from pygments import highlight
+from pygments.lexers import PythonLexer
+from pygments.formatters import HtmlFormatter
+
+class RunBlockError(SphinxError):
+ category = 'runblock error'
+
+class AutoRun:
+ here = os.path.abspath(__file__)
+ pycon = os.path.join(os.path.dirname(here),'pycon.py')
+ config = dict(
+ pycon = 'python ' + pycon,
+ pycon_prefix_chars = 4,
+ pycon_show_source = False,
+ console = 'bash',
+ console_prefix_chars = 1 ,
+ )
+ @classmethod
+ def builder_init(cls,app):
+ cls.config.update(app.builder.config.autorun_languages)
+
+
+
+class RunBlock(Directive):
+ has_content = True
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {
+ 'linenos': directives.flag,
+ }
+
+
+ def run(self):
+ config = AutoRun.config
+ language = self.arguments[0]
+
+ if language not in config:
+ raise RunBlockError('Unknown language %s' % language)
+
+
+ # Get configuration values for the language
+ args = config[language].split()
+ #input_encoding = config.get(language+'_input_encoding','ascii')
+ input_encoding = 'utf8'
+ output_encoding = 'utf8'
+ #output_encoding = config.get(language+'_output_encoding','ascii')
+ prefix_chars = config.get(language+'_prefix_chars',0)
+ show_source = config.get(language+'_show_source',True)
+
+
+ # Build the code text
+ proc = Popen(args,bufsize=1,stdin=PIPE,stdout=PIPE,stderr=PIPE)
+ codelines = (line[prefix_chars:] for line in self.content)
+ code = '\n'.join(codelines).encode(input_encoding)
+
+ # Run the code
+ stdout,stderr = proc.communicate(code)
+
+ # Process output
+ out =''
+ if stdout:
+ out += ''.join(stdout).decode(output_encoding)
+ if stderr:
+ out += ''.join(stderr).decode(output_encoding)
+
+ # Get the original code with prefixes
+ if show_source:
+ code = '\n'.join(self.content)
+ else:
+ code = ''
+ #code_out = u'\n\n ---Output:---\n'.join((highlight(code, PythonLexer(), HtmlFormatter()),out))
+ code_out = '\n\n ---Output:---\n'.join((code,out))
+
+ literal = nodes.literal_block(code_out,code_out)
+ #literal['language'] = language
+ literal['language'] = 'python'
+ literal['linenos'] = 'linenos' in self.options
+ return [literal]
+
+
+
+def setup(app):
+ app.add_directive('runblock', RunBlock)
+ app.connect('builder-inited',AutoRun.builder_init)
+ app.add_config_value('autorun_languages', AutoRun.config, 'env')
+
+# vim: set expandtab shiftwidth=4 softtabstop=4 :
diff --git a/doc/sphinxext/autorun/pycon.py b/doc/sphinxext/autorun/pycon.py
new file mode 100644
index 00000000..22ad46c8
--- /dev/null
+++ b/doc/sphinxext/autorun/pycon.py
@@ -0,0 +1,34 @@
+import sys
+from code import InteractiveInterpreter
+
+
+def main():
+ """
+ Print lines of input along with output.
+ """
+ source_lines = (line.rstrip() for line in sys.stdin)
+ console = InteractiveInterpreter()
+ source = ''
+ try:
+ while True:
+ source = next(source_lines)
+ print('>>>', source)
+ more = console.runsource(source)
+ while more:
+ next_line = next(source_lines)
+ print('...', next_line)
+ source += '\n' + next_line
+ more = console.runsource(source)
+ except StopIteration:
+ if more:
+ print('... ')
+ more = console.runsource(source + '\n')
+
+
+
+if __name__ == '__main__':
+ main()
+
+
+# vim: set expandtab shiftwidth=4 softtabstop=4 :
+
diff --git a/doc/sphinxext/numpydoc/__pycache__/docscrape.cpython-38.pyc b/doc/sphinxext/numpydoc/__pycache__/docscrape.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b83545fd8fb84fd45e91145b239f391939f353ec
GIT binary patch
literal 14820
zcmb_jZ)_aLb>Dw?w|6{J6h%>gEGuW(vUIdW$+8_gtSrm5Eyqbr8-P3Q~7r+m0x#e
zi+Cz1A5T7>N@}kvsiAl5*&$U{!|zzLWi_F8sZo>+qvmckhMHqRY2BS2!Sfz9j^}ZC
z-ld$2R&`(J$>(lHx;__GbTA+2pfwj%RC{i9DQHFYsL^g!=5>3i5?u=_GpkE4->QV|
zRgF544uYvt=|c?8nyK2ce=*XH*1`)fA@AL&>((6KZ2h@-IFBn_L=sqFgheKR0giG(
zx~Dvq!ySWF1>Ez>S4G?lGDK_EPli}jBWf4QOKMc@#(hYQsXe%t)j_ahf=1KH3xWY*!k=3;$
zd)?7vUAt@5oL0GOZ(#m5<*93Jc$*gHj(l}HS~_H>FV}T_DTo3c_KHsSe!U`9kLs0a
zQq?O$Tf^1LjYf1$Xb&r4u#Em94B+am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3~Vqd3vvVM7q>tHyZ?
zvv-C_vt5JezJwOBPjgqlialW0z(a|;>}0*(M)iN=+y@Bpv-Dzh%%@XLRr@89t;ajQj|XAQ9_`XfRKp
zugmcvW4S~!jRk|jm(|^Ysc|*8fAwE5*<^BniKu4QQv6FgdlH`mcMR`g7*wE0Xl>0jc?$^n38aMjgB435|Ux>qXS5j%qqCMjf7E
z?j0sSKoUERwkC68pZ`(F!@qK{)SPeEhGtDl=Rp?Yn0*~$g)EE
d5uQf?&p-Hz&d8@m-nQPh9xD}mujGwB{y%Moci#X2
literal 0
HcmV?d00001
diff --git a/doc/sphinxext/numpydoc/__pycache__/docscrape_sphinx.cpython-38.pyc b/doc/sphinxext/numpydoc/__pycache__/docscrape_sphinx.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..feb31f16a6174c833f7e9c4913661d975eae347a
GIT binary patch
literal 4620
zcmb7ITW=f372cU$E|)8cmK8_7#IYHpYD?FU9tyaq5V#3qCuoWifz-4p(RNL9MiS%Y
zMYGFVCMck&oCYY6{~$iPKd2A$+9&@7zqH>uLsBFy0S$$n+n$*@m+xFwU$3sl9)92c
z?caYnUGu#E&}9Bsz~mD=*Bt(G7UO~Mxhfn!cMVK6y6t}
z@>TH4Q-Lm=`i%(lf(kJYb)>`7pi#m~QAJpZuu{ZItX5P>#jiwTMTtGHR(^xKy?V{J
zmHMF5fBCrA+RIJ5dtg^SA9P!JyVu2%jXq18S%y)I$mf6lWRm?I1MLyxVEV3-%Eu*O
zPZeHyjX+hI5z#2{^E@4S7X-c#3JMPT)PwSl#=
zx~^`ZUsX5NE%X)jk@`^G!97>L^8&B227&I`D|`LJcK3KD$y@QXHRY0+rLn~G8J?_+
zMv0NQ4)q>L?Dy-#^43<>44#>GYiFlwz1LW@L8jAv8+4l;ZNuzk=UFc`5%zNPc6a-*
z*U{U}R3C32wDWCf@F@HFw%X5=yw^*!t<1ENu70ttdadn@+0)1Qc9%3xOL(%DY4&yE
zUT*bY+La{BO>(H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o@Eu$YSkMv3BXrwIAqn
z2IUE!Ws`NHF6SP~YLXqW2n6lwu6Ftv8zy{o^Vw6mx&P7Tmj{2o{pt8=x*u+hZf$+x
zZykIBgT=hu)I?KHyFrjbumyqkf}lJi2uAjXY;DLU)z$7WNeYV5GC1{->L*#6oNsSO
z;6jVffSv_q4~o13RS%4FP#aSQZnj4LW<0lmNjh?T_%`G}2zam2x~1uvKrk$-pC7f4
zvOaHz2|sK1V$}v8el9<2v#ttMmL(89A_`J|+6I?z%L0M`fyx-dsSBWL4bHW=t@u|hCo;M
zF0$FkdA9%T=D}vMuj%PZoZ>bG9T_E|l;8}Q=d}ZA1zSJ{yd99ih4@Iq!-R|Lcrm_E
z1m+Wgq26@G$JoD#6$YEw#Of2Mz@fpB9l;^-R^
zNiAcQSkxmHn9HTBRQwj!-U1&CyM?)si%}ydQ+N(3$Xtl#>FONAjR~OjcO*5QlnOR>
zN9*BGWgzVq%Lz(kFW@!Ss*@WjG
z<^lWvNCeWAP&cX{4Jzv4uQwCf4DCKQ!$Ee8g8UC}N@DN;g8rf)a`X0KOpyw?jL3
zR^EPf1n-*EhTtC#o&aenD_F1wAt%tX5tPM;c0+j!S+}7B4_cCtG3Ir8Y#f`)I&sDI
zB7AISVCKD82_0pX{Q%?#xy{`YeQ)hwpyq-9yVvG|mz7^ytOXWp%`N7)TCHY9ufD&c
zO(4^iIh}5lFVXetgqcm|B#fKtmP$9O}
zsbwH`6)SJKhzSJfM1|UZ1sw%Db1a}f{3n&MksFMhRK*Qw={lkj&0&3VfhqR!TTA`zU|23A>> docwriter = ApiDocWriter('sphinx')
+ >>> import sphinx
+ >>> docwriter.root_path == sphinx.__path__[0]
+ True
+ >>> docwriter.package_name = 'docutils'
+ >>> import docutils
+ >>> docwriter.root_path == docutils.__path__[0]
+ True
+ '''
+ # It's also possible to imagine caching the module parsing here
+ self._package_name = package_name
+ self.root_module = __import__(package_name)
+ self.root_path = self.root_module.__path__[0]
+ self.written_modules = None
+
+ package_name = property(get_package_name, set_package_name, None,
+ 'get/set package_name')
+
+ def _get_object_name(self, line):
+ ''' Get second token in line
+ >>> docwriter = ApiDocWriter('sphinx')
+ >>> docwriter._get_object_name(" def func(): ")
+ 'func'
+ >>> docwriter._get_object_name(" class Klass: ")
+ 'Klass'
+ >>> docwriter._get_object_name(" class Klass: ")
+ 'Klass'
+ '''
+ name = line.split()[1].split('(')[0].strip()
+ # in case we have classes which are not derived from object
+ # ie. old style classes
+ return name.rstrip(':')
+
+ def _uri2path(self, uri):
+ ''' Convert uri to absolute filepath
+
+ Parameters
+ ----------
+ uri : string
+ URI of python module to return path for
+
+ Returns
+ -------
+ path : None or string
+ Returns None if there is no valid path for this URI
+ Otherwise returns absolute file system path for URI
+
+ Examples
+ --------
+ >>> docwriter = ApiDocWriter('sphinx')
+ >>> import sphinx
+ >>> modpath = sphinx.__path__[0]
+ >>> res = docwriter._uri2path('sphinx.builder')
+ >>> res == os.path.join(modpath, 'builder.py')
+ True
+ >>> res = docwriter._uri2path('sphinx')
+ >>> res == os.path.join(modpath, '__init__.py')
+ True
+ >>> docwriter._uri2path('sphinx.does_not_exist')
+
+ '''
+ if uri == self.package_name:
+ return os.path.join(self.root_path, '__init__.py')
+ path = uri.replace('.', os.path.sep)
+ path = path.replace(self.package_name + os.path.sep, '')
+ path = os.path.join(self.root_path, path)
+ # XXX maybe check for extensions as well?
+ if os.path.exists(path + '.py'): # file
+ path += '.py'
+ elif os.path.exists(os.path.join(path, '__init__.py')):
+ path = os.path.join(path, '__init__.py')
+ else:
+ return None
+ return path
+
+ def _path2uri(self, dirpath):
+ ''' Convert directory path to uri '''
+ relpath = dirpath.replace(self.root_path, self.package_name)
+ if relpath.startswith(os.path.sep):
+ relpath = relpath[1:]
+ return relpath.replace(os.path.sep, '.')
+
+ def _parse_module(self, uri):
+ ''' Parse module defined in *uri* '''
+ filename = self._uri2path(uri)
+ if filename is None:
+ # nothing that we could handle here.
+ return ([],[])
+ f = open(filename, 'rt')
+ functions, classes = self._parse_lines(f)
+ f.close()
+ return functions, classes
+
+ def _parse_lines(self, linesource):
+ ''' Parse lines of text for functions and classes '''
+ functions = []
+ classes = []
+ for line in linesource:
+ if line.startswith('def ') and line.count('('):
+ # exclude private stuff
+ name = self._get_object_name(line)
+ if not name.startswith('_'):
+ functions.append(name)
+ elif line.startswith('class '):
+ # exclude private stuff
+ name = self._get_object_name(line)
+ if not name.startswith('_'):
+ classes.append(name)
+ else:
+ pass
+ functions.sort()
+ classes.sort()
+ return functions, classes
+
+ def generate_api_doc(self, uri):
+ '''Make autodoc documentation template string for a module
+
+ Parameters
+ ----------
+ uri : string
+ python location of module - e.g 'sphinx.builder'
+
+ Returns
+ -------
+ S : string
+ Contents of API doc
+ '''
+ # get the names of all classes and functions
+ functions, classes = self._parse_module(uri)
+ if not len(functions) and not len(classes):
+ print('WARNING: Empty -',uri) # dbg
+ return ''
+
+ # Make a shorter version of the uri that omits the package name for
+ # titles
+ uri_short = re.sub(r'^%s\.' % self.package_name,'',uri)
+
+ ad = '.. AUTO-GENERATED FILE -- DO NOT EDIT!\n\n'
+
+ chap_title = uri_short
+ ad += (chap_title+'\n'+ self.rst_section_levels[1] * len(chap_title)
+ + '\n\n')
+
+ # Set the chapter title to read 'module' for all modules except for the
+ # main packages
+ if '.' in uri:
+ title = 'Module: :mod:`' + uri_short + '`'
+ else:
+ title = ':mod:`' + uri_short + '`'
+ ad += title + '\n' + self.rst_section_levels[2] * len(title)
+
+ if len(classes):
+ ad += '\nInheritance diagram for ``%s``:\n\n' % uri
+ ad += '.. inheritance-diagram:: %s \n' % uri
+ ad += ' :parts: 3\n'
+
+ ad += '\n.. automodule:: ' + uri + '\n'
+ ad += '\n.. currentmodule:: ' + uri + '\n'
+ multi_class = len(classes) > 1
+ multi_fx = len(functions) > 1
+ if multi_class:
+ ad += '\n' + 'Classes' + '\n' + \
+ self.rst_section_levels[2] * 7 + '\n'
+ elif len(classes) and multi_fx:
+ ad += '\n' + 'Class' + '\n' + \
+ self.rst_section_levels[2] * 5 + '\n'
+ for c in classes:
+ ad += '\n:class:`' + c + '`\n' \
+ + self.rst_section_levels[multi_class + 2 ] * \
+ (len(c)+9) + '\n\n'
+ ad += '\n.. autoclass:: ' + c + '\n'
+ # must NOT exclude from index to keep cross-refs working
+ ad += ' :members:\n' \
+ ' :undoc-members:\n' \
+ ' :show-inheritance:\n' \
+ ' :inherited-members:\n' \
+ '\n' \
+ ' .. automethod:: __init__\n'
+ if multi_fx:
+ ad += '\n' + 'Functions' + '\n' + \
+ self.rst_section_levels[2] * 9 + '\n\n'
+ elif len(functions) and multi_class:
+ ad += '\n' + 'Function' + '\n' + \
+ self.rst_section_levels[2] * 8 + '\n\n'
+ for f in functions:
+ # must NOT exclude from index to keep cross-refs working
+ ad += '\n.. autofunction:: ' + uri + '.' + f + '\n\n'
+ return ad
+
+ def _survives_exclude(self, matchstr, match_type):
+ ''' Returns True if *matchstr* does not match patterns
+
+ ``self.package_name`` removed from front of string if present
+
+ Examples
+ --------
+ >>> dw = ApiDocWriter('sphinx')
+ >>> dw._survives_exclude('sphinx.okpkg', 'package')
+ True
+ >>> dw.package_skip_patterns.append('^\\.badpkg$')
+ >>> dw._survives_exclude('sphinx.badpkg', 'package')
+ False
+ >>> dw._survives_exclude('sphinx.badpkg', 'module')
+ True
+ >>> dw._survives_exclude('sphinx.badmod', 'module')
+ True
+ >>> dw.module_skip_patterns.append('^\\.badmod$')
+ >>> dw._survives_exclude('sphinx.badmod', 'module')
+ False
+ '''
+ if match_type == 'module':
+ patterns = self.module_skip_patterns
+ elif match_type == 'package':
+ patterns = self.package_skip_patterns
+ else:
+ raise ValueError('Cannot interpret match type "%s"'
+ % match_type)
+ # Match to URI without package name
+ L = len(self.package_name)
+ if matchstr[:L] == self.package_name:
+ matchstr = matchstr[L:]
+ for pat in patterns:
+ try:
+ pat.search
+ except AttributeError:
+ pat = re.compile(pat)
+ if pat.search(matchstr):
+ return False
+ return True
+
+ def discover_modules(self):
+ ''' Return module sequence discovered from ``self.package_name``
+
+
+ Parameters
+ ----------
+ None
+
+ Returns
+ -------
+ mods : sequence
+ Sequence of module names within ``self.package_name``
+
+ Examples
+ --------
+ >>> dw = ApiDocWriter('sphinx')
+ >>> mods = dw.discover_modules()
+ >>> 'sphinx.util' in mods
+ True
+ >>> dw.package_skip_patterns.append('\.util$')
+ >>> 'sphinx.util' in dw.discover_modules()
+ False
+ >>>
+ '''
+ modules = [self.package_name]
+ # raw directory parsing
+ for dirpath, dirnames, filenames in os.walk(self.root_path):
+ # Check directory names for packages
+ root_uri = self._path2uri(os.path.join(self.root_path,
+ dirpath))
+ for dirname in dirnames[:]: # copy list - we modify inplace
+ package_uri = '.'.join((root_uri, dirname))
+ if (self._uri2path(package_uri) and
+ self._survives_exclude(package_uri, 'package')):
+ modules.append(package_uri)
+ else:
+ dirnames.remove(dirname)
+ # Check filenames for modules
+ for filename in filenames:
+ module_name = filename[:-3]
+ module_uri = '.'.join((root_uri, module_name))
+ if (self._uri2path(module_uri) and
+ self._survives_exclude(module_uri, 'module')):
+ modules.append(module_uri)
+ return sorted(modules)
+
+ def write_modules_api(self, modules,outdir):
+ # write the list
+ written_modules = []
+ for m in modules:
+ api_str = self.generate_api_doc(m)
+ if not api_str:
+ continue
+ # write out to file
+ outfile = os.path.join(outdir,
+ m + self.rst_extension)
+ fileobj = open(outfile, 'wt')
+ fileobj.write(api_str)
+ fileobj.close()
+ written_modules.append(m)
+ self.written_modules = written_modules
+
+ def write_api_docs(self, outdir):
+ """Generate API reST files.
+
+ Parameters
+ ----------
+ outdir : string
+ Directory name in which to store files
+ We create automatic filenames for each module
+
+ Returns
+ -------
+ None
+
+ Notes
+ -----
+ Sets self.written_modules to list of written modules
+ """
+ if not os.path.exists(outdir):
+ os.mkdir(outdir)
+ # compose list of modules
+ modules = self.discover_modules()
+ self.write_modules_api(modules,outdir)
+
+ def write_index(self, outdir, froot='gen', relative_to=None):
+ """Make a reST API index file from written files
+
+ Parameters
+ ----------
+ path : string
+ Filename to write index to
+ outdir : string
+ Directory to which to write generated index file
+ froot : string, optional
+ root (filename without extension) of filename to write to
+ Defaults to 'gen'. We add ``self.rst_extension``.
+ relative_to : string
+ path to which written filenames are relative. This
+ component of the written file path will be removed from
+ outdir, in the generated index. Default is None, meaning,
+ leave path as it is.
+ """
+ if self.written_modules is None:
+ raise ValueError('No modules written')
+ # Get full filename path
+ path = os.path.join(outdir, froot+self.rst_extension)
+ # Path written into index is relative to rootpath
+ if relative_to is not None:
+ relpath = outdir.replace(relative_to + os.path.sep, '')
+ else:
+ relpath = outdir
+ idx = open(path,'wt')
+ w = idx.write
+ w('.. AUTO-GENERATED FILE -- DO NOT EDIT!\n\n')
+ w('.. toctree::\n\n')
+ for f in self.written_modules:
+ w(' %s\n' % os.path.join(relpath,f))
+ idx.close()
diff --git a/doc/sphinxext/numpydoc/docscrape.py b/doc/sphinxext/numpydoc/docscrape.py
new file mode 100644
index 00000000..25489154
--- /dev/null
+++ b/doc/sphinxext/numpydoc/docscrape.py
@@ -0,0 +1,497 @@
+"""Extract reference documentation from the NumPy source tree.
+
+"""
+
+import inspect
+import textwrap
+import re
+import pydoc
+from io import StringIO
+from warnings import warn
+4
+class Reader:
+ """A line-based string reader.
+
+ """
+ def __init__(self, data):
+ """
+ Parameters
+ ----------
+ data : str
+ String with lines separated by '\n'.
+
+ """
+ if isinstance(data,list):
+ self._str = data
+ else:
+ self._str = data.split('\n') # store string as list of lines
+
+ self.reset()
+
+ def __getitem__(self, n):
+ return self._str[n]
+
+ def reset(self):
+ self._l = 0 # current line nr
+
+ def read(self):
+ if not self.eof():
+ out = self[self._l]
+ self._l += 1
+ return out
+ else:
+ return ''
+
+ def seek_next_non_empty_line(self):
+ for l in self[self._l:]:
+ if l.strip():
+ break
+ else:
+ self._l += 1
+
+ def eof(self):
+ return self._l >= len(self._str)
+
+ def read_to_condition(self, condition_func):
+ start = self._l
+ for line in self[start:]:
+ if condition_func(line):
+ return self[start:self._l]
+ self._l += 1
+ if self.eof():
+ return self[start:self._l+1]
+ return []
+
+ def read_to_next_empty_line(self):
+ self.seek_next_non_empty_line()
+ def is_empty(line):
+ return not line.strip()
+ return self.read_to_condition(is_empty)
+
+ def read_to_next_unindented_line(self):
+ def is_unindented(line):
+ return (line.strip() and (len(line.lstrip()) == len(line)))
+ return self.read_to_condition(is_unindented)
+
+ def peek(self,n=0):
+ if self._l + n < len(self._str):
+ return self[self._l + n]
+ else:
+ return ''
+
+ def is_empty(self):
+ return not ''.join(self._str).strip()
+
+
+class NumpyDocString:
+ def __init__(self,docstring):
+ docstring = textwrap.dedent(docstring).split('\n')
+
+ self._doc = Reader(docstring)
+ self._parsed_data = {
+ 'Signature': '',
+ 'Summary': [''],
+ 'Extended Summary': [],
+ 'Parameters': [],
+ 'Returns': [],
+ 'Raises': [],
+ 'Warns': [],
+ 'Other Parameters': [],
+ 'Attributes': [],
+ 'Methods': [],
+ 'See Also': [],
+ 'Notes': [],
+ 'Warnings': [],
+ 'References': '',
+ 'Examples': '',
+ 'index': {}
+ }
+
+ self._parse()
+
+ def __getitem__(self,key):
+ return self._parsed_data[key]
+
+ def __setitem__(self,key,val):
+ if key not in self._parsed_data:
+ warn("Unknown section %s" % key)
+ else:
+ self._parsed_data[key] = val
+
+ def _is_at_section(self):
+ self._doc.seek_next_non_empty_line()
+
+ if self._doc.eof():
+ return False
+
+ l1 = self._doc.peek().strip() # e.g. Parameters
+
+ if l1.startswith('.. index::'):
+ return True
+
+ l2 = self._doc.peek(1).strip() # ---------- or ==========
+ return l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1))
+
+ def _strip(self,doc):
+ i = 0
+ j = 0
+ for i,line in enumerate(doc):
+ if line.strip(): break
+
+ for j,line in enumerate(doc[::-1]):
+ if line.strip(): break
+
+ return doc[i:len(doc)-j]
+
+ def _read_to_next_section(self):
+ section = self._doc.read_to_next_empty_line()
+
+ while not self._is_at_section() and not self._doc.eof():
+ if not self._doc.peek(-1).strip(): # previous line was empty
+ section += ['']
+
+ section += self._doc.read_to_next_empty_line()
+
+ return section
+
+ def _read_sections(self):
+ while not self._doc.eof():
+ data = self._read_to_next_section()
+ name = data[0].strip()
+
+ if name.startswith('..'): # index section
+ yield name, data[1:]
+ elif len(data) < 2:
+ yield StopIteration
+ else:
+ yield name, self._strip(data[2:])
+
+ def _parse_param_list(self,content):
+ r = Reader(content)
+ params = []
+ while not r.eof():
+ header = r.read().strip()
+ if ' : ' in header:
+ arg_name, arg_type = header.split(' : ')[:2]
+ else:
+ arg_name, arg_type = header, ''
+
+ desc = r.read_to_next_unindented_line()
+ desc = dedent_lines(desc)
+
+ params.append((arg_name,arg_type,desc))
+
+ return params
+
+
+ _name_rgx = re.compile(r"^\s*(:(?P\w+):`(?P[a-zA-Z0-9_.-]+)`|"
+ r" (?P[a-zA-Z0-9_.-]+))\s*", re.X)
+ def _parse_see_also(self, content):
+ """
+ func_name : Descriptive text
+ continued text
+ another_func_name : Descriptive text
+ func_name1, func_name2, :meth:`func_name`, func_name3
+
+ """
+ items = []
+
+ def parse_item_name(text):
+ """Match ':role:`name`' or 'name'"""
+ m = self._name_rgx.match(text)
+ if m:
+ g = m.groups()
+ if g[1] is None:
+ return g[3], None
+ else:
+ return g[2], g[1]
+ raise ValueError("%s is not a item name" % text)
+
+ def push_item(name, rest):
+ if not name:
+ return
+ name, role = parse_item_name(name)
+ items.append((name, list(rest), role))
+ del rest[:]
+
+ current_func = None
+ rest = []
+
+ for line in content:
+ if not line.strip(): continue
+
+ m = self._name_rgx.match(line)
+ if m and line[m.end():].strip().startswith(':'):
+ push_item(current_func, rest)
+ current_func, line = line[:m.end()], line[m.end():]
+ rest = [line.split(':', 1)[1].strip()]
+ if not rest[0]:
+ rest = []
+ elif not line.startswith(' '):
+ push_item(current_func, rest)
+ current_func = None
+ if ',' in line:
+ for func in line.split(','):
+ push_item(func, [])
+ elif line.strip():
+ current_func = line
+ elif current_func is not None:
+ rest.append(line.strip())
+ push_item(current_func, rest)
+ return items
+
+ def _parse_index(self, section, content):
+ """
+ .. index: default
+ :refguide: something, else, and more
+
+ """
+ def strip_each_in(lst):
+ return [s.strip() for s in lst]
+
+ out = {}
+ section = section.split('::')
+ if len(section) > 1:
+ out['default'] = strip_each_in(section[1].split(','))[0]
+ for line in content:
+ line = line.split(':')
+ if len(line) > 2:
+ out[line[1]] = strip_each_in(line[2].split(','))
+ return out
+
+ def _parse_summary(self):
+ """Grab signature (if given) and summary"""
+ if self._is_at_section():
+ return
+
+ summary = self._doc.read_to_next_empty_line()
+ summary_str = " ".join([s.strip() for s in summary]).strip()
+ if re.compile('^([\w., ]+=)?\s*[\w\.]+\(.*\)$').match(summary_str):
+ self['Signature'] = summary_str
+ if not self._is_at_section():
+ self['Summary'] = self._doc.read_to_next_empty_line()
+ else:
+ self['Summary'] = summary
+
+ if not self._is_at_section():
+ self['Extended Summary'] = self._read_to_next_section()
+
+ def _parse(self):
+ self._doc.reset()
+ self._parse_summary()
+
+ for (section,content) in self._read_sections():
+ if not section.startswith('..'):
+ section = ' '.join([s.capitalize() for s in section.split(' ')])
+ if section in ('Parameters', 'Attributes', 'Methods',
+ 'Returns', 'Raises', 'Warns'):
+ self[section] = self._parse_param_list(content)
+ elif section.startswith('.. index::'):
+ self['index'] = self._parse_index(section, content)
+ elif section == 'See Also':
+ self['See Also'] = self._parse_see_also(content)
+ else:
+ self[section] = content
+
+ # string conversion routines
+
+ def _str_header(self, name, symbol='-'):
+ return [name, len(name)*symbol]
+
+ def _str_indent(self, doc, indent=4):
+ out = []
+ for line in doc:
+ out += [' '*indent + line]
+ return out
+
+ def _str_signature(self):
+ if self['Signature']:
+ return [self['Signature'].replace('*','\*')] + ['']
+ else:
+ return ['']
+
+ def _str_summary(self):
+ if self['Summary']:
+ return self['Summary'] + ['']
+ else:
+ return []
+
+ def _str_extended_summary(self):
+ if self['Extended Summary']:
+ return self['Extended Summary'] + ['']
+ else:
+ return []
+
+ def _str_param_list(self, name):
+ out = []
+ if self[name]:
+ out += self._str_header(name)
+ for param,param_type,desc in self[name]:
+ out += ['%s : %s' % (param, param_type)]
+ out += self._str_indent(desc)
+ out += ['']
+ return out
+
+ def _str_section(self, name):
+ out = []
+ if self[name]:
+ out += self._str_header(name)
+ out += self[name]
+ out += ['']
+ return out
+
+ def _str_see_also(self, func_role):
+ if not self['See Also']: return []
+ out = []
+ out += self._str_header("See Also")
+ last_had_desc = True
+ for func, desc, role in self['See Also']:
+ if role:
+ link = ':%s:`%s`' % (role, func)
+ elif func_role:
+ link = ':%s:`%s`' % (func_role, func)
+ else:
+ link = "`%s`_" % func
+ if desc or last_had_desc:
+ out += ['']
+ out += [link]
+ else:
+ out[-1] += ", %s" % link
+ if desc:
+ out += self._str_indent([' '.join(desc)])
+ last_had_desc = True
+ else:
+ last_had_desc = False
+ out += ['']
+ return out
+
+ def _str_index(self):
+ idx = self['index']
+ out = []
+ out += ['.. index:: %s' % idx.get('default','')]
+ for section, references in idx.items():
+ if section == 'default':
+ continue
+ out += [' :%s: %s' % (section, ', '.join(references))]
+ return out
+
+ def __str__(self, func_role=''):
+ out = []
+ out += self._str_signature()
+ out += self._str_summary()
+ out += self._str_extended_summary()
+ for param_list in ('Parameters','Returns','Raises'):
+ out += self._str_param_list(param_list)
+ out += self._str_section('Warnings')
+ out += self._str_see_also(func_role)
+ for s in ('Notes','References','Examples'):
+ out += self._str_section(s)
+ out += self._str_index()
+ return '\n'.join(out)
+
+
+def indent(str,indent=4):
+ indent_str = ' '*indent
+ if str is None:
+ return indent_str
+ lines = str.split('\n')
+ return '\n'.join(indent_str + l for l in lines)
+
+def dedent_lines(lines):
+ """Deindent a list of lines maximally"""
+ return textwrap.dedent("\n".join(lines)).split("\n")
+
+def header(text, style='-'):
+ return text + '\n' + style*len(text) + '\n'
+
+
+class FunctionDoc(NumpyDocString):
+ def __init__(self, func, role='func', doc=None):
+ self._f = func
+ self._role = role # e.g. "func" or "meth"
+ if doc is None:
+ doc = inspect.getdoc(func) or ''
+ try:
+ NumpyDocString.__init__(self, doc)
+ except ValueError as e:
+ print('*'*78)
+ print("ERROR: '%s' while parsing `%s`" % (e, self._f))
+ print('*'*78)
+ #print "Docstring follows:"
+ #print doclines
+ #print '='*78
+
+ if not self['Signature']:
+ func, func_name = self.get_func()
+ try:
+ # try to read signature
+ argspec = inspect.getargspec(func)
+ argspec = inspect.formatargspec(*argspec)
+ argspec = argspec.replace('*','\*')
+ signature = '%s%s' % (func_name, argspec)
+ except TypeError as e:
+ signature = '%s()' % func_name
+ self['Signature'] = signature
+
+ def get_func(self):
+ func_name = getattr(self._f, '__name__', self.__class__.__name__)
+ if inspect.isclass(self._f):
+ func = getattr(self._f, '__call__', self._f.__init__)
+ else:
+ func = self._f
+ return func, func_name
+
+ def __str__(self):
+ out = ''
+
+ func, func_name = self.get_func()
+ signature = self['Signature'].replace('*', '\*')
+
+ roles = {'func': 'function',
+ 'meth': 'method'}
+
+ if self._role:
+ if self._role not in roles:
+ print("Warning: invalid role %s" % self._role)
+ out += '.. %s:: %s\n \n\n' % (roles.get(self._role,''),
+ func_name)
+
+ out += super(FunctionDoc, self).__str__(func_role=self._role)
+ return out
+
+
+class ClassDoc(NumpyDocString):
+ def __init__(self,cls,modulename='',func_doc=FunctionDoc,doc=None):
+ if not inspect.isclass(cls):
+ raise ValueError("Initialise using a class. Got %r" % cls)
+ self._cls = cls
+
+ if modulename and not modulename.endswith('.'):
+ modulename += '.'
+ self._mod = modulename
+ self._name = cls.__name__
+ self._func_doc = func_doc
+
+ if doc is None:
+ doc = pydoc.getdoc(cls)
+
+ NumpyDocString.__init__(self, doc)
+
+ @property
+ def methods(self):
+ return [name for name,func in inspect.getmembers(self._cls)
+ if not name.startswith('_') and callable(func)]
+
+ def __str__(self):
+ out = ''
+ out += super(ClassDoc, self).__str__()
+ out += "\n\n"
+
+ #for m in self.methods:
+ # print "Parsing `%s`" % m
+ # out += str(self._func_doc(getattr(self._cls,m), 'meth')) + '\n\n'
+ # out += '.. index::\n single: %s; %s\n\n' % (self._name, m)
+
+ return out
+
+
diff --git a/doc/sphinxext/numpydoc/docscrape_sphinx.py b/doc/sphinxext/numpydoc/docscrape_sphinx.py
new file mode 100644
index 00000000..2660f14f
--- /dev/null
+++ b/doc/sphinxext/numpydoc/docscrape_sphinx.py
@@ -0,0 +1,136 @@
+import re, inspect, textwrap, pydoc
+from docscrape import NumpyDocString, FunctionDoc, ClassDoc
+
+class SphinxDocString(NumpyDocString):
+ # string conversion routines
+ def _str_header(self, name, symbol='`'):
+ return ['.. rubric:: ' + name, '']
+
+ def _str_field_list(self, name):
+ return [':' + name + ':']
+
+ def _str_indent(self, doc, indent=4):
+ out = []
+ for line in doc:
+ out += [' '*indent + line]
+ return out
+
+ def _str_signature(self):
+ return ['']
+ if self['Signature']:
+ return ['``%s``' % self['Signature']] + ['']
+ else:
+ return ['']
+
+ def _str_summary(self):
+ return self['Summary'] + ['']
+
+ def _str_extended_summary(self):
+ return self['Extended Summary'] + ['']
+
+ def _str_param_list(self, name):
+ out = []
+ if self[name]:
+ out += self._str_field_list(name)
+ out += ['']
+ for param,param_type,desc in self[name]:
+ out += self._str_indent(['**%s** : %s' % (param.strip(),
+ param_type)])
+ out += ['']
+ out += self._str_indent(desc,8)
+ out += ['']
+ return out
+
+ def _str_section(self, name):
+ out = []
+ if self[name]:
+ out += self._str_header(name)
+ out += ['']
+ content = textwrap.dedent("\n".join(self[name])).split("\n")
+ out += content
+ out += ['']
+ return out
+
+ def _str_see_also(self, func_role):
+ out = []
+ if self['See Also']:
+ see_also = super(SphinxDocString, self)._str_see_also(func_role)
+ out = ['.. seealso::', '']
+ out += self._str_indent(see_also[2:])
+ return out
+
+ def _str_warnings(self):
+ out = []
+ if self['Warnings']:
+ out = ['.. warning::', '']
+ out += self._str_indent(self['Warnings'])
+ return out
+
+ def _str_index(self):
+ idx = self['index']
+ out = []
+ if len(idx) == 0:
+ return out
+
+ out += ['.. index:: %s' % idx.get('default','')]
+ for section, references in idx.items():
+ if section == 'default':
+ continue
+ elif section == 'refguide':
+ out += [' single: %s' % (', '.join(references))]
+ else:
+ out += [' %s: %s' % (section, ','.join(references))]
+ return out
+
+ def _str_references(self):
+ out = []
+ if self['References']:
+ out += self._str_header('References')
+ if isinstance(self['References'], str):
+ self['References'] = [self['References']]
+ out.extend(self['References'])
+ out += ['']
+ return out
+
+ def __str__(self, indent=0, func_role="obj"):
+ out = []
+ out += self._str_signature()
+ out += self._str_index() + ['']
+ out += self._str_summary()
+ out += self._str_extended_summary()
+ for param_list in ('Parameters', 'Attributes', 'Methods',
+ 'Returns','Raises'):
+ out += self._str_param_list(param_list)
+ out += self._str_warnings()
+ out += self._str_see_also(func_role)
+ out += self._str_section('Notes')
+ out += self._str_references()
+ out += self._str_section('Examples')
+ out = self._str_indent(out,indent)
+ return '\n'.join(out)
+
+class SphinxFunctionDoc(SphinxDocString, FunctionDoc):
+ pass
+
+class SphinxClassDoc(SphinxDocString, ClassDoc):
+ pass
+
+def get_doc_object(obj, what=None, doc=None):
+ if what is None:
+ if inspect.isclass(obj):
+ what = 'class'
+ elif inspect.ismodule(obj):
+ what = 'module'
+ elif callable(obj):
+ what = 'function'
+ else:
+ what = 'object'
+ if what == 'class':
+ return SphinxClassDoc(obj, '', func_doc=SphinxFunctionDoc, doc=doc)
+ elif what in ('function', 'method'):
+ return SphinxFunctionDoc(obj, '', doc=doc)
+ else:
+ if doc is None:
+ doc = pydoc.getdoc(obj)
+ return SphinxDocString(doc)
+
diff --git a/doc/sphinxext/numpydoc/inheritance_diagram.py b/doc/sphinxext/numpydoc/inheritance_diagram.py
new file mode 100644
index 00000000..a1ba7e7e
--- /dev/null
+++ b/doc/sphinxext/numpydoc/inheritance_diagram.py
@@ -0,0 +1,407 @@
+"""
+Defines a docutils directive for inserting inheritance diagrams.
+
+Provide the directive with one or more classes or modules (separated
+by whitespace). For modules, all of the classes in that module will
+be used.
+
+Example::
+
+ Given the following classes:
+
+ class A: pass
+ class B(A): pass
+ class C(A): pass
+ class D(B, C): pass
+ class E(B): pass
+
+ .. inheritance-diagram: D E
+
+ Produces a graph like the following:
+
+ A
+ / \
+ B C
+ / \ /
+ E D
+
+The graph is inserted as a PNG+image map into HTML and a PDF in
+LaTeX.
+"""
+
+import inspect
+import os
+import re
+import subprocess
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import md5
+
+from docutils.nodes import Body, Element
+from docutils.parsers.rst import directives
+from sphinx.roles import xfileref_role
+
+def my_import(name):
+ """Module importer - taken from the python documentation.
+
+ This function allows importing names with dots in them."""
+
+ mod = __import__(name)
+ components = name.split('.')
+ for comp in components[1:]:
+ mod = getattr(mod, comp)
+ return mod
+
+class DotException(Exception):
+ pass
+
+class InheritanceGraph:
+ """
+ Given a list of classes, determines the set of classes that
+ they inherit from all the way to the root "object", and then
+ is able to generate a graphviz dot graph from them.
+ """
+ def __init__(self, class_names, show_builtins=False):
+ """
+ *class_names* is a list of child classes to show bases from.
+
+ If *show_builtins* is True, then Python builtins will be shown
+ in the graph.
+ """
+ self.class_names = class_names
+ self.classes = self._import_classes(class_names)
+ self.all_classes = self._all_classes(self.classes)
+ if len(self.all_classes) == 0:
+ raise ValueError("No classes found for inheritance diagram")
+ self.show_builtins = show_builtins
+
+ py_sig_re = re.compile(r'''^([\w.]*\.)? # class names
+ (\w+) \s* $ # optionally arguments
+ ''', re.VERBOSE)
+
+ def _import_class_or_module(self, name):
+ """
+ Import a class using its fully-qualified *name*.
+ """
+ try:
+ path, base = self.py_sig_re.match(name).groups()
+ except:
+ raise ValueError(
+ "Invalid class or module '%s' specified for inheritance diagram" % name)
+ fullname = (path or '') + base
+ path = (path and path.rstrip('.'))
+ if not path:
+ path = base
+ try:
+ module = __import__(path, None, None, [])
+ # We must do an import of the fully qualified name. Otherwise if a
+ # subpackage 'a.b' is requested where 'import a' does NOT provide
+ # 'a.b' automatically, then 'a.b' will not be found below. This
+ # second call will force the equivalent of 'import a.b' to happen
+ # after the top-level import above.
+ my_import(fullname)
+
+ except ImportError:
+ raise ValueError(
+ "Could not import class or module '%s' specified for inheritance diagram" % name)
+
+ try:
+ todoc = module
+ for comp in fullname.split('.')[1:]:
+ todoc = getattr(todoc, comp)
+ except AttributeError:
+ raise ValueError(
+ "Could not find class or module '%s' specified for inheritance diagram" % name)
+
+ # If a class, just return it
+ if inspect.isclass(todoc):
+ return [todoc]
+ elif inspect.ismodule(todoc):
+ classes = []
+ for cls in list(todoc.__dict__.values()):
+ if inspect.isclass(cls) and cls.__module__ == todoc.__name__:
+ classes.append(cls)
+ return classes
+ raise ValueError(
+ "'%s' does not resolve to a class or module" % name)
+
+ def _import_classes(self, class_names):
+ """
+ Import a list of classes.
+ """
+ classes = []
+ for name in class_names:
+ classes.extend(self._import_class_or_module(name))
+ return classes
+
+ def _all_classes(self, classes):
+ """
+ Return a list of all classes that are ancestors of *classes*.
+ """
+ all_classes = {}
+
+ def recurse(cls):
+ all_classes[cls] = None
+ for c in cls.__bases__:
+ if c not in all_classes:
+ recurse(c)
+
+ for cls in classes:
+ recurse(cls)
+
+ return list(all_classes.keys())
+
+ def class_name(self, cls, parts=0):
+ """
+ Given a class object, return a fully-qualified name. This
+ works for things I've tested in matplotlib so far, but may not
+ be completely general.
+ """
+ module = cls.__module__
+ if module == '__builtin__':
+ fullname = cls.__name__
+ else:
+ fullname = "%s.%s" % (module, cls.__name__)
+ if parts == 0:
+ return fullname
+ name_parts = fullname.split('.')
+ return '.'.join(name_parts[-parts:])
+
+ def get_all_class_names(self):
+ """
+ Get all of the class names involved in the graph.
+ """
+ return [self.class_name(x) for x in self.all_classes]
+
+ # These are the default options for graphviz
+ default_graph_options = {
+ "rankdir": "LR",
+ "size": '"8.0, 12.0"'
+ }
+ default_node_options = {
+ "shape": "box",
+ "fontsize": 10,
+ "height": 0.25,
+ "fontname": "Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",
+ "style": '"setlinewidth(0.5)"'
+ }
+ default_edge_options = {
+ "arrowsize": 0.5,
+ "style": '"setlinewidth(0.5)"'
+ }
+
+ def _format_node_options(self, options):
+ return ','.join(["%s=%s" % x for x in list(options.items())])
+ def _format_graph_options(self, options):
+ return ''.join(["%s=%s;\n" % x for x in list(options.items())])
+
+ def generate_dot(self, fd, name, parts=0, urls={},
+ graph_options={}, node_options={},
+ edge_options={}):
+ """
+ Generate a graphviz dot graph from the classes that
+ were passed in to __init__.
+
+ *fd* is a Python file-like object to write to.
+
+ *name* is the name of the graph
+
+ *urls* is a dictionary mapping class names to http urls
+
+ *graph_options*, *node_options*, *edge_options* are
+ dictionaries containing key/value pairs to pass on as graphviz
+ properties.
+ """
+ g_options = self.default_graph_options.copy()
+ g_options.update(graph_options)
+ n_options = self.default_node_options.copy()
+ n_options.update(node_options)
+ e_options = self.default_edge_options.copy()
+ e_options.update(edge_options)
+
+ fd.write('digraph %s {\n' % name)
+ fd.write(self._format_graph_options(g_options))
+
+ for cls in self.all_classes:
+ if not self.show_builtins and cls in list(__builtins__.values()):
+ continue
+
+ name = self.class_name(cls, parts)
+
+ # Write the node
+ this_node_options = n_options.copy()
+ url = urls.get(self.class_name(cls))
+ if url is not None:
+ this_node_options['URL'] = '"%s"' % url
+ fd.write(' "%s" [%s];\n' %
+ (name, self._format_node_options(this_node_options)))
+
+ # Write the edges
+ for base in cls.__bases__:
+ if not self.show_builtins and base in list(__builtins__.values()):
+ continue
+
+ base_name = self.class_name(base, parts)
+ fd.write(' "%s" -> "%s" [%s];\n' %
+ (base_name, name,
+ self._format_node_options(e_options)))
+ fd.write('}\n')
+
+ def run_dot(self, args, name, parts=0, urls={},
+ graph_options={}, node_options={}, edge_options={}):
+ """
+ Run graphviz 'dot' over this graph, returning whatever 'dot'
+ writes to stdout.
+
+ *args* will be passed along as commandline arguments.
+
+ *name* is the name of the graph
+
+ *urls* is a dictionary mapping class names to http urls
+
+ Raises DotException for any of the many os and
+ installation-related errors that may occur.
+ """
+ try:
+ dot = subprocess.Popen(['dot'] + list(args),
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ close_fds=True)
+ except OSError:
+ raise DotException("Could not execute 'dot'. Are you sure you have 'graphviz' installed?")
+ except ValueError:
+ raise DotException("'dot' called with invalid arguments")
+ except:
+ raise DotException("Unexpected error calling 'dot'")
+
+ self.generate_dot(dot.stdin, name, parts, urls, graph_options,
+ node_options, edge_options)
+ dot.stdin.close()
+ result = dot.stdout.read()
+ returncode = dot.wait()
+ if returncode != 0:
+ raise DotException("'dot' returned the errorcode %d" % returncode)
+ return result
+
+class inheritance_diagram(Body, Element):
+ """
+ A docutils node to use as a placeholder for the inheritance
+ diagram.
+ """
+ pass
+
+def inheritance_diagram_directive(name, arguments, options, content, lineno,
+ content_offset, block_text, state,
+ state_machine):
+ """
+ Run when the inheritance_diagram directive is first encountered.
+ """
+ node = inheritance_diagram()
+
+ class_names = arguments
+
+ # Create a graph starting with the list of classes
+ graph = InheritanceGraph(class_names)
+
+ # Create xref nodes for each target of the graph's image map and
+ # add them to the doc tree so that Sphinx can resolve the
+ # references to real URLs later. These nodes will eventually be
+ # removed from the doctree after we're done with them.
+ for name in graph.get_all_class_names():
+ refnodes, x = xfileref_role(
+ 'class', ':class:`%s`' % name, name, 0, state)
+ node.extend(refnodes)
+ # Store the graph object so we can use it to generate the
+ # dot file later
+ node['graph'] = graph
+ # Store the original content for use as a hash
+ node['parts'] = options.get('parts', 0)
+ node['content'] = " ".join(class_names)
+ return [node]
+
+def get_graph_hash(node):
+ return md5(node['content'] + str(node['parts'])).hexdigest()[-10:]
+
+def html_output_graph(self, node):
+ """
+ Output the graph for HTML. This will insert a PNG with clickable
+ image map.
+ """
+ graph = node['graph']
+ parts = node['parts']
+
+ graph_hash = get_graph_hash(node)
+ name = "inheritance%s" % graph_hash
+ path = '_images'
+ dest_path = os.path.join(setup.app.builder.outdir, path)
+ if not os.path.exists(dest_path):
+ os.makedirs(dest_path)
+ png_path = os.path.join(dest_path, name + ".png")
+ path = setup.app.builder.imgpath
+
+ # Create a mapping from fully-qualified class names to URLs.
+ urls = {}
+ for child in node:
+ if child.get('refuri') is not None:
+ urls[child['reftitle']] = child.get('refuri')
+ elif child.get('refid') is not None:
+ urls[child['reftitle']] = '#' + child.get('refid')
+
+ # These arguments to dot will save a PNG file to disk and write
+ # an HTML image map to stdout.
+ image_map = graph.run_dot(['-Tpng', '-o%s' % png_path, '-Tcmapx'],
+ name, parts, urls)
+ return ('
%s' %
+ (path, name, name, image_map))
+
+def latex_output_graph(self, node):
+ """
+ Output the graph for LaTeX. This will insert a PDF.
+ """
+ graph = node['graph']
+ parts = node['parts']
+
+ graph_hash = get_graph_hash(node)
+ name = "inheritance%s" % graph_hash
+ dest_path = os.path.abspath(os.path.join(setup.app.builder.outdir, '_images'))
+ if not os.path.exists(dest_path):
+ os.makedirs(dest_path)
+ pdf_path = os.path.abspath(os.path.join(dest_path, name + ".pdf"))
+
+ graph.run_dot(['-Tpdf', '-o%s' % pdf_path],
+ name, parts, graph_options={'size': '"6.0,6.0"'})
+ return '\n\\includegraphics{%s}\n\n' % pdf_path
+
+def visit_inheritance_diagram(inner_func):
+ """
+ This is just a wrapper around html/latex_output_graph to make it
+ easier to handle errors and insert warnings.
+ """
+ def visitor(self, node):
+ try:
+ content = inner_func(self, node)
+ except DotException as e:
+ # Insert the exception as a warning in the document
+ warning = self.document.reporter.warning(str(e), line=node.line)
+ warning.parent = node
+ node.children = [warning]
+ else:
+ source = self.document.attributes['source']
+ self.body.append(content)
+ node.children = []
+ return visitor
+
+def do_nothing(self, node):
+ pass
+
+def setup(app):
+ setup.app = app
+ setup.confdir = app.confdir
+
+ app.add_node(
+ inheritance_diagram,
+ latex=(visit_inheritance_diagram(latex_output_graph), do_nothing),
+ html=(visit_inheritance_diagram(html_output_graph), do_nothing))
+ app.add_directive(
+ 'inheritance-diagram', inheritance_diagram_directive,
+ False, (1, 100, 0), parts = directives.nonnegative_int)
diff --git a/doc/sphinxext/numpydoc/ipython_console_highlighting.py b/doc/sphinxext/numpydoc/ipython_console_highlighting.py
new file mode 100644
index 00000000..217b779d
--- /dev/null
+++ b/doc/sphinxext/numpydoc/ipython_console_highlighting.py
@@ -0,0 +1,114 @@
+"""reST directive for syntax-highlighting ipython interactive sessions.
+
+XXX - See what improvements can be made based on the new (as of Sept 2009)
+'pycon' lexer for the python console. At the very least it will give better
+highlighted tracebacks.
+"""
+
+#-----------------------------------------------------------------------------
+# Needed modules
+
+# Standard library
+import re
+
+# Third party
+from pygments.lexer import Lexer, do_insertions
+from pygments.lexers.agile import (PythonConsoleLexer, PythonLexer,
+ PythonTracebackLexer)
+from pygments.token import Comment, Generic
+
+from sphinx import highlighting
+
+#-----------------------------------------------------------------------------
+# Global constants
+line_re = re.compile('.*?\n')
+
+#-----------------------------------------------------------------------------
+# Code begins - classes and functions
+
+class IPythonConsoleLexer(Lexer):
+ """
+ For IPython console output or doctests, such as:
+
+ .. sourcecode:: ipython
+
+ In [1]: a = 'foo'
+
+ In [2]: a
+ Out[2]: 'foo'
+
+ In [3]: print a
+ foo
+
+ In [4]: 1 / 0
+
+ Notes:
+
+ - Tracebacks are not currently supported.
+
+ - It assumes the default IPython prompts, not customized ones.
+ """
+
+ name = 'IPython console session'
+ aliases = ['ipython']
+ mimetypes = ['text/x-ipython-console']
+ input_prompt = re.compile("(In \[[0-9]+\]: )|( \.\.\.+:)")
+ output_prompt = re.compile("(Out\[[0-9]+\]: )|( \.\.\.+:)")
+ continue_prompt = re.compile(" \.\.\.+:")
+ tb_start = re.compile("\-+")
+
+ def get_tokens_unprocessed(self, text):
+ pylexer = PythonLexer(**self.options)
+ tblexer = PythonTracebackLexer(**self.options)
+
+ curcode = ''
+ insertions = []
+ for match in line_re.finditer(text):
+ line = match.group()
+ input_prompt = self.input_prompt.match(line)
+ continue_prompt = self.continue_prompt.match(line.rstrip())
+ output_prompt = self.output_prompt.match(line)
+ if line.startswith("#"):
+ insertions.append((len(curcode),
+ [(0, Comment, line)]))
+ elif input_prompt is not None:
+ insertions.append((len(curcode),
+ [(0, Generic.Prompt, input_prompt.group())]))
+ curcode += line[input_prompt.end():]
+ elif continue_prompt is not None:
+ insertions.append((len(curcode),
+ [(0, Generic.Prompt, continue_prompt.group())]))
+ curcode += line[continue_prompt.end():]
+ elif output_prompt is not None:
+ # Use the 'error' token for output. We should probably make
+ # our own token, but error is typicaly in a bright color like
+ # red, so it works fine for our output prompts.
+ insertions.append((len(curcode),
+ [(0, Generic.Error, output_prompt.group())]))
+ curcode += line[output_prompt.end():]
+ else:
+ if curcode:
+ for item in do_insertions(insertions,
+ pylexer.get_tokens_unprocessed(curcode)):
+ yield item
+ curcode = ''
+ insertions = []
+ yield match.start(), Generic.Output, line
+ if curcode:
+ for item in do_insertions(insertions,
+ pylexer.get_tokens_unprocessed(curcode)):
+ yield item
+
+
+def setup(app):
+ """Setup as a sphinx extension."""
+
+ # This is only a lexer, so adding it below to pygments appears sufficient.
+ # But if somebody knows that the right API usage should be to do that via
+ # sphinx, by all means fix it here. At least having this setup.py
+ # suppresses the sphinx warning we'd get without it.
+ pass
+
+#-----------------------------------------------------------------------------
+# Register the extension as a valid pygments lexer
+highlighting.lexers['ipython'] = IPythonConsoleLexer()
diff --git a/doc/sphinxext/numpydoc/numpydoc.py b/doc/sphinxext/numpydoc/numpydoc.py
new file mode 100644
index 00000000..eea482dc
--- /dev/null
+++ b/doc/sphinxext/numpydoc/numpydoc.py
@@ -0,0 +1,116 @@
+"""
+========
+numpydoc
+========
+
+Sphinx extension that handles docstrings in the Numpy standard format. [1]
+
+It will:
+
+- Convert Parameters etc. sections to field lists.
+- Convert See Also section to a See also entry.
+- Renumber references.
+- Extract the signature from the docstring, if it can't be determined otherwise.
+
+.. [1] http://projects.scipy.org/scipy/numpy/wiki/CodingStyleGuidelines#docstring-standard
+
+"""
+
+import os, re, pydoc
+from docscrape_sphinx import get_doc_object, SphinxDocString
+import inspect
+
+def mangle_docstrings(app, what, name, obj, options, lines,
+ reference_offset=[0]):
+ if what == 'module':
+ # Strip top title
+ title_re = re.compile(r'^\s*[#*=]{4,}\n[a-z0-9 -]+\n[#*=]{4,}\s*',
+ re.I|re.S)
+ lines[:] = title_re.sub('', "\n".join(lines)).split("\n")
+ else:
+ doc = get_doc_object(obj, what, "\n".join(lines))
+ lines[:] = str(doc).split("\n")
+
+ if app.config.numpydoc_edit_link and hasattr(obj, '__name__') and \
+ obj.__name__:
+ if hasattr(obj, '__module__'):
+ v = dict(full_name="%s.%s" % (obj.__module__, obj.__name__))
+ else:
+ v = dict(full_name=obj.__name__)
+ lines += ['', '.. htmlonly::', '']
+ lines += [' %s' % x for x in
+ (app.config.numpydoc_edit_link % v).split("\n")]
+
+ # replace reference numbers so that there are no duplicates
+ references = []
+ for l in lines:
+ l = l.strip()
+ if l.startswith('.. ['):
+ try:
+ references.append(int(l[len('.. ['):l.index(']')]))
+ except ValueError:
+ print("WARNING: invalid reference in %s docstring" % name)
+
+ # Start renaming from the biggest number, otherwise we may
+ # overwrite references.
+ references.sort()
+ if references:
+ for i, line in enumerate(lines):
+ for r in references:
+ new_r = reference_offset[0] + r
+ lines[i] = lines[i].replace('[%d]_' % r,
+ '[%d]_' % new_r)
+ lines[i] = lines[i].replace('.. [%d]' % r,
+ '.. [%d]' % new_r)
+
+ reference_offset[0] += len(references)
+
+def mangle_signature(app, what, name, obj, options, sig, retann):
+ # Do not try to inspect classes that don't define `__init__`
+ if (inspect.isclass(obj) and
+ 'initializes x; see ' in pydoc.getdoc(obj.__init__)):
+ return '', ''
+
+ if not (callable(obj) or hasattr(obj, '__argspec_is_invalid_')): return
+ if not hasattr(obj, '__doc__'): return
+
+ doc = SphinxDocString(pydoc.getdoc(obj))
+ if doc['Signature']:
+ sig = re.sub("^[^(]*", "", doc['Signature'])
+ return sig, ''
+
+def initialize(app):
+ try:
+ app.connect('autodoc-process-signature', mangle_signature)
+ except:
+ monkeypatch_sphinx_ext_autodoc()
+
+def setup(app, get_doc_object_=get_doc_object):
+ global get_doc_object
+ get_doc_object = get_doc_object_
+
+ app.connect('autodoc-process-docstring', mangle_docstrings)
+ app.connect('builder-inited', initialize)
+ app.add_config_value('numpydoc_edit_link', None, True)
+
+#------------------------------------------------------------------------------
+# Monkeypatch sphinx.ext.autodoc to accept argspecless autodocs (Sphinx < 0.5)
+#------------------------------------------------------------------------------
+
+def monkeypatch_sphinx_ext_autodoc():
+ global _original_format_signature
+ import sphinx.ext.autodoc
+
+ if sphinx.ext.autodoc.format_signature is our_format_signature:
+ return
+
+ print("[numpydoc] Monkeypatching sphinx.ext.autodoc ...")
+ _original_format_signature = sphinx.ext.autodoc.format_signature
+ sphinx.ext.autodoc.format_signature = our_format_signature
+
+def our_format_signature(what, obj):
+ r = mangle_signature(None, what, None, obj, None, None, None)
+ if r is not None:
+ return r[0]
+ else:
+ return _original_format_signature(what, obj)
diff --git a/doc/sphinxext/numpydoc/plot_directive.py b/doc/sphinxext/numpydoc/plot_directive.py
new file mode 100644
index 00000000..be03c357
--- /dev/null
+++ b/doc/sphinxext/numpydoc/plot_directive.py
@@ -0,0 +1,773 @@
+"""
+A directive for including a matplotlib plot in a Sphinx document.
+
+By default, in HTML output, `plot` will include a .png file with a
+link to a high-res .png and .pdf. In LaTeX output, it will include a
+.pdf.
+
+The source code for the plot may be included in one of three ways:
+
+ 1. **A path to a source file** as the argument to the directive::
+
+ .. plot:: path/to/plot.py
+
+ When a path to a source file is given, the content of the
+ directive may optionally contain a caption for the plot::
+
+ .. plot:: path/to/plot.py
+
+ This is the caption for the plot
+
+ Additionally, one my specify the name of a function to call (with
+ no arguments) immediately after importing the module::
+
+ .. plot:: path/to/plot.py plot_function1
+
+ 2. Included as **inline content** to the directive::
+
+ .. plot::
+
+ import matplotlib.pyplot as plt
+ import matplotlib.image as mpimg
+ import numpy as np
+ img = mpimg.imread('_static/stinkbug.png')
+ imgplot = plt.imshow(img)
+
+ 3. Using **doctest** syntax::
+
+ .. plot::
+ A plotting example:
+ >>> import matplotlib.pyplot as plt
+ >>> plt.plot([1,2,3], [4,5,6])
+
+Options
+-------
+
+The ``plot`` directive supports the following options:
+
+ format : {'python', 'doctest'}
+ Specify the format of the input
+
+ include-source : bool
+ Whether to display the source code. The default can be changed
+ using the `plot_include_source` variable in conf.py
+
+ encoding : str
+ If this source file is in a non-UTF8 or non-ASCII encoding,
+ the encoding must be specified using the `:encoding:` option.
+ The encoding will not be inferred using the ``-*- coding -*-``
+ metacomment.
+
+ context : bool
+ If provided, the code will be run in the context of all
+ previous plot directives for which the `:context:` option was
+ specified. This only applies to inline code plot directives,
+ not those run from files.
+
+ nofigs : bool
+ If specified, the code block will be run, but no figures will
+ be inserted. This is usually useful with the ``:context:``
+ option.
+
+Additionally, this directive supports all of the options of the
+`image` directive, except for `target` (since plot will add its own
+target). These include `alt`, `height`, `width`, `scale`, `align` and
+`class`.
+
+Configuration options
+---------------------
+
+The plot directive has the following configuration options:
+
+ plot_include_source
+ Default value for the include-source option
+
+ plot_pre_code
+ Code that should be executed before each plot.
+
+ plot_basedir
+ Base directory, to which ``plot::`` file names are relative
+ to. (If None or empty, file names are relative to the
+ directoly where the file containing the directive is.)
+
+ plot_formats
+ File formats to generate. List of tuples or strings::
+
+ [(suffix, dpi), suffix, ...]
+
+ that determine the file format and the DPI. For entries whose
+ DPI was omitted, sensible defaults are chosen.
+
+ plot_html_show_formats
+ Whether to show links to the files in HTML.
+
+ plot_rcparams
+ A dictionary containing any non-standard rcParams that should
+ be applied before each plot.
+
+"""
+
+import sys, os, glob, shutil, imp, warnings, io, re, textwrap, \
+ traceback, exceptions
+
+from docutils.parsers.rst import directives
+from docutils import nodes
+from docutils.parsers.rst.directives.images import Image
+align = Image.align
+import sphinx
+
+sphinx_version = sphinx.__version__.split(".")
+# The split is necessary for sphinx beta versions where the string is
+# '6b1'
+sphinx_version = tuple([int(re.split('[a-z]', x)[0])
+ for x in sphinx_version[:2]])
+
+try:
+ # Sphinx depends on either Jinja or Jinja2
+ import jinja2
+ def format_template(template, **kw):
+ return jinja2.Template(template).render(**kw)
+except ImportError:
+ import jinja
+ def format_template(template, **kw):
+ return jinja.from_string(template, **kw)
+
+import matplotlib
+import matplotlib.cbook as cbook
+matplotlib.use('Agg')
+import matplotlib.pyplot as plt
+from matplotlib import _pylab_helpers
+
+__version__ = 2
+
+#------------------------------------------------------------------------------
+# Relative pathnames
+#------------------------------------------------------------------------------
+
+# os.path.relpath is new in Python 2.6
+try:
+ from os.path import relpath
+except ImportError:
+ # Copied from Python 2.7
+ if 'posix' in sys.builtin_module_names:
+ def relpath(path, start=os.path.curdir):
+ """Return a relative version of a path"""
+ from os.path import sep, curdir, join, abspath, commonprefix, \
+ pardir
+
+ if not path:
+ raise ValueError("no path specified")
+
+ start_list = abspath(start).split(sep)
+ path_list = abspath(path).split(sep)
+
+ # Work out how much of the filepath is shared by start and path.
+ i = len(commonprefix([start_list, path_list]))
+
+ rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
+ if not rel_list:
+ return curdir
+ return join(*rel_list)
+ elif 'nt' in sys.builtin_module_names:
+ def relpath(path, start=os.path.curdir):
+ """Return a relative version of a path"""
+ from os.path import sep, curdir, join, abspath, commonprefix, \
+ pardir, splitunc
+
+ if not path:
+ raise ValueError("no path specified")
+ start_list = abspath(start).split(sep)
+ path_list = abspath(path).split(sep)
+ if start_list[0].lower() != path_list[0].lower():
+ unc_path, rest = splitunc(path)
+ unc_start, rest = splitunc(start)
+ if bool(unc_path) ^ bool(unc_start):
+ raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)"
+ % (path, start))
+ else:
+ raise ValueError("path is on drive %s, start on drive %s"
+ % (path_list[0], start_list[0]))
+ # Work out how much of the filepath is shared by start and path.
+ for i in range(min(len(start_list), len(path_list))):
+ if start_list[i].lower() != path_list[i].lower():
+ break
+ else:
+ i += 1
+
+ rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
+ if not rel_list:
+ return curdir
+ return join(*rel_list)
+ else:
+ raise RuntimeError("Unsupported platform (no relpath available!)")
+
+#------------------------------------------------------------------------------
+# Registration hook
+#------------------------------------------------------------------------------
+
+def plot_directive(name, arguments, options, content, lineno,
+ content_offset, block_text, state, state_machine):
+ return run(arguments, content, options, state_machine, state, lineno)
+plot_directive.__doc__ = __doc__
+
+def _option_boolean(arg):
+ if not arg or not arg.strip():
+ # no argument given, assume used as a flag
+ return True
+ elif arg.strip().lower() in ('no', '0', 'false'):
+ return False
+ elif arg.strip().lower() in ('yes', '1', 'true'):
+ return True
+ else:
+ raise ValueError('"%s" unknown boolean' % arg)
+
+def _option_format(arg):
+ return directives.choice(arg, ('python', 'doctest'))
+
+def _option_align(arg):
+ return directives.choice(arg, ("top", "middle", "bottom", "left", "center",
+ "right"))
+
+def mark_plot_labels(app, document):
+ """
+ To make plots referenceable, we need to move the reference from
+ the "htmlonly" (or "latexonly") node to the actual figure node
+ itself.
+ """
+ for name, explicit in document.nametypes.items():
+ if not explicit:
+ continue
+ labelid = document.nameids[name]
+ if labelid is None:
+ continue
+ node = document.ids[labelid]
+ if node.tagname in ('html_only', 'latex_only'):
+ for n in node:
+ if n.tagname == 'figure':
+ sectname = name
+ for c in n:
+ if c.tagname == 'caption':
+ sectname = c.astext()
+ break
+
+ node['ids'].remove(labelid)
+ node['names'].remove(name)
+ n['ids'].append(labelid)
+ n['names'].append(name)
+ document.settings.env.labels[name] = \
+ document.settings.env.docname, labelid, sectname
+ break
+
+def setup(app):
+ setup.app = app
+ setup.config = app.config
+ setup.confdir = app.confdir
+
+ options = {'alt': directives.unchanged,
+ 'height': directives.length_or_unitless,
+ 'width': directives.length_or_percentage_or_unitless,
+ 'scale': directives.nonnegative_int,
+ 'align': _option_align,
+ 'class': directives.class_option,
+ 'include-source': _option_boolean,
+ 'format': _option_format,
+ 'context': directives.flag,
+ 'nofigs': directives.flag,
+ 'encoding': directives.encoding
+ }
+
+ app.add_directive('plot', plot_directive, True, (0, 2, False), **options)
+ app.add_config_value('plot_pre_code', None, True)
+ app.add_config_value('plot_include_source', False, True)
+ app.add_config_value('plot_formats', ['png', 'hires.png', 'pdf'], True)
+ app.add_config_value('plot_basedir', None, True)
+ app.add_config_value('plot_html_show_formats', True, True)
+ app.add_config_value('plot_rcparams', {}, True)
+
+ app.connect('doctree-read', mark_plot_labels)
+
+#------------------------------------------------------------------------------
+# Doctest handling
+#------------------------------------------------------------------------------
+
+def contains_doctest(text):
+ try:
+ # check if it's valid Python as-is
+ compile(text, '', 'exec')
+ return False
+ except SyntaxError:
+ pass
+ r = re.compile(r'^\s*>>>', re.M)
+ m = r.search(text)
+ return bool(m)
+
+def unescape_doctest(text):
+ """
+ Extract code from a piece of text, which contains either Python code
+ or doctests.
+
+ """
+ if not contains_doctest(text):
+ return text
+
+ code = ""
+ for line in text.split("\n"):
+ m = re.match(r'^\s*(>>>|\.\.\.) (.*)$', line)
+ if m:
+ code += m.group(2) + "\n"
+ elif line.strip():
+ code += "# " + line.strip() + "\n"
+ else:
+ code += "\n"
+ return code
+
+def split_code_at_show(text):
+ """
+ Split code at plt.show()
+
+ """
+
+ parts = []
+ is_doctest = contains_doctest(text)
+
+ part = []
+ for line in text.split("\n"):
+ if (not is_doctest and line.strip() == 'plt.show()') or \
+ (is_doctest and line.strip() == '>>> plt.show()'):
+ part.append(line)
+ parts.append("\n".join(part))
+ part = []
+ else:
+ part.append(line)
+ if "\n".join(part).strip():
+ parts.append("\n".join(part))
+ return parts
+
+#------------------------------------------------------------------------------
+# Template
+#------------------------------------------------------------------------------
+
+
+TEMPLATE = """
+{{ source_code }}
+
+{{ only_html }}
+
+ {% if source_link or (html_show_formats and not multi_image) %}
+ (
+ {%- if source_link -%}
+ `Source code <{{ source_link }}>`__
+ {%- endif -%}
+ {%- if html_show_formats and not multi_image -%}
+ {%- for img in images -%}
+ {%- for fmt in img.formats -%}
+ {%- if source_link or not loop.first -%}, {% endif -%}
+ `{{ fmt }} <{{ dest_dir }}/{{ img.basename }}.{{ fmt }}>`__
+ {%- endfor -%}
+ {%- endfor -%}
+ {%- endif -%}
+ )
+ {% endif %}
+
+ {% for img in images %}
+ .. figure:: {{ build_dir }}/{{ img.basename }}.png
+ {%- for option in options %}
+ {{ option }}
+ {% endfor %}
+
+ {% if html_show_formats and multi_image -%}
+ (
+ {%- for fmt in img.formats -%}
+ {%- if not loop.first -%}, {% endif -%}
+ `{{ fmt }} <{{ dest_dir }}/{{ img.basename }}.{{ fmt }}>`__
+ {%- endfor -%}
+ )
+ {%- endif -%}
+
+ {{ caption }}
+ {% endfor %}
+
+{{ only_latex }}
+
+ {% for img in images %}
+ .. image:: {{ build_dir }}/{{ img.basename }}.pdf
+ {% endfor %}
+
+"""
+
+exception_template = """
+.. htmlonly::
+
+ [`source code <%(linkdir)s/%(basename)s.py>`__]
+
+Exception occurred rendering plot.
+
+"""
+
+# the context of the plot for all directives specified with the
+# :context: option
+plot_context = dict()
+
+class ImageFile:
+ def __init__(self, basename, dirname):
+ self.basename = basename
+ self.dirname = dirname
+ self.formats = []
+
+ def filename(self, format):
+ return os.path.join(self.dirname, "%s.%s" % (self.basename, format))
+
+ def filenames(self):
+ return [self.filename(fmt) for fmt in self.formats]
+
+def out_of_date(original, derived):
+ """
+ Returns True if derivative is out-of-date wrt original,
+ both of which are full file paths.
+ """
+ return (not os.path.exists(derived) or
+ (os.path.exists(original) and
+ os.stat(derived).st_mtime < os.stat(original).st_mtime))
+
+class PlotError(RuntimeError):
+ pass
+
+def run_code(code, code_path, ns=None, function_name=None):
+ """
+ Import a Python module from a path, and run the function given by
+ name, if function_name is not None.
+ """
+
+ # Change the working directory to the directory of the example, so
+ # it can get at its data files, if any. Add its path to sys.path
+ # so it can import any helper modules sitting beside it.
+
+ pwd = os.getcwd()
+ old_sys_path = list(sys.path)
+ if code_path is not None:
+ dirname = os.path.abspath(os.path.dirname(code_path))
+ os.chdir(dirname)
+ sys.path.insert(0, dirname)
+
+ # Redirect stdout
+ stdout = sys.stdout
+ sys.stdout = io.StringIO()
+
+ # Reset sys.argv
+ old_sys_argv = sys.argv
+ sys.argv = [code_path]
+
+ try:
+ try:
+ code = unescape_doctest(code)
+ if ns is None:
+ ns = {}
+ if not ns:
+ if setup.config.plot_pre_code is None:
+ exec("import numpy as np\nfrom matplotlib import pyplot as plt\n", ns)
+ else:
+ exec(setup.config.plot_pre_code, ns)
+ if "__main__" in code:
+ exec("__name__ = '__main__'", ns)
+ exec(code, ns)
+ if function_name is not None:
+ exec(function_name + "()", ns)
+ except (Exception, SystemExit) as err:
+ raise PlotError(traceback.format_exc())
+ finally:
+ os.chdir(pwd)
+ sys.argv = old_sys_argv
+ sys.path[:] = old_sys_path
+ sys.stdout = stdout
+ return ns
+
+def clear_state(plot_rcparams):
+ plt.close('all')
+ matplotlib.rc_file_defaults()
+ matplotlib.rcParams.update(plot_rcparams)
+
+def render_figures(code, code_path, output_dir, output_base, context,
+ function_name, config):
+ """
+ Run a pyplot script and save the low and high res PNGs and a PDF
+ in outdir.
+
+ Save the images under *output_dir* with file names derived from
+ *output_base*
+ """
+ # -- Parse format list
+ default_dpi = {'png': 80, 'hires.png': 200, 'pdf': 200}
+ formats = []
+ plot_formats = config.plot_formats
+ if isinstance(plot_formats, str):
+ plot_formats = eval(plot_formats)
+ for fmt in plot_formats:
+ if isinstance(fmt, str):
+ formats.append((fmt, default_dpi.get(fmt, 80)))
+ elif type(fmt) in (tuple, list) and len(fmt)==2:
+ formats.append((str(fmt[0]), int(fmt[1])))
+ else:
+ raise PlotError('invalid image format "%r" in plot_formats' % fmt)
+
+ # -- Try to determine if all images already exist
+
+ code_pieces = split_code_at_show(code)
+
+ # Look for single-figure output files first
+ # Look for single-figure output files first
+ all_exists = True
+ img = ImageFile(output_base, output_dir)
+ for format, dpi in formats:
+ if out_of_date(code_path, img.filename(format)):
+ all_exists = False
+ break
+ img.formats.append(format)
+
+ if all_exists:
+ return [(code, [img])]
+
+ # Then look for multi-figure output files
+ results = []
+ all_exists = True
+ for i, code_piece in enumerate(code_pieces):
+ images = []
+ for j in range(1000):
+ if len(code_pieces) > 1:
+ img = ImageFile('%s_%02d_%02d' % (output_base, i, j), output_dir)
+ else:
+ img = ImageFile('%s_%02d' % (output_base, j), output_dir)
+ for format, dpi in formats:
+ if out_of_date(code_path, img.filename(format)):
+ all_exists = False
+ break
+ img.formats.append(format)
+
+ # assume that if we have one, we have them all
+ if not all_exists:
+ all_exists = (j > 0)
+ break
+ images.append(img)
+ if not all_exists:
+ break
+ results.append((code_piece, images))
+
+ if all_exists:
+ return results
+
+ # We didn't find the files, so build them
+
+ results = []
+ if context:
+ ns = plot_context
+ else:
+ ns = {}
+
+ for i, code_piece in enumerate(code_pieces):
+ if not context:
+ clear_state(config.plot_rcparams)
+ run_code(code_piece, code_path, ns, function_name)
+
+ images = []
+ fig_managers = _pylab_helpers.Gcf.get_all_fig_managers()
+ for j, figman in enumerate(fig_managers):
+ if len(fig_managers) == 1 and len(code_pieces) == 1:
+ img = ImageFile(output_base, output_dir)
+ elif len(code_pieces) == 1:
+ img = ImageFile("%s_%02d" % (output_base, j), output_dir)
+ else:
+ img = ImageFile("%s_%02d_%02d" % (output_base, i, j),
+ output_dir)
+ images.append(img)
+ for format, dpi in formats:
+ try:
+ figman.canvas.figure.savefig(img.filename(format), dpi=dpi)
+ except Exception as err:
+ raise PlotError(traceback.format_exc())
+ img.formats.append(format)
+
+ results.append((code_piece, images))
+
+ if not context:
+ clear_state(config.plot_rcparams)
+
+ return results
+
+def run(arguments, content, options, state_machine, state, lineno):
+ # The user may provide a filename *or* Python code content, but not both
+ if arguments and content:
+ raise RuntimeError("plot:: directive can't have both args and content")
+
+ document = state_machine.document
+ config = document.settings.env.config
+ nofigs = 'nofigs' in options
+
+ options.setdefault('include-source', config.plot_include_source)
+ context = 'context' in options
+
+ rst_file = document.attributes['source']
+ rst_dir = os.path.dirname(rst_file)
+
+ if len(arguments):
+ if not config.plot_basedir:
+ source_file_name = os.path.join(setup.app.builder.srcdir,
+ directives.uri(arguments[0]))
+ else:
+ source_file_name = os.path.join(setup.app.builder.srcdir, config.plot_basedir,
+ directives.uri(arguments[0]))
+
+ # If there is content, it will be passed as a caption.
+ caption = '\n'.join(content)
+
+ # If the optional function name is provided, use it
+ if len(arguments) == 2:
+ function_name = arguments[1]
+ else:
+ function_name = None
+
+ fd = open(source_file_name, 'r')
+ code = fd.read()
+ fd.close()
+ output_base = os.path.basename(source_file_name)
+ else:
+ source_file_name = rst_file
+ code = textwrap.dedent("\n".join(map(str, content)))
+ counter = document.attributes.get('_plot_counter', 0) + 1
+ document.attributes['_plot_counter'] = counter
+ base, ext = os.path.splitext(os.path.basename(source_file_name))
+ output_base = '%s-%d.py' % (base, counter)
+ function_name = None
+ caption = ''
+
+ base, source_ext = os.path.splitext(output_base)
+ if source_ext in ('.py', '.rst', '.txt'):
+ output_base = base
+ else:
+ source_ext = ''
+
+ # ensure that LaTeX includegraphics doesn't choke in foo.bar.pdf filenames
+ output_base = output_base.replace('.', '-')
+
+ # is it in doctest format?
+ is_doctest = contains_doctest(code)
+ if 'format' in options:
+ if options['format'] == 'python':
+ is_doctest = False
+ else:
+ is_doctest = True
+
+ # determine output directory name fragment
+ source_rel_name = relpath(source_file_name, setup.app.srcdir)
+ source_rel_dir = os.path.dirname(source_rel_name)
+ while source_rel_dir.startswith(os.path.sep):
+ source_rel_dir = source_rel_dir[1:]
+
+ # build_dir: where to place output files (temporarily)
+ build_dir = os.path.join(os.path.dirname(setup.app.doctreedir),
+ 'plot_directive',
+ source_rel_dir)
+ # get rid of .. in paths, also changes pathsep
+ # see note in Python docs for warning about symbolic links on Windows.
+ # need to compare source and dest paths at end
+ build_dir = os.path.normpath(build_dir)
+
+ if not os.path.exists(build_dir):
+ os.makedirs(build_dir)
+
+ # output_dir: final location in the builder's directory
+ dest_dir = os.path.abspath(os.path.join(setup.app.builder.outdir,
+ source_rel_dir))
+ if not os.path.exists(dest_dir):
+ os.makedirs(dest_dir) # no problem here for me, but just use built-ins
+
+ # how to link to files from the RST file
+ dest_dir_link = os.path.join(relpath(setup.app.srcdir, rst_dir),
+ source_rel_dir).replace(os.path.sep, '/')
+ build_dir_link = relpath(build_dir, rst_dir).replace(os.path.sep, '/')
+ source_link = dest_dir_link + '/' + output_base + source_ext
+
+ # make figures
+ try:
+ results = render_figures(code, source_file_name, build_dir, output_base,
+ context, function_name, config)
+ errors = []
+ except PlotError as err:
+ reporter = state.memo.reporter
+ sm = reporter.system_message(
+ 2, "Exception occurred in plotting %s\n from %s:\n%s" % (output_base,
+ source_file_name, err),
+ line=lineno)
+ results = [(code, [])]
+ errors = [sm]
+
+ # Properly indent the caption
+ caption = '\n'.join(' ' + line.strip()
+ for line in caption.split('\n'))
+
+ # generate output restructuredtext
+ total_lines = []
+ for j, (code_piece, images) in enumerate(results):
+ if options['include-source']:
+ if is_doctest:
+ lines = ['']
+ lines += [row.rstrip() for row in code_piece.split('\n')]
+ else:
+ lines = ['.. code-block:: python', '']
+ lines += [' %s' % row.rstrip()
+ for row in code_piece.split('\n')]
+ source_code = "\n".join(lines)
+ else:
+ source_code = ""
+
+ if nofigs:
+ images = []
+
+ opts = [':%s: %s' % (key, val) for key, val in list(options.items())
+ if key in ('alt', 'height', 'width', 'scale', 'align', 'class')]
+
+ only_html = ".. only:: html"
+ only_latex = ".. only:: latex"
+
+ if j == 0:
+ src_link = source_link
+ else:
+ src_link = None
+
+ result = format_template(
+ TEMPLATE,
+ dest_dir=dest_dir_link,
+ build_dir=build_dir_link,
+ source_link=src_link,
+ multi_image=len(images) > 1,
+ only_html=only_html,
+ only_latex=only_latex,
+ options=opts,
+ images=images,
+ source_code=source_code,
+ html_show_formats=config.plot_html_show_formats,
+ caption=caption)
+
+ total_lines.extend(result.split("\n"))
+ total_lines.extend("\n")
+
+ if total_lines:
+ state_machine.insert_input(total_lines, source=source_file_name)
+
+ # copy image files to builder's output directory, if necessary
+ if not os.path.exists(dest_dir):
+ cbook.mkdirs(dest_dir)
+
+ for code_piece, images in results:
+ for img in images:
+ for fn in img.filenames():
+ destimg = os.path.join(dest_dir, os.path.basename(fn))
+ if fn != destimg:
+ shutil.copyfile(fn, destimg)
+
+ # copy script (if necessary)
+ #if source_file_name == rst_file:
+ target_name = os.path.join(dest_dir, output_base + source_ext)
+ f = open(target_name, 'w')
+ f.write(unescape_doctest(code))
+ f.close()
+
+ return errors
diff --git a/doc/sphinxext/triqs_example/triqs_example.py b/doc/sphinxext/triqs_example/triqs_example.py
new file mode 100644
index 00000000..2c90ac4c
--- /dev/null
+++ b/doc/sphinxext/triqs_example/triqs_example.py
@@ -0,0 +1,123 @@
+import tempfile
+# -*- coding: utf-8 -*-
+# seems to be executed at the level of the conf.py
+# so we need to link the lib at that place...
+"""
+"""
+import os
+import codecs
+from os import path
+from subprocess import Popen,PIPE
+from docutils import nodes
+from docutils.parsers.rst import Directive
+from docutils.parsers.rst import directives
+from sphinx.errors import SphinxError
+
+class TriqsExampleError(SphinxError):
+ category = 'triqs_example error'
+
+class TriqsExampleRun:
+ #here = os.path.abspath(__file__)
+ #pycon = os.path.join(os.path.dirname(here),'pycon.py')
+ config = dict(
+ )
+ @classmethod
+ def builder_init(cls,app):
+ #cls.config.update(app.builder.config.autorun_languages)
+ #cls.config.update(app.builder.config.autocompile_opts)
+ pass
+
+class TriqsExample(Directive):
+ has_content = True
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {
+ 'linenos': directives.flag,
+ }
+
+ def run(self):
+ document = self.state.document
+ filename = self.arguments[0]
+ if not document.settings.file_insertion_enabled:
+ return [document.reporter.warning('File insertion disabled',
+ line=self.lineno)]
+ env = document.settings.env
+ if filename.startswith('/') or filename.startswith(os.sep):
+ rel_fn = filename[1:]
+ else:
+ docdir = path.dirname(env.doc2path(env.docname, base=None))
+ rel_fn = path.normpath(path.join(docdir, filename))
+ try:
+ fn = path.join(env.srcdir, rel_fn)
+ except UnicodeDecodeError:
+ # the source directory is a bytestring with non-ASCII characters;
+ # let's try to encode the rel_fn in the file system encoding
+ rel_fn = rel_fn.encode(sys.getfilesystemencoding())
+ fn = path.join(env.srcdir, rel_fn)
+
+ encoding = self.options.get('encoding', env.config.source_encoding)
+ try:
+ f = codecs.open(fn, 'rU', encoding)
+ lines = f.readlines()
+ f.close()
+ except (IOError, OSError):
+ return [document.reporter.warning(
+ 'Include file %r not found or reading it failed' % filename,
+ line=self.lineno)]
+ except UnicodeError:
+ return [document.reporter.warning(
+ 'Encoding %r used for reading included file %r seems to '
+ 'be wrong, try giving an :encoding: option' %
+ (encoding, filename))]
+
+ config = TriqsExampleRun.config
+
+ # Get configuration values for the language
+ input_encoding = 'utf8' #config.get(language+'_input_encoding','ascii')
+ output_encoding = 'utf8' #config.get(language+'_output_encoding','ascii')
+ show_source = True
+
+ # Build the code text
+ code = ''.join(lines).strip()
+ filename_clean = filename.rsplit('.',1)[0]
+ if filename_clean.startswith('./') : filename_clean = filename_clean[2:]
+ #print "Running the example ....",filename_clean
+ #print "Root ?", env.doc2path(env.docname, base=None)
+
+ import subprocess as S
+ error = True
+ try :
+ stdout =''
+ #resout = S.check_output("./example_bin/doc_%s"%(filename_clean) ,stderr=S.STDOUT,shell=True)
+ resout = S.check_output("./%s/doc_%s"%(docdir,filename_clean) ,stderr=S.STDOUT,shell=True)
+ if resout :
+ stdout = '---------- Result is -------\n' + resout.strip()
+ error = False
+ except S.CalledProcessError as E :
+ stdout ='---------- RunTime error -------\n'
+ stdout += E.output
+
+ # Process output
+ if stdout:
+ stdout = stdout.decode(output_encoding,'ignore')
+ out = ''.join(stdout).decode(output_encoding)
+ else:
+ out = '' #.join(stderr).decode(output_encoding)
+
+ # Get the original code with prefixes
+ code_out = '\n'.join((code,out))
+
+ if error : # report on console
+ print(" Error in processing ")
+ print(code_out)
+
+ literal = nodes.literal_block(code_out,code_out)
+ literal['language'] = 'c'
+ literal['linenos'] = 'linenos' in self.options
+ return [literal]
+
+def setup(app):
+ app.add_directive('triqs_example', TriqsExample)
+ app.connect('builder-inited',TriqsExampleRun.builder_init)
+
diff --git a/doc/themes/agogo/layout.html b/doc/themes/agogo/layout.html
new file mode 100644
index 00000000..869d76ad
--- /dev/null
+++ b/doc/themes/agogo/layout.html
@@ -0,0 +1,92 @@
+{#
+ agogo/layout.html
+ ~~~~~~~~~~~~~~~~~
+
+ Sphinx layout template for the agogo theme, originally written
+ by Andi Albrecht.
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "basic/layout.html" %}
+
+{% block header %}
+
+{% endblock %}
+
+{% block content %}
+
+
+
+ {%- block document %}
+ {{ super() }}
+ {%- endblock %}
+
+
+
+
+
+{% endblock %}
+
+{% block footer %}
+
+{% endblock %}
+
+{% block relbar1 %}{% endblock %}
+{% block relbar2 %}{% endblock %}
diff --git a/doc/themes/agogo/static/agogo.css_t b/doc/themes/agogo/static/agogo.css_t
new file mode 100644
index 00000000..5e4b0c66
--- /dev/null
+++ b/doc/themes/agogo/static/agogo.css_t
@@ -0,0 +1,519 @@
+/*
+ * agogo.css_t
+ * ~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- agogo theme.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+* {
+ margin: 0px;
+ padding: 0px;
+}
+
+body {
+ font-family: {{ theme_bodyfont }};
+ font-size: 100%; // TRIQS
+ line-height: 1.0em; // TRIQS
+ color: black;
+ background-color: {{ theme_bgcolor }};
+}
+
+
+/* Page layout */
+
+div.header, div.content, div.footer {
+ width: {{ theme_pagewidth }};
+ margin-left: auto;
+ margin-right: auto;
+}
+
+div.header-wrapper {
+ background: {{ theme_headerbg }};
+ border-bottom: 3px solid #2e3436;
+}
+
+
+/* Default body styles */
+a {
+ color: {{ theme_linkcolor }};
+}
+
+div.bodywrapper a, div.footer a {
+ text-decoration: none; // TRIQS
+}
+
+div.bodywrapper a:hover, div.footer a:hover {
+ text-decoration: underline; // TRIQS
+}
+
+.clearer {
+ clear: both;
+}
+
+.left {
+ float: left;
+}
+
+.right {
+ float: right;
+}
+
+.line-block {
+ display: block;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.line-block .line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
+
+h1, h2, h3, h4 {
+ font-family: {{ theme_headerfont }};
+ font-weight: normal;
+ color: {{ theme_headercolor2 }};
+ margin-bottom: .8em;
+}
+
+h1 {
+ color: {{ theme_headercolor1 }};
+}
+
+h2 {
+ padding-bottom: .5em;
+ border-bottom: 1px solid {{ theme_headercolor2 }};
+}
+
+a.headerlink {
+ visibility: hidden;
+ color: #dddddd;
+ padding-left: .3em;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+img {
+ border: 0;
+}
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 2px 7px 1px 7px;
+ border-left: 0.2em solid black;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+ color: red; // TRIQS
+}
+
+dt:target, .highlighted {
+ background-color: #fbe54e;
+}
+
+/* Header */
+
+div.header {
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+
+div.header h1 {
+ font-family: {{ theme_headerfont }};
+ font-weight: normal;
+ font-size: 180%;
+ letter-spacing: .08em;
+}
+
+div.header h1 a {
+ color: white;
+}
+
+div.header div.rel {
+ margin-top: -1em; // TRIQS
+}
+
+div.header div.rel a {
+ color: {{ theme_headerlinkcolor }};
+ letter-spacing: .1em;
+ text-transform: uppercase;
+}
+
+p.logo {
+ float: right;
+}
+
+img.logo {
+ border: 0;
+}
+
+
+/* Content */
+div.content-wrapper {
+ background-color: white;
+ padding-top: 20px;
+ padding-bottom: 20px;
+}
+
+div.document {
+ width: {{ theme_documentwidth }};
+ float: left;
+}
+
+div.body {
+ padding-right: 2em;
+ text-align: {{ theme_textalign }};
+}
+
+div.document ul {
+ margin: 1.5em;
+ list-style-type: square;
+}
+
+div.document dd {
+ margin-left: 1.2em;
+ margin-top: .4em;
+ margin-bottom: 1em;
+}
+
+div.document .section {
+ margin-top: 1.7em;
+}
+div.document .section:first-child {
+ margin-top: 0px;
+}
+
+div.document div.highlight {
+ line-height: 1.0em; // TRIQS
+ padding: 3px;
+ background-color: #eeeeec;
+ border-top: 2px solid #dddddd;
+ border-bottom: 2px solid #dddddd;
+ margin-top: .8em;
+ margin-bottom: .8em;
+}
+
+div.document h2 {
+ margin-top: .7em;
+}
+
+div.document p {
+ margin-bottom: .5em;
+}
+
+div.document li.toctree-l1 {
+ margin-bottom: 0em; // TRIQS
+}
+div.document li.toctree-l2 {
+ margin-bottom: 0em; // TRIQS
+}
+
+div.document .descname {
+ font-weight: bold;
+ color: blue; // TRIQS
+}
+
+div.document .docutils.literal {
+ background-color: #eeeeec;
+ padding: 1px;
+}
+
+div.document .docutils.xref.literal {
+ background-color: transparent;
+ padding: 0px;
+}
+
+div.document blockquote {
+ margin: 1em;
+}
+
+div.document ol {
+ margin: 1.5em;
+}
+
+
+/* Sidebar */
+
+div.sidebar {
+ width: {{ theme_sidebarwidth }};
+ float: right;
+ font-size: .9em;
+}
+
+div.sidebar a, div.header a {
+ text-decoration: none;
+}
+
+div.sidebar a:hover, div.header a:hover {
+ text-decoration: underline;
+}
+
+div.sidebar h3 {
+ color: #2e3436;
+ text-transform: uppercase;
+ font-size: 130%;
+ letter-spacing: .1em;
+}
+
+div.sidebar ul {
+ list-style-type: none;
+}
+
+div.sidebar li.toctree-l1 a {
+ display: block;
+ padding: 1px;
+ border: 1px solid #dddddd;
+ background-color: #eeeeec;
+ margin-bottom: .4em;
+ padding-left: 3px;
+ color: #2e3436;
+}
+
+div.sidebar li.toctree-l2 a {
+ background-color: transparent;
+ border: none;
+ margin-left: 1em;
+ border-bottom: 1px solid #dddddd;
+}
+
+div.sidebar li.toctree-l3 a {
+ background-color: transparent;
+ border: none;
+ margin-left: 2em;
+ border-bottom: 1px solid #dddddd;
+}
+
+div.sidebar li.toctree-l2:last-child a {
+ border-bottom: none;
+}
+
+div.sidebar li.toctree-l1.current a {
+ border-right: 5px solid {{ theme_headerlinkcolor }};
+}
+
+div.sidebar li.toctree-l1.current li.toctree-l2 a {
+ border-right: none;
+}
+
+
+/* Footer */
+
+div.footer-wrapper {
+ background: {{ theme_footerbg }};
+ border-top: 4px solid #babdb6;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ min-height: 80px;
+}
+
+div.footer, div.footer a {
+ color: #888a85;
+}
+
+div.footer .right {
+ text-align: right;
+}
+
+div.footer .left {
+ text-transform: uppercase;
+}
+
+
+/* Styles copied from basic theme */
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+ width: 100%;
+}
+
+table.contentstable td {
+ padding: 10px 10px 10px 0;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+ text-align: left;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
+/* -- viewcode extension ---------------------------------------------------- */
+
+.viewcode-link {
+ float: right;
+}
+
+.viewcode-back {
+ float: right;
+ font-family:: {{ theme_bodyfont }};
+}
+
+div.viewcode-block:target {
+ margin: -1px -3px;
+ padding: 0 3px;
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+}
+
+/* -- added for TRIQS ------------------------------------------------------- */
+
+div.warning {
+ margin: 1em 0 1em 0;
+ border: 1px solid #86989B;
+ background-color: lightpink; //#f7f7f7;
+}
+
+div.note {
+ margin: 1em 0 1em 0;
+ border: 1px solid #86989B;
+ background-color: lightcyan; //#f7f7f7;
+}
+
+div.note p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+ color : blue;
+}
+
+div.highlight-python {
+ margin-top : 5px;
+ margin-bottom : 7px;
+ background-color: lightcyan; //#f4debf;
+}
+
+/* -- math display ---------------------------------------------------------- */
+
+img.math {
+ vertical-align: middle;
+}
+
+div.body div.math p {
+ text-align: center;
+}
+
+span.eqno {
+ float: right;
+}
+
+/* -- tables ---------------------------------------------------------------- */
+
+table.docutils {
+ border: 0;
+ border-collapse: collapse;
+}
+
+table.docutils head {
+ color : blue;
+}
+
+table.docutils td, table.docutils th {
+ padding: 1px 8px 1px 5px;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 1px solid #aaa;
+}
+
+table.field-list td, table.field-list th {
+ border: 0 !important;
+}
+
+table.footnote td, table.footnote th {
+ border: 0 !important;
+}
+
+th {
+ text-align: left;
+ padding-right: 5px;
+}
+
+table.citation {
+ border-left: solid 1px gray;
+ margin-left: 1px;
+}
+
+table.citation td {
+ border-bottom: none;
+}
+
diff --git a/doc/themes/agogo/theme.conf b/doc/themes/agogo/theme.conf
new file mode 100644
index 00000000..e2108d96
--- /dev/null
+++ b/doc/themes/agogo/theme.conf
@@ -0,0 +1,20 @@
+[theme]
+inherit = basic
+stylesheet = agogo.css
+pygments_style = tango
+
+[options]
+bodyfont = "Verdana", Arial, sans-serif
+headerfont = "Georgia", "Times New Roman", serif
+pagewidth = 80%
+documentwidth = 75%
+sidebarwidth = 22.5%
+bgcolor = #eeeeec
+headerbg = url(bgtop.png) top left repeat-x
+footerbg = url(bgfooter.png) top left repeat-x
+linkcolor = #ce5c00
+headercolor1 = #204a87
+headercolor2 = #3465a4
+headerlinkcolor = #fcaf3e
+textalign = justify
+index = index
diff --git a/doc/themes/triqs/layout.html b/doc/themes/triqs/layout.html
new file mode 100644
index 00000000..0275e11a
--- /dev/null
+++ b/doc/themes/triqs/layout.html
@@ -0,0 +1,52 @@
+{#
+ layout.html
+ ~~~~~~~~~~~
+
+ TRIQS layout template heavily based on the sphinxdoc theme.
+
+ :copyright: Copyright 2013 by the TRIQS team.
+ :copyright: Copyright 2007-2013 by the Sphinx team.
+ :license: BSD, see LICENSE for details.
+#}
+{%- extends "basic/layout.html" %}
+
+{# put the sidebar before the body #}
+{% block sidebar1 %}{{ sidebar() }}{% endblock %}
+{% block sidebar2 %}{% endblock %}
+
+{% block extrahead %}
+
+
+
+
+{{ super() }}
+{%- if not embedded %}
+
+{%- endif %}
+{% endblock %}
+
+{% block rootrellink %}
+ Home »
+{% endblock %}
+
+{% block header %}
+
+{% endblock %}
diff --git a/doc/themes/triqs/static/cufon-yui.js b/doc/themes/triqs/static/cufon-yui.js
new file mode 100644
index 00000000..935614e1
--- /dev/null
+++ b/doc/themes/triqs/static/cufon-yui.js
@@ -0,0 +1,7 @@
+/*
+ * Copyright (c) 2009 Simo Kinnunen.
+ * Licensed under the MIT license.
+ *
+ * @version 1.09i
+ */
+var Cufon=(function(){var m=function(){return m.replace.apply(null,arguments)};var x=m.DOM={ready:(function(){var C=false,E={loaded:1,complete:1};var B=[],D=function(){if(C){return}C=true;for(var F;F=B.shift();F()){}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",D,false);window.addEventListener("pageshow",D,false)}if(!window.opera&&document.readyState){(function(){E[document.readyState]?D():setTimeout(arguments.callee,10)})()}if(document.readyState&&document.createStyleSheet){(function(){try{document.body.doScroll("left");D()}catch(F){setTimeout(arguments.callee,1)}})()}q(window,"load",D);return function(F){if(!arguments.length){D()}else{C?F():B.push(F)}}})(),root:function(){return document.documentElement||document.body}};var n=m.CSS={Size:function(C,B){this.value=parseFloat(C);this.unit=String(C).match(/[a-z%]*$/)[0]||"px";this.convert=function(D){return D/B*this.value};this.convertFrom=function(D){return D/this.value*B};this.toString=function(){return this.value+this.unit}},addClass:function(C,B){var D=C.className;C.className=D+(D&&" ")+B;return C},color:j(function(C){var B={};B.color=C.replace(/^rgba\((.*?),\s*([\d.]+)\)/,function(E,D,F){B.opacity=parseFloat(F);return"rgb("+D+")"});return B}),fontStretch:j(function(B){if(typeof B=="number"){return B}if(/%$/.test(B)){return parseFloat(B)/100}return{"ultra-condensed":0.5,"extra-condensed":0.625,condensed:0.75,"semi-condensed":0.875,"semi-expanded":1.125,expanded:1.25,"extra-expanded":1.5,"ultra-expanded":2}[B]||1}),getStyle:function(C){var B=document.defaultView;if(B&&B.getComputedStyle){return new a(B.getComputedStyle(C,null))}if(C.currentStyle){return new a(C.currentStyle)}return new a(C.style)},gradient:j(function(F){var G={id:F,type:F.match(/^-([a-z]+)-gradient\(/)[1],stops:[]},C=F.substr(F.indexOf("(")).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);for(var E=0,B=C.length,D;E0){E=" "+E}}else{if(B400}if(I==500){I=400}for(var J in G){if(!k(G,J)){continue}J=parseInt(J,10);if(!F||JD){D=J}K.push(J)}if(ID){I=D}K.sort(function(M,L){return(E?(M>=I&&L>=I)?ML:(M<=I&&L<=I)?M>L:Mcufoncanvas{text-indent:0;}@media screen{cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}cufoncanvas{position:absolute;text-align:left;}cufon{display:inline-block;position:relative;vertical-align:'+(h?"middle":"text-bottom")+";}cufon cufontext{position:absolute;left:-10000in;font-size:1px;}a cufon{cursor:pointer}}@media print{cufon cufoncanvas{display:none;}}").replace(/;/g,"!important;"));function c(i,j){return a(i,/(?:em|ex|%)$|^[a-z-]+$/i.test(j)?"1em":j)}function a(l,m){if(m==="0"){return 0}if(/px$/i.test(m)){return parseFloat(m)}var k=l.style.left,j=l.runtimeStyle.left;l.runtimeStyle.left=l.currentStyle.left;l.style.left=m.replace("%","em");var i=l.style.pixelLeft;l.style.left=k;l.runtimeStyle.left=j;return i}function f(l,k,j,n){var i="computed"+n,m=k[i];if(isNaN(m)){m=k.get(n);k[i]=m=(m=="normal")?0:~~j.convertFrom(a(l,m))}return m}var g={};function d(p){var q=p.id;if(!g[q]){var n=p.stops,o=document.createElement("cvml:fill"),i=[];o.type="gradient";o.angle=180;o.focus="0";o.method="sigma";o.color=n[0][1];for(var m=1,l=n.length-1;mO){O=K}if(I>N){N=I}if(K":{"w":232},"?":{"d":"413,-133r0,133r-192,0r0,-133r192,0xm221,-188v-13,-173,78,-281,237,-282r341,0v53,0,80,-24,80,-71v0,-47,-27,-71,-80,-71r-799,0r0,-166r817,-1v141,-1,227,93,227,236v0,149,-87,234,-227,234r-315,0v-67,-1,-99,45,-89,121r-192,0","w":1218},"@":{"d":"305,-388v0,55,25,70,85,70r436,0r0,-146r-439,0v-55,0,-82,25,-82,76xm339,-62v-218,3,-334,-116,-339,-327v-4,-168,93,-282,227,-315v106,-26,574,-16,605,-3v56,23,105,70,105,151r0,316r-579,0v-98,2,-164,-54,-164,-148v0,-106,69,-154,188,-154r444,0v-2,-97,-62,-97,-185,-100v-135,-3,-342,-4,-427,22v-86,26,-136,115,-136,231v0,166,96,250,261,250r483,0r0,77r-483,0","w":1060},"A":{"d":"754,-341v0,-61,-24,-84,-89,-84r-626,0r0,-131r667,0v135,5,215,66,215,217r0,339r-745,0v-108,1,-176,-63,-176,-171v0,-107,69,-171,176,-170r578,0xm754,-131r0,-85r-534,0v-35,0,-53,14,-53,43v0,28,18,42,53,42r534,0","w":1096},"B":{"d":"969,-278v0,176,-93,278,-267,278r-702,0r0,-778r167,0r0,222r535,0v170,-2,267,101,267,278xm794,-278v0,-81,-38,-139,-114,-139r-513,0r0,278r513,0v76,0,114,-58,114,-139","w":1097},"C":{"d":"0,-278v0,-173,94,-278,267,-278r595,0r0,139r-573,0v-76,0,-114,58,-114,139v0,81,38,139,114,139r573,0r0,139r-595,0v-173,1,-267,-105,-267,-278","w":1022},"D":{"d":"0,-278v-1,-176,93,-278,267,-278r521,0r0,-222r167,0r0,778r-688,0v-171,2,-266,-102,-267,-278xm175,-278v0,81,38,139,114,139r499,0r0,-278r-499,0v-76,0,-114,58,-114,139","w":1130},"E":{"d":"176,-216v24,58,48,85,113,85r581,0r0,131r-603,0v-173,1,-267,-105,-267,-278v0,-173,94,-278,267,-278r603,0r0,131r-581,0v-65,4,-87,27,-113,84r694,0r0,125r-694,0","w":1022},"F":{"d":"105,-341v-10,-142,29,-222,167,-222r501,1r0,130r-423,0v-60,-4,-81,31,-78,91r501,-2r0,131r-501,2r0,425r-167,0r0,-425r-105,0r0,-131r105,0","w":906},"G":{"d":"0,-278v0,-173,94,-278,267,-278r770,1r0,571v3,126,-82,208,-203,208r-773,-2r0,-130r743,1v55,0,68,-33,66,-93r-603,0v-173,1,-267,-105,-267,-278xm175,-278v0,81,37,139,114,139r581,-2r0,-275r-581,-1v-76,0,-114,58,-114,139","w":1204},"H":{"d":"735,-359v1,-35,-25,-58,-58,-58r-510,0r0,417r-167,0r0,-778r167,0r0,222r537,0v116,-4,198,68,198,170r0,386r-167,0r0,-359"},"I":{"d":"167,0r-167,0r0,-556r167,0r0,556xm167,-612r-167,0r0,-133r167,0r0,133","w":334},"J":{"d":"743,-612r-167,0r0,-133r167,0r0,133xm743,40v-5,114,-100,182,-221,182r-522,0r0,-139r510,0v44,0,66,-24,66,-73r0,-566r167,0r0,596","w":916},"K":{"d":"767,-481r146,0r0,-77r-146,0r0,77xm1040,-2v25,-199,-69,-334,-263,-334r-610,1r0,-442r-167,0r0,775r167,0r0,-195r588,0v95,-4,128,100,107,195r178,0xm914,-481v0,97,-49,145,-146,145r0,-145r146,0xm767,-481v4,77,-98,149,-175,146r175,0r0,-146","w":1195},"L":{"d":"183,-299v0,80,47,132,132,132r523,0r0,167r-569,0v-174,4,-268,-107,-268,-282r0,-276r182,0r0,259","w":996},"M":{"d":"961,-556v116,-4,197,66,197,170r0,386r-167,0r0,-359v0,-39,-19,-58,-58,-58r-273,0r0,417r-167,0r0,-417r-326,0r0,417r-167,0r0,-556r961,0","w":1312},"N":{"d":"688,-556v116,-4,198,68,198,170r0,386r-167,0r0,-359v0,-39,-19,-58,-58,-58r-494,0r0,417r-167,0r0,-556r688,0","w":1057},"O":{"d":"7,-368v-3,-111,96,-207,207,-207r536,0v112,-3,207,95,207,207r0,162v3,111,-96,207,-207,207r-536,0v-110,3,-207,-97,-207,-207r0,-162xm264,-445v-45,-1,-85,40,-85,85r0,138v-1,45,40,85,85,85r428,0v45,1,85,-40,85,-85r0,-138v1,-45,-40,-85,-85,-85r-428,0","w":1104},"P":{"d":"986,-278v1,176,-93,278,-267,278r-552,0r0,222r-167,0r0,-778r719,0v171,-2,266,102,267,278xm811,-278v0,-81,-38,-139,-114,-139r-530,0r0,278r530,0v76,0,114,-58,114,-139","w":1141},"Q":{"d":"0,-278v-1,-176,93,-278,267,-278r777,2r0,776r-167,0r0,-223r-610,1v-171,2,-266,-102,-267,-278xm175,-278v0,81,38,139,114,139r588,-1r0,-275r-588,-2v-77,0,-114,58,-114,139","w":1211},"R":{"d":"610,-558v134,0,213,83,197,228r-167,0v4,-51,-8,-86,-58,-86r-415,-1r0,417r-167,0r0,-556","w":950},"S":{"d":"913,-170v0,103,-65,170,-175,170r-738,0r0,-131r705,1v37,0,55,-14,55,-43v0,-28,-18,-42,-55,-42r-530,-1v-102,1,-175,-66,-175,-169v0,-101,66,-171,175,-171r708,0r0,131r-675,0v-37,0,-55,14,-55,42v0,28,18,42,55,42r530,1v102,-1,175,67,175,170","w":1039},"T":{"d":"267,-208v1,58,20,77,78,77r425,0r0,131r-504,0v-116,-3,-166,-47,-166,-167r0,-258r-100,0r0,-131r100,0r0,-222r167,0r0,222r503,0r0,131r-503,0r0,217","w":917},"U":{"d":"198,0v-119,6,-198,-71,-198,-170r0,-386r167,0r0,358v0,39,19,59,58,59r506,0r0,-417r167,0r0,556r-700,0"},"V":{"d":"167,-139r564,0r0,-417r167,0r0,556r-898,0r0,-556r167,0r0,417"},"W":{"d":"197,0v-115,4,-197,-68,-197,-170r0,-386r167,0r0,358v0,39,19,59,58,59r273,0r0,-417r167,0r0,417r326,0r0,-417r167,0r0,556r-961,0","w":1323},"X":{"d":"132,-208r646,0r0,-131r-646,0r0,131xm1,-138v-2,-70,61,-133,131,-131r0,131r-131,0xm0,-138r132,0r0,138r-132,0r0,-138xm1,-396v-2,71,61,133,131,131r0,-131r-131,0xm0,-396r132,0r0,-158r-132,0r0,158xm909,-138v2,-70,-61,-133,-131,-131r0,131r131,0xm910,-138r-132,0r0,138r132,0r0,-138xm909,-396v2,71,-61,133,-131,131r0,-131r131,0xm910,-396r-132,0r0,-158r132,0r0,158xm133,-454v-2,62,53,117,115,115r-115,0r0,-115xm133,-94v-2,-62,53,-117,115,-115r-115,0r0,115xm777,-454v2,62,-53,117,-115,115r115,0r0,-115xm778,-93v2,-62,-54,-117,-115,-115r115,0r0,115","w":1017},"Y":{"d":"754,92v53,-1,68,-31,66,-92r-622,0v-119,6,-198,-71,-198,-170r0,-386r167,0r0,336v-1,49,32,82,81,81r572,0r0,-417r167,0r0,576v3,124,-85,207,-204,207r-769,0r0,-135r740,0","w":1169},"Z":{"d":"0,-170v0,101,66,170,175,170r738,0r0,-131r-704,1v-37,0,-56,-14,-56,-43v0,-28,19,-42,56,-42r529,-1v102,1,175,-66,175,-169v0,-102,-66,-171,-175,-171r-707,-2r0,131r674,2v37,0,55,14,55,42v0,28,-18,42,-55,42r-530,1v-102,-1,-175,67,-175,170","w":1039},"[":{"d":"0,-931r306,0r0,153r-153,0r0,778r153,0r0,153r-306,0r0,-1084","w":361},"\\":{"d":"877,0r-692,-778r-185,0r681,778r196,0","w":942},"]":{"w":366},"^":{"w":406},"_":{"d":"0,61r1001,0r0,161r-1001,0r0,-161","w":1172},"`":{"d":"0,-806r94,0r112,111r-95,0","w":261},"a":{"d":"754,-341v0,-61,-24,-84,-89,-84r-626,0r0,-131r667,0v135,5,215,66,215,217r0,339r-745,0v-108,1,-176,-63,-176,-171v0,-107,69,-171,176,-170r578,0xm754,-131r0,-85r-534,0v-35,0,-53,14,-53,43v0,28,18,42,53,42r534,0","w":1096},"b":{"d":"969,-278v0,176,-93,278,-267,278r-702,0r0,-778r167,0r0,222r535,0v170,-2,267,101,267,278xm794,-278v0,-81,-38,-139,-114,-139r-513,0r0,278r513,0v76,0,114,-58,114,-139","w":1097},"c":{"d":"0,-278v0,-173,94,-278,267,-278r595,0r0,139r-573,0v-76,0,-114,58,-114,139v0,81,38,139,114,139r573,0r0,139r-595,0v-173,1,-267,-105,-267,-278","w":1022},"d":{"d":"0,-278v-1,-176,93,-278,267,-278r521,0r0,-222r167,0r0,778r-688,0v-171,2,-266,-102,-267,-278xm175,-278v0,81,38,139,114,139r499,0r0,-278r-499,0v-76,0,-114,58,-114,139","w":1130},"e":{"d":"176,-216v24,58,48,85,113,85r581,0r0,131r-603,0v-173,1,-267,-105,-267,-278v0,-173,94,-278,267,-278r603,0r0,131r-581,0v-65,4,-87,27,-113,84r694,0r0,125r-694,0","w":1022},"f":{"d":"105,-341v-10,-142,29,-222,167,-222r501,1r0,130r-423,0v-60,-4,-81,31,-78,91r501,-2r0,131r-501,2r0,425r-167,0r0,-425r-105,0r0,-131r105,0","w":906},"g":{"d":"0,-278v0,-173,94,-278,267,-278r770,1r0,571v3,126,-82,208,-203,208r-773,-2r0,-130r743,1v55,0,68,-33,66,-93r-603,0v-173,1,-267,-105,-267,-278xm175,-278v0,81,37,139,114,139r581,-2r0,-275r-581,-1v-76,0,-114,58,-114,139","w":1204},"h":{"d":"735,-359v1,-35,-25,-58,-58,-58r-510,0r0,417r-167,0r0,-778r167,0r0,222r537,0v116,-4,198,68,198,170r0,386r-167,0r0,-359"},"i":{"d":"167,0r-167,0r0,-556r167,0r0,556xm167,-612r-167,0r0,-133r167,0r0,133","w":334},"j":{"d":"743,-612r-167,0r0,-133r167,0r0,133xm743,40v-5,114,-100,182,-221,182r-522,0r0,-139r510,0v44,0,66,-24,66,-73r0,-566r167,0r0,596","w":916},"k":{"d":"767,-481r146,0r0,-77r-146,0r0,77xm1040,-2v25,-199,-69,-334,-263,-334r-610,1r0,-442r-167,0r0,775r167,0r0,-195r588,0v95,-4,128,100,107,195r178,0xm914,-481v0,97,-49,145,-146,145r0,-145r146,0xm767,-481v4,77,-98,149,-175,146r175,0r0,-146","w":1195},"l":{"d":"183,-299v0,80,47,132,132,132r523,0r0,167r-569,0v-174,4,-268,-107,-268,-282r0,-276r182,0r0,259","w":996},"m":{"d":"961,-556v116,-4,197,66,197,170r0,386r-167,0r0,-359v0,-39,-19,-58,-58,-58r-273,0r0,417r-167,0r0,-417r-326,0r0,417r-167,0r0,-556r961,0","w":1312},"n":{"d":"688,-556v116,-4,198,68,198,170r0,386r-167,0r0,-359v0,-39,-19,-58,-58,-58r-494,0r0,417r-167,0r0,-556r688,0","w":1057},"o":{"d":"7,-368v-3,-111,96,-207,207,-207r536,0v112,-3,207,95,207,207r0,162v3,111,-96,207,-207,207r-536,0v-110,3,-207,-97,-207,-207r0,-162xm264,-445v-45,-1,-85,40,-85,85r0,138v-1,45,40,85,85,85r428,0v45,1,85,-40,85,-85r0,-138v1,-45,-40,-85,-85,-85r-428,0","w":1104},"p":{"d":"986,-278v1,176,-93,278,-267,278r-552,0r0,222r-167,0r0,-778r719,0v171,-2,266,102,267,278xm811,-278v0,-81,-38,-139,-114,-139r-530,0r0,278r530,0v76,0,114,-58,114,-139","w":1141},"q":{"d":"0,-278v-1,-176,93,-278,267,-278r777,2r0,776r-167,0r0,-223r-610,1v-171,2,-266,-102,-267,-278xm175,-278v0,81,38,139,114,139r588,-1r0,-275r-588,-2v-77,0,-114,58,-114,139","w":1211},"r":{"d":"610,-558v134,0,213,83,197,228r-167,0v4,-51,-8,-86,-58,-86r-415,-1r0,417r-167,0r0,-556","w":950},"s":{"d":"913,-170v0,103,-65,170,-175,170r-738,0r0,-131r705,1v37,0,55,-14,55,-43v0,-28,-18,-42,-55,-42r-530,-1v-102,1,-175,-66,-175,-169v0,-101,66,-171,175,-171r708,0r0,131r-675,0v-37,0,-55,14,-55,42v0,28,18,42,55,42r530,1v102,-1,175,67,175,170","w":1039},"t":{"d":"267,-208v1,58,20,77,78,77r425,0r0,131r-504,0v-116,-3,-166,-47,-166,-167r0,-258r-100,0r0,-131r100,0r0,-222r167,0r0,222r503,0r0,131r-503,0r0,217","w":917},"u":{"d":"198,0v-119,6,-198,-71,-198,-170r0,-386r167,0r0,358v0,39,19,59,58,59r506,0r0,-417r167,0r0,556r-700,0"},"v":{"d":"167,-139r564,0r0,-417r167,0r0,556r-898,0r0,-556r167,0r0,417"},"w":{"d":"197,0v-115,4,-197,-68,-197,-170r0,-386r167,0r0,358v0,39,19,59,58,59r273,0r0,-417r167,0r0,417r326,0r0,-417r167,0r0,556r-961,0","w":1323},"x":{"d":"132,-208r646,0r0,-131r-646,0r0,131xm1,-138v-2,-70,61,-133,131,-131r0,131r-131,0xm0,-138r132,0r0,138r-132,0r0,-138xm1,-396v-2,71,61,133,131,131r0,-131r-131,0xm0,-396r132,0r0,-158r-132,0r0,158xm909,-138v2,-70,-61,-133,-131,-131r0,131r131,0xm910,-138r-132,0r0,138r132,0r0,-138xm909,-396v2,71,-61,133,-131,131r0,-131r131,0xm910,-396r-132,0r0,-158r132,0r0,158xm133,-454v-2,62,53,117,115,115r-115,0r0,-115xm133,-94v-2,-62,53,-117,115,-115r-115,0r0,115xm777,-454v2,62,-53,117,-115,115r115,0r0,-115xm778,-93v2,-62,-54,-117,-115,-115r115,0r0,115","w":1017},"y":{"d":"754,92v53,-1,68,-31,66,-92r-622,0v-119,6,-198,-71,-198,-170r0,-386r167,0r0,336v-1,49,32,82,81,81r572,0r0,-417r167,0r0,576v3,124,-85,207,-204,207r-769,0r0,-135r740,0","w":1169},"z":{"d":"0,-170v0,101,66,170,175,170r738,0r0,-131r-704,1v-37,0,-56,-14,-56,-43v0,-28,19,-42,56,-42r529,-1v102,1,175,-66,175,-169v0,-102,-66,-171,-175,-171r-707,-2r0,131r674,2v37,0,55,14,55,42v0,28,-18,42,-55,42r-530,1v-102,-1,-175,67,-175,170","w":1039},"{":{"d":"0,-466v58,7,98,-17,100,-66v3,-102,-10,-222,10,-308v23,-50,68,-91,143,-91r196,0r0,153r-163,0v-22,0,-33,11,-33,33r0,289v1,35,-29,68,-64,67v36,0,65,30,64,66r0,290v0,22,11,33,33,33r163,0r0,153r-196,0v-87,1,-153,-65,-153,-153r0,-246v-1,-49,-42,-75,-100,-67r0,-153","w":515},"|":{"w":211},"}":{"d":"349,-778v0,-93,-61,-152,-153,-153r-196,0r0,153r163,0v22,0,33,11,33,33r0,289v-1,35,29,68,64,67v-36,0,-65,30,-64,66r0,290v0,22,-11,33,-33,33r-163,0r0,153r196,0v91,0,153,-64,153,-153r0,-246v1,-49,42,-75,100,-67r0,-153v-58,7,-99,-17,-100,-66r0,-246","w":515},"~":{"w":342},"\u0131":{"w":256},"\u00c7":{"w":729},"\u00d6":{"w":1084},"\u00dc":{"w":761},"\u00e7":{"w":578},"\u00f6":{"d":"7,-368v-3,-111,96,-207,207,-207r536,0v112,-3,207,95,207,207r0,162v3,111,-96,207,-207,207r-536,0v-110,3,-207,-97,-207,-207r0,-162xm264,-445v-45,-1,-85,40,-85,85r0,138v-1,45,40,85,85,85r428,0v45,1,85,-40,85,-85r0,-138v1,-45,-40,-85,-85,-85r-428,0xm289,-650r0,-128r379,0r0,128r-379,0","w":1084},"\u00fc":{"d":"198,0v-119,6,-198,-71,-198,-170r0,-386r167,0r0,358v0,39,19,59,58,59r506,0r0,-417r167,0r0,556r-700,0xm284,-650r0,-128r379,0r0,128r-379,0","w":1032},"\u00a0":{"w":668}}});
diff --git a/doc/themes/triqs/static/triqs.css b/doc/themes/triqs/static/triqs.css
new file mode 100644
index 00000000..e183cb21
--- /dev/null
+++ b/doc/themes/triqs/static/triqs.css
@@ -0,0 +1,449 @@
+/*
+ * sphinx13.css
+ * ~~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- sphinx13 theme.
+ *
+ * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+@import url("basic.css");
+
+/* -- page layout ----------------------------------------------------------- */
+
+body {
+ font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
+ 'Verdana', sans-serif;
+ font-size: 14px;
+ text-align: center;
+ background-image: url(bodybg.png);
+ color: black;
+ padding: 0;
+ border-right: 1px solid #0a507a;
+ border-left: 1px solid #0a507a;
+
+ margin: 0 auto;
+ min-width: 780px;
+ max-width: 1080px;
+}
+
+
+.red{
+ color: red
+}
+.blue{
+ color: blue
+}
+.green{
+ color: green
+}
+
+.param{
+ color: blue
+}
+
+a.triqs {
+ color: #073958;
+ text-decoration: none;
+}
+
+a.triqs:hover {
+ color: #0a527f;
+ text-decoration: none;
+}
+
+.pageheader {
+ background-color: #dcdcdc;
+ text-align: left;
+ padding: 10px 15px;
+ color: #073958;
+ border: none;
+}
+
+.pageheader ul {
+ float: right;
+ color: #073958;
+ list-style-type: none;
+ padding-left: 0;
+ margin-top: 22px;
+ margin-right: 10px;
+}
+
+.pageheader li {
+ float: left;
+ margin: 0 0 0 10px;
+}
+
+.pageheader li a {
+ padding: 8px 12px;
+ color: #073958;
+ text-shadow: none;
+}
+
+.pageheader li a:hover {
+ background-color: #f9f9f0;
+ color: #0a507a;
+ text-shadow: none;
+}
+
+div.document {
+ background-color: white;
+ text-align: left;
+}
+
+div.bodywrapper {
+ margin: 0 240px 0 0;
+ border-right: 1px solid #0a507a;
+}
+
+div.body {
+ margin: 0;
+ padding: 0.5em 20px 20px 20px;
+}
+
+div.related {
+ font-size: 1em;
+ color: white;
+}
+
+div.related ul {
+ background-image: url(relbg.png);
+ height: 1.9em;
+ border-top: 1px solid #002e50;
+ border-bottom: 1px solid #002e50;
+}
+
+div.related ul li {
+ margin: 0 5px 0 0;
+ padding: 0;
+ float: left;
+}
+
+div.related ul li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+div.related ul li a {
+ margin: 0;
+ padding: 0 5px 0 5px;
+ line-height: 1.75em;
+ color: #f9f9f0;
+ text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.5);
+}
+
+div.related ul li a:hover {
+ color: white;
+ /*text-decoration: underline;*/
+ text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.5);
+}
+
+div.sphinxsidebarwrapper {
+ position: relative;
+ top: 0px;
+ padding: 0;
+}
+
+div.sphinxsidebar {
+ margin: 0;
+ padding: 0 15px 15px 0;
+ width: 210px;
+ float: right;
+ font-size: 1em;
+ text-align: left;
+}
+
+div.sphinxsidebar .logo {
+ font-size: 1.8em;
+ color: #0A507A;
+ font-weight: 300;
+ text-align: center;
+}
+
+div.sphinxsidebar .logo img {
+ vertical-align: middle;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #aaa;
+ font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
+ 'Verdana', sans-serif;
+ font-size: 1em;
+}
+
+div.sphinxsidebar h3 {
+ font-size: 1.5em;
+ border-top: 1px solid #0a507a;
+ margin-top: 1em;
+ margin-bottom: 0.5em;
+ padding-top: 0.5em;
+}
+
+div.sphinxsidebar h4 {
+ font-size: 1.2em;
+ margin-bottom: 0;
+}
+
+div.sphinxsidebar h3, div.sphinxsidebar h4 {
+ margin-right: -15px;
+ margin-left: -15px;
+ padding-right: 14px;
+ padding-left: 14px;
+ color: #333;
+ font-weight: 300;
+ /*text-shadow: 0px 0px 0.5px rgba(0, 0, 0, 0.4);*/
+}
+
+div.sphinxsidebarwrapper > h3:first-child {
+ margin-top: 0.5em;
+ border: none;
+}
+
+div.sphinxsidebar h3 a {
+ color: #333;
+}
+
+div.sphinxsidebar ul {
+ color: #444;
+ margin-top: 7px;
+ padding: 0;
+ line-height: 130%;
+}
+
+div.sphinxsidebar ul ul {
+ margin-left: 20px;
+ list-style-image: url(listitem.png);
+}
+
+div.footer {
+ background-image: url(footerbg.png);
+ color: #ccc;
+ text-shadow: 0 0 .2px rgba(255, 255, 255, 0.8);
+ padding: 3px 8px 3px 0;
+ clear: both;
+ font-size: 0.8em;
+ text-align: right;
+}
+
+/* no need to make a visible link to Sphinx on the Sphinx page */
+div.footer a {
+ color: #ccc;
+}
+
+/* -- body styles ----------------------------------------------------------- */
+
+p {
+ margin: 0.8em 0 0.5em 0;
+}
+
+a {
+ color: #A2881D;
+ text-decoration: none;
+}
+
+a:hover {
+ color: #E1C13F;
+}
+
+div.body a {
+ text-decoration: underline;
+}
+
+h1 {
+ margin: 10px 0 0 0;
+ font-size: 2.4em;
+ color: #0A507A;
+ font-weight: 300;
+}
+
+h2 {
+ margin: 1.em 0 0.2em 0;
+ font-size: 1.5em;
+ font-weight: 300;
+ padding: 0;
+ color: #174967;
+}
+
+h3 {
+ margin: 1em 0 -0.3em 0;
+ font-size: 1.3em;
+ font-weight: 300;
+}
+
+div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a {
+ text-decoration: none;
+}
+
+div.body h1 a tt, div.body h2 a tt, div.body h3 a tt, div.body h4 a tt, div.body h5 a tt, div.body h6 a tt {
+ color: #0A507A !important;
+ font-size: inherit !important;
+}
+
+a.headerlink {
+ color: #0A507A !important;
+ font-size: 12px;
+ margin-left: 6px;
+ padding: 0 4px 0 4px;
+ text-decoration: none !important;
+ float: right;
+}
+
+a.headerlink:hover {
+ background-color: #ccc;
+ color: white!important;
+}
+
+cite, code, tt {
+ font-family: 'Consolas', 'DejaVu Sans Mono',
+ 'Bitstream Vera Sans Mono', monospace;
+ font-size: 14px;
+ letter-spacing: -0.02em;
+}
+
+tt {
+ background-color: #f2f2f2;
+ border: 1px solid #ddd;
+ border-radius: 2px;
+ color: #333;
+ padding: 1px;
+}
+
+tt.descname, tt.descclassname, tt.xref {
+ border: 0;
+}
+
+hr {
+ border: 1px solid #abc;
+ margin: 2em;
+}
+
+a tt {
+ border: 0;
+ color: #a2881d;
+}
+
+a tt:hover {
+ color: #e1c13f;
+}
+
+pre {
+ font-family: 'Consolas', 'DejaVu Sans Mono',
+ 'Bitstream Vera Sans Mono', monospace;
+ font-size: 13px;
+ letter-spacing: 0.015em;
+ line-height: 120%;
+ padding: 0.5em;
+ border: 1px solid #ccc;
+ border-radius: 2px;
+ background-color: #f8f8f8;
+}
+
+pre a {
+ color: inherit;
+ text-decoration: underline;
+}
+
+td.linenos pre {
+ padding: 0.5em 0;
+}
+
+div.quotebar {
+ background-color: #f8f8f8;
+ max-width: 250px;
+ float: right;
+ padding: 0px 7px;
+ border: 1px solid #ccc;
+ margin-left: 1em;
+}
+
+div.topic {
+ background-color: #f8f8f8;
+}
+
+table {
+ border-collapse: collapse;
+ margin: 0 -0.5em 0 -0.5em;
+}
+
+table td, table th {
+ padding: 0.2em 0.5em 0.2em 0.5em;
+}
+
+div.admonition, div.warning {
+ font-size: 0.9em;
+ margin: 1em 0 1em 0;
+ border: 1px solid #86989B;
+ border-radius: 2px;
+ background-color: #f7f7f7;
+ padding: 0;
+}
+
+div.admonition p, div.warning p {
+ margin: 0.5em 1em 0.5em 1em;
+ padding: 0;
+}
+
+div.admonition pre, div.warning pre {
+ margin: 0.4em 1em 0.4em 1em;
+}
+
+div.admonition p.admonition-title,
+div.warning p.admonition-title {
+ margin-top: 1em;
+ padding-top: 0.5em;
+ font-weight: bold;
+}
+
+div.warning {
+ border: 1px solid #940000;
+/* background-color: #FFCCCF;*/
+}
+
+div.warning p.admonition-title {
+}
+
+div.admonition ul, div.admonition ol,
+div.warning ul, div.warning ol {
+ margin: 0.1em 0.5em 0.5em 3em;
+ padding: 0;
+}
+
+div.admonition .highlight, div.warning .highlight {
+ background-color: #f7f7f7;
+}
+
+.viewcode-back {
+ font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
+ 'Verdana', sans-serif;
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+}
+
+
+.my-code-block.std-ref {
+ color : red;
+}
+
+.cppbrief {
+ color: #C6792C;
+ font-style: oblique;
+}
+
+.cppsynopsis {
+ background-color: #E7EDF9;
+ /*font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif;*/
+ /*font-family: monospace; */
+ font-family: Verdana, Arial, Lucida Console;
+ font-size=80%;
+ /*font-style: oblique;*/
+ /* white-space: pre;*/
+}
+
+
+
diff --git a/doc/themes/triqs/theme.conf b/doc/themes/triqs/theme.conf
new file mode 100644
index 00000000..96ca439a
--- /dev/null
+++ b/doc/themes/triqs/theme.conf
@@ -0,0 +1,4 @@
+[theme]
+inherit = basic
+stylesheet = triqs.css
+pygments_style = sphinx
diff --git a/fortran/dmftproj/CMakeLists.txt b/fortran/dmftproj/CMakeLists.txt
index 7e646998..a3d627ef 100644
--- a/fortran/dmftproj/CMakeLists.txt
+++ b/fortran/dmftproj/CMakeLists.txt
@@ -6,8 +6,7 @@ set(SOURCES modules.f dmftproj.f readcomline.f set_ang_trans.f setsym.f
# The main target and what to link with...
add_executable(dmftproj ${SOURCES})
-find_package(LAPACK)
-target_link_libraries(dmftproj ${LAPACK_LIBRARIES})
+target_link_libraries(dmftproj triqs::blas_lapack)
# where to install
install (TARGETS dmftproj DESTINATION bin)
@@ -17,7 +16,7 @@ SET(D ${CMAKE_CURRENT_SOURCE_DIR}/SRC_templates/)
SET(WIEN_SRC_TEMPL_FILES ${D}/case.cf_f_mm2 ${D}/case.cf_p_cubic ${D}/case.indmftpr ${D}/run_triqs ${D}/runsp_triqs)
message(STATUS "-----------------------------------------------------------------------------")
message(STATUS " ******** WARNING ******** ")
-message(STATUS " Wien2k 14.2 and older : after installation of TRIQS, copy the files from ")
+message(STATUS " Wien2k 14.2 and older : after installation of DFTTools, copy the files from ")
message(STATUS " ${CMAKE_INSTALL_PREFIX}/share/triqs/Wien2k_SRC_files/SRC_templates ")
message(STATUS " to your Wien2k installation WIENROOT/SRC_templates (Cf documentation). ")
message(STATUS " For newer versions these files are already shipped with Wien2k. ")
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
deleted file mode 100644
index 2ad35566..00000000
--- a/python/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-# where will the python end up in triqs?
-set(PYTHON_LIB_DEST ${CPP2PY_PYTHON_LIB_DEST_ROOT}/triqs_dft_tools)
-
-# site_customize for build
-set(package_name "triqs_dft_tools")
-
-# Create a temporary copy of the python modules so that we can run before installation with the test
-FILE(GLOB PYTHON_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py )
-foreach(f ${PYTHON_SOURCES})
- configure_file(${f} ${f} COPYONLY)
-endforeach()
-
-# add version file
-configure_file(version.py.in version.py @ONLY)
-
-# install files
-install(FILES ${PYTHON_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/version.py DESTINATION ${PYTHON_LIB_DEST})
-
-add_subdirectory(converters)
diff --git a/python/converters/.gitignore b/python/converters/.gitignore
deleted file mode 100644
index 0d20b648..00000000
--- a/python/converters/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.pyc
diff --git a/python/converters/CMakeLists.txt b/python/converters/CMakeLists.txt
deleted file mode 100644
index 3c719f26..00000000
--- a/python/converters/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# Create a temporary copy of the python modules so that we can run before installation with the test
-FILE(GLOB PYTHON_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py)
-foreach(f ${PYTHON_SOURCES})
- configure_file(${f} ${f} COPYONLY)
-endforeach()
-
-# install files
-install(FILES ${PYTHON_SOURCES} DESTINATION ${PYTHON_LIB_DEST}/converters)
-
-add_subdirectory(plovasp)
diff --git a/python/converters/plovasp/CMakeLists.txt b/python/converters/plovasp/CMakeLists.txt
deleted file mode 100644
index 9f2fbdaa..00000000
--- a/python/converters/plovasp/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-# === Build and install atm module
-add_cpp2py_module(atm)
-target_link_libraries(atm atm_c triqs)
-target_compile_options(atm PRIVATE -std=c++17)
-target_include_directories(atm PRIVATE ${CMAKE_SOURCE_DIR}/c++)
-
-install(TARGETS atm DESTINATION ${PYTHON_LIB_DEST}/converters/plovasp)
-
-# === Copy Python files to current build directory and register for install
-set(PYTHON_SOURCES __init__.py converter.py elstruct.py inpconf.py plotools.py proj_group.py proj_shell.py sc_dmft.py vaspio.py)
-foreach(f ${PYTHON_SOURCES})
- configure_file(${f} ${f} COPYONLY)
-endforeach()
-
-# install files
-install(FILES ${PYTHON_SOURCES} DESTINATION ${PYTHON_LIB_DEST}/converters/plovasp)
-
-# This we need in order for tests to work
-#add_custom_command(TARGET atm POST_BUILD COMMAND ln -fs ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/atm.so ${CMAKE_BINARY_DIR}/python/dft/converters/plovasp)
diff --git a/python/triqs_dft_tools/CMakeLists.txt b/python/triqs_dft_tools/CMakeLists.txt
new file mode 100644
index 00000000..5de94b6a
--- /dev/null
+++ b/python/triqs_dft_tools/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Configure the version
+configure_file(version.py.in version.py)
+
+# All Python files. Copy them in the build dir to have a complete package for the tests.
+file(GLOB_RECURSE python_sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py)
+file(GLOB_RECURSE wrap_generators RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *_desc.py)
+list(REMOVE_ITEM python_sources "${wrap_generators}")
+foreach(file ${python_sources})
+ configure_file(${file} ${file} COPYONLY)
+endforeach()
+
+# Build any python modules
+foreach(gen ${wrap_generators})
+ string(REPLACE "_desc.py" "" gen ${gen})
+ get_filename_component(module_name ${gen} NAME_WE)
+ get_filename_component(module_dir ${gen} DIRECTORY)
+ add_cpp2py_module(NAME ${module_name} DIRECTORY ${module_dir})
+ target_link_libraries(${module_name} ${PROJECT_NAME}_c triqs_py)
+endforeach()
+
+# Install python modules to proper location
+set(PYTHON_LIB_DEST ${TRIQS_PYTHON_LIB_DEST_ROOT}/${PROJECT_NAME})
+get_property(CPP2PY_MODULES_LIST GLOBAL PROPERTY CPP2PY_MODULES_LIST)
+install(TARGETS ${CPP2PY_MODULES_LIST} DESTINATION ${PYTHON_LIB_DEST})
+install(FILES ${python_sources} ${CMAKE_CURRENT_BINARY_DIR}/version.py DESTINATION ${PYTHON_LIB_DEST})
diff --git a/python/__init__.py b/python/triqs_dft_tools/__init__.py
similarity index 100%
rename from python/__init__.py
rename to python/triqs_dft_tools/__init__.py
diff --git a/python/block_structure.py b/python/triqs_dft_tools/block_structure.py
similarity index 100%
rename from python/block_structure.py
rename to python/triqs_dft_tools/block_structure.py
diff --git a/python/clear_h5_output.py b/python/triqs_dft_tools/clear_h5_output.py
similarity index 100%
rename from python/clear_h5_output.py
rename to python/triqs_dft_tools/clear_h5_output.py
diff --git a/python/converters/__init__.py b/python/triqs_dft_tools/converters/__init__.py
similarity index 100%
rename from python/converters/__init__.py
rename to python/triqs_dft_tools/converters/__init__.py
diff --git a/python/converters/converter_tools.py b/python/triqs_dft_tools/converters/converter_tools.py
similarity index 100%
rename from python/converters/converter_tools.py
rename to python/triqs_dft_tools/converters/converter_tools.py
diff --git a/python/converters/hk_converter.py b/python/triqs_dft_tools/converters/hk_converter.py
similarity index 100%
rename from python/converters/hk_converter.py
rename to python/triqs_dft_tools/converters/hk_converter.py
diff --git a/python/converters/plovasp/.gitignore b/python/triqs_dft_tools/converters/plovasp/.gitignore
similarity index 100%
rename from python/converters/plovasp/.gitignore
rename to python/triqs_dft_tools/converters/plovasp/.gitignore
diff --git a/python/converters/plovasp/__init__.py b/python/triqs_dft_tools/converters/plovasp/__init__.py
similarity index 100%
rename from python/converters/plovasp/__init__.py
rename to python/triqs_dft_tools/converters/plovasp/__init__.py
diff --git a/python/converters/plovasp/atm_desc.py b/python/triqs_dft_tools/converters/plovasp/atm_desc.py
similarity index 82%
rename from python/converters/plovasp/atm_desc.py
rename to python/triqs_dft_tools/converters/plovasp/atm_desc.py
index 55ff109a..383a98d9 100644
--- a/python/converters/plovasp/atm_desc.py
+++ b/python/triqs_dft_tools/converters/plovasp/atm_desc.py
@@ -1,5 +1,5 @@
# Generated automatically using the command :
-# c++2py.py -m atm -o atm --moduledoc "Analytical Tetrahedron Method for DOS" ../../../c++/plovasp/atm/dos_tetra3d.hpp
+# c++2py.py -m atm -o atm --moduledoc "Analytical Tetrahedron Method for DOS" ../../../../c++/triqs_dft_tools/converters/vasp/dos_tetra3d.hpp
from cpp2py.wrap_generator import *
# The module
@@ -8,11 +8,12 @@ module = module_(full_name = "atm", doc = "Analytical Tetrahedron Method for cal
# All the triqs C++/Python modules
# Add here all includes beyond what is automatically included by the triqs modules
-module.add_include("plovasp/atm/dos_tetra3d.hpp")
+module.add_include("triqs_dft_tools/converters/vasp/dos_tetra3d.hpp")
# Add here anything to add in the C++ code at the start, e.g. namespace using
module.add_preamble("""
#include
+using namespace triqs::arrays;
""")
module.add_function ("array dos_tetra_weights_3d (array_view eigk, double en, array_view itt)", doc = """DOS of a band by analytical tetrahedron method\n\n Returns corner weights for all tetrahedra for a given band and real energy.""")
diff --git a/python/converters/plovasp/converter.py b/python/triqs_dft_tools/converters/plovasp/converter.py
similarity index 100%
rename from python/converters/plovasp/converter.py
rename to python/triqs_dft_tools/converters/plovasp/converter.py
diff --git a/python/converters/plovasp/elstruct.py b/python/triqs_dft_tools/converters/plovasp/elstruct.py
similarity index 100%
rename from python/converters/plovasp/elstruct.py
rename to python/triqs_dft_tools/converters/plovasp/elstruct.py
diff --git a/python/converters/plovasp/inpconf.py b/python/triqs_dft_tools/converters/plovasp/inpconf.py
similarity index 100%
rename from python/converters/plovasp/inpconf.py
rename to python/triqs_dft_tools/converters/plovasp/inpconf.py
diff --git a/python/converters/plovasp/plotools.py b/python/triqs_dft_tools/converters/plovasp/plotools.py
similarity index 100%
rename from python/converters/plovasp/plotools.py
rename to python/triqs_dft_tools/converters/plovasp/plotools.py
diff --git a/python/converters/plovasp/proj_group.py b/python/triqs_dft_tools/converters/plovasp/proj_group.py
similarity index 100%
rename from python/converters/plovasp/proj_group.py
rename to python/triqs_dft_tools/converters/plovasp/proj_group.py
diff --git a/python/converters/plovasp/proj_shell.py b/python/triqs_dft_tools/converters/plovasp/proj_shell.py
similarity index 98%
rename from python/converters/plovasp/proj_shell.py
rename to python/triqs_dft_tools/converters/plovasp/proj_shell.py
index 73b4c140..f6982fe0 100644
--- a/python/converters/plovasp/proj_shell.py
+++ b/python/triqs_dft_tools/converters/plovasp/proj_shell.py
@@ -39,12 +39,7 @@ def issue_warning(message):
import itertools as it
import numpy as np
-try:
- import atm
- atmlib_present = True
-except ImportError:
- issue_warning("Error importing ATM libray, DOS calculation will fail!")
- atmlib_present = False
+from . import atm
np.set_printoptions(suppress=True)
@@ -399,7 +394,6 @@ class ProjectorShell:
"""
nion, ns, nk, nlm, nbtot = self.proj_win.shape
- assert atmlib_present, "ATM library was not imported; cannot calculate DOS"
# There is a problem with data storage structure of projectors that will
# make life more complicated. The problem is that band-indices of projectors
# for different k-points do not match because we store 'nb_max' values starting
diff --git a/python/converters/plovasp/sc_dmft.py b/python/triqs_dft_tools/converters/plovasp/sc_dmft.py
similarity index 100%
rename from python/converters/plovasp/sc_dmft.py
rename to python/triqs_dft_tools/converters/plovasp/sc_dmft.py
diff --git a/python/converters/plovasp/vaspio.py b/python/triqs_dft_tools/converters/plovasp/vaspio.py
similarity index 100%
rename from python/converters/plovasp/vaspio.py
rename to python/triqs_dft_tools/converters/plovasp/vaspio.py
diff --git a/python/converters/vasp_converter.py b/python/triqs_dft_tools/converters/vasp_converter.py
similarity index 100%
rename from python/converters/vasp_converter.py
rename to python/triqs_dft_tools/converters/vasp_converter.py
diff --git a/python/converters/wannier90_converter.py b/python/triqs_dft_tools/converters/wannier90_converter.py
similarity index 100%
rename from python/converters/wannier90_converter.py
rename to python/triqs_dft_tools/converters/wannier90_converter.py
diff --git a/python/converters/wien2k_converter.py b/python/triqs_dft_tools/converters/wien2k_converter.py
similarity index 100%
rename from python/converters/wien2k_converter.py
rename to python/triqs_dft_tools/converters/wien2k_converter.py
diff --git a/python/sumk_dft.py b/python/triqs_dft_tools/sumk_dft.py
similarity index 100%
rename from python/sumk_dft.py
rename to python/triqs_dft_tools/sumk_dft.py
diff --git a/python/sumk_dft_tools.py b/python/triqs_dft_tools/sumk_dft_tools.py
similarity index 100%
rename from python/sumk_dft_tools.py
rename to python/triqs_dft_tools/sumk_dft_tools.py
diff --git a/python/symmetry.py b/python/triqs_dft_tools/symmetry.py
similarity index 100%
rename from python/symmetry.py
rename to python/triqs_dft_tools/symmetry.py
diff --git a/python/trans_basis.py b/python/triqs_dft_tools/trans_basis.py
similarity index 100%
rename from python/trans_basis.py
rename to python/triqs_dft_tools/trans_basis.py
diff --git a/python/update_archive.py b/python/triqs_dft_tools/update_archive.py
similarity index 100%
rename from python/update_archive.py
rename to python/triqs_dft_tools/update_archive.py
diff --git a/python/version.py.in b/python/triqs_dft_tools/version.py.in
similarity index 73%
rename from python/version.py.in
rename to python/triqs_dft_tools/version.py.in
index 489e0617..06a9e558 100644
--- a/python/version.py.in
+++ b/python/triqs_dft_tools/version.py.in
@@ -3,6 +3,9 @@
# TRIQS: a Toolbox for Research in Interacting Quantum Systems
#
# Copyright (C) 2011 by M. Aichhorn, L. Pourovskii, V. Vildosola
+# Copyright (C) 2016-2018, N. Wentzell
+# Copyright (C) 2018-2019, Simons Foundation
+# author: N. Wentzell
#
# TRIQS is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
@@ -19,12 +22,12 @@
#
################################################################################
-version = "@DFT_TOOLS_VERSION@"
+version = "@PROJECT_VERSION@"
triqs_hash = "@TRIQS_GIT_HASH@"
-dft_tools_hash = "@DFT_TOOLS_GIT_HASH@"
+@PROJECT_NAME@_hash = "@PROJECT_GIT_HASH@"
def show_version():
- print("\nYou are using the dft_tools version %s\n"%version)
+ print("\nYou are using @PROJECT_NAME@ version %s\n"%version)
def show_git_hash():
- print("\nYou are using the dft_tools git hash %s based on triqs git hash %s\n"%(dft_tools_hash, triqs_hash))
+ print("\nYou are using @PROJECT_NAME@ git hash %s based on triqs git hash %s\n"%("@PROJECT_GIT_HASH@", triqs_hash))
diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt
new file mode 100644
index 00000000..f6da5199
--- /dev/null
+++ b/share/CMakeLists.txt
@@ -0,0 +1,28 @@
+add_subdirectory(cmake)
+
+if(NOT CMAKE_INSTALL_PREFIX STREQUAL TRIQS_ROOT AND NOT IS_SUBPROJECT)
+
+ if(PythonSupport)
+ set(EXPORT_PYTHON_PATH "export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CPP2PY_PYTHON_LIB_DEST_ROOT}:$PYTHONPATH")
+ set(MODFILE_PYTHON_PATH "prepend-path PYTHONPATH $root/${CPP2PY_PYTHON_LIB_DEST_ROOT}")
+ endif()
+
+ configure_file(${PROJECT_NAME}.modulefile.in ${PROJECT_NAME}.modulefile @ONLY)
+ configure_file(${PROJECT_NAME}vars.sh.in ${PROJECT_NAME}vars.sh @ONLY)
+
+ install(
+ FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.modulefile
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}vars.sh
+ DESTINATION share
+ )
+
+ message(STATUS "***************************************************************")
+ message(STATUS "* Custom install Location. Use: ")
+ message(STATUS "* ")
+ message(STATUS "* source ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}vars.sh ")
+ message(STATUS "* ")
+ message(STATUS "* to set up the environment variables ")
+ message(STATUS "***************************************************************")
+
+endif()
diff --git a/share/cmake/CMakeLists.txt b/share/cmake/CMakeLists.txt
new file mode 100644
index 00000000..dad532b3
--- /dev/null
+++ b/share/cmake/CMakeLists.txt
@@ -0,0 +1,10 @@
+configure_file(${PROJECT_NAME}-config.cmake.in ${PROJECT_NAME}-config.cmake @ONLY)
+configure_file(${PROJECT_NAME}-config-version.cmake.in ${PROJECT_NAME}-config-version.cmake @ONLY)
+install(
+ FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
+ DESTINATION lib/cmake/${PROJECT_NAME}
+)
+
+install(EXPORT ${PROJECT_NAME}-targets NAMESPACE ${PROJECT_NAME}:: DESTINATION lib/cmake/${PROJECT_NAME})
diff --git a/share/cmake/Modules/FindSphinx.cmake b/share/cmake/Modules/FindSphinx.cmake
new file mode 100644
index 00000000..b8cc28a8
--- /dev/null
+++ b/share/cmake/Modules/FindSphinx.cmake
@@ -0,0 +1,37 @@
+# Copyright Olivier Parcollet 2017.
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+# This module looks for sphinx documentation tool
+# and define a function that prepares the Makefile for sphinx-build
+
+find_program(SPHINXBUILD_EXECUTABLE
+ NAMES sphinx-build
+ PATHS /usr/bin /opt/local/bin /usr/local/bin #opt/sphinx-doc/bin
+ PATH_SUFFIXES bin
+ )
+
+if (NOT SPHINXBUILD_EXECUTABLE)
+ message(FATAL_ERROR "I cannot find sphinx to build the triqs documentation")
+endif()
+
+execute_process(
+ COMMAND "${SPHINXBUILD_EXECUTABLE}" --version
+ OUTPUT_VARIABLE SPHINXBUILD_VERSION
+ ERROR_VARIABLE SPHINXBUILD_VERSION
+ )
+if (SPHINXBUILD_VERSION MATCHES "[Ss]phinx.* ([0-9]+\\.[0-9]+(\\.|b)[0-9]+)")
+ set (SPHINXBUILD_VERSION "${CMAKE_MATCH_1}")
+endif()
+
+if (SPHINXBUILD_VERSION VERSION_EQUAL 1.6.3)
+ message(FATAL_ERROR "sphinx-build found at ${SPHINXBUILD_EXECUTABLE} but version 1.6.3 has a bug. Upgrade sphinx.")
+else()
+ message(STATUS "sphinx-build program found at ${SPHINXBUILD_EXECUTABLE} with version ${SPHINXBUILD_VERSION}")
+endif ()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SPHINX DEFAULT_MSG SPHINXBUILD_EXECUTABLE)
+
+mark_as_advanced( SPHINXBUILD_EXECUTABLE )
diff --git a/share/cmake/extract_flags.cmake b/share/cmake/extract_flags.cmake
new file mode 100644
index 00000000..dfcf67b0
--- /dev/null
+++ b/share/cmake/extract_flags.cmake
@@ -0,0 +1,102 @@
+###################################################################################
+#
+# TRIQS: a Toolbox for Research in Interacting Quantum Systems
+#
+# Copyright (C) 2019-2020 Simons Foundation
+# author: N. Wentzell
+#
+# TRIQS is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
+#
+# TRIQS is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# TRIQS. If not, see .
+#
+###################################################################################
+
+# Recursively fetch all targets that the interface of a target depends upon
+macro(get_all_interface_targets name target)
+ get_property(TARGET_LINK_LIBRARIES TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES)
+ foreach(lib IN LISTS TARGET_LINK_LIBRARIES)
+ if(TARGET ${lib})
+ # Append to list
+ list(APPEND ${name}_INTERFACE_TARGETS ${lib})
+ # Recure into target dependencies
+ get_all_interface_targets(${name} ${lib})
+ endif()
+ endforeach()
+endmacro()
+
+# Extract the property from the target and recursively from all targets it depends upon
+macro(get_property_recursive)
+ cmake_parse_arguments(get_property_recursive "" "TARGET" "PROPERTY" ${ARGN})
+ set(target ${get_property_recursive_TARGET})
+ set(property ${get_property_recursive_PROPERTY})
+ get_all_interface_targets(${target} ${target})
+ foreach(t IN LISTS ${target}_INTERFACE_TARGETS ITEMS ${target})
+ get_property(p TARGET ${t} PROPERTY ${property})
+ list(APPEND ${ARGV0} ${p})
+ endforeach()
+ # Clean duplicates and any occurance of '/usr/include' dirs
+ if(${ARGV0})
+ list(REMOVE_DUPLICATES ${ARGV0})
+ list(REMOVE_ITEM ${ARGV0} /usr/include)
+ endif()
+endmacro()
+
+# Recursively fetch all compiler flags attached to the interface of a target
+macro(extract_flags)
+
+ cmake_parse_arguments(ARG "BUILD_INTERFACE" "" "" ${ARGN})
+
+ set(target ${ARGV0})
+ unset(${target}_CXXFLAGS)
+ unset(${target}_LDFLAGS)
+
+ get_property_recursive(opts TARGET ${target} PROPERTY INTERFACE_COMPILE_OPTIONS)
+ foreach(opt ${opts})
+ set(${target}_LDFLAGS "${${target}_LDFLAGS} ${opt}")
+ set(${target}_CXXFLAGS "${${target}_CXXFLAGS} ${opt}")
+ endforeach()
+
+ get_property_recursive(defs TARGET ${target} PROPERTY INTERFACE_COMPILE_DEFINITIONS)
+ foreach(def ${defs})
+ set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -D${def}")
+ endforeach()
+
+ get_property_recursive(inc_dirs TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+ get_property_recursive(sys_inc_dirs TARGET ${target} PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
+ if(inc_dirs)
+ list(REMOVE_ITEM sys_inc_dirs ${inc_dirs})
+ endif()
+ foreach(dir ${inc_dirs})
+ set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -I${dir}")
+ endforeach()
+ foreach(dir ${sys_inc_dirs})
+ set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -isystem${dir}")
+ endforeach()
+
+ get_property_recursive(libs TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES)
+ foreach(lib ${libs})
+ if(NOT TARGET ${lib} AND NOT IS_DIRECTORY ${lib})
+ set(${target}_LDFLAGS "${${target}_LDFLAGS} ${lib}")
+ endif()
+ endforeach()
+
+ # We have to replace generator expressions explicitly
+ if(ARG_BUILD_INTERFACE)
+ string(REGEX REPLACE "\\$" "\\1" ${target}_LDFLAGS "${${target}_LDFLAGS}")
+ string(REGEX REPLACE "\\$" "\\1" ${target}_CXXFLAGS "${${target}_CXXFLAGS}")
+ else()
+ string(REGEX REPLACE "\\$" "\\1" ${target}_LDFLAGS "${${target}_LDFLAGS}")
+ string(REGEX REPLACE "\\$" "\\1" ${target}_CXXFLAGS "${${target}_CXXFLAGS}")
+ endif()
+ string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^>]*>" "" ${target}_LDFLAGS "${${target}_LDFLAGS}")
+ string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^>]*>" "" ${target}_CXXFLAGS "${${target}_CXXFLAGS}")
+endmacro()
diff --git a/share/cmake/triqs_dft_tools-config-version.cmake.in b/share/cmake/triqs_dft_tools-config-version.cmake.in
new file mode 100644
index 00000000..c4c43a4b
--- /dev/null
+++ b/share/cmake/triqs_dft_tools-config-version.cmake.in
@@ -0,0 +1,13 @@
+set(PACKAGE_VERSION @PROJECT_VERSION@)
+
+if (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
+ set(PACKAGE_VERSION_EXACT TRUE)
+endif()
+
+if (PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION)
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+endif()
+
+if (PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
+ set(PACKAGE_VERSION_UNSUITABLE TRUE)
+endif()
diff --git a/share/cmake/triqs_dft_tools-config.cmake.in b/share/cmake/triqs_dft_tools-config.cmake.in
new file mode 100644
index 00000000..e9101328
--- /dev/null
+++ b/share/cmake/triqs_dft_tools-config.cmake.in
@@ -0,0 +1,32 @@
+# This file allows other CMake Projects to find us
+# We provide general project information
+# and reestablish the exported CMake Targets
+
+# Multiple inclusion guard
+if(NOT @PROJECT_NAME@_FOUND)
+set(@PROJECT_NAME@_FOUND TRUE)
+set_property(GLOBAL PROPERTY @PROJECT_NAME@_FOUND TRUE)
+
+# version
+set(@PROJECT_NAME@_VERSION @PROJECT_VERSION@ CACHE STRING "@PROJECT_NAME@ version")
+set(@PROJECT_NAME@_GIT_HASH @PROJECT_GIT_HASH@ CACHE STRING "@PROJECT_NAME@ git hash")
+
+# Root of the installation
+set(@PROJECT_NAME@_ROOT @CMAKE_INSTALL_PREFIX@ CACHE STRING "@PROJECT_NAME@ root directory")
+
+## Find the target dependencies
+#include(CMakeFindDependencyMacro)
+#find_dependency(... HINTS @CMAKE_INSTALL_PREFIX@)
+
+# Include the exported targets of this project
+include(@CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/@PROJECT_NAME@-targets.cmake)
+
+message(STATUS "Found @PROJECT_NAME@-config.cmake with version @PROJECT_VERSION@, hash = @PROJECT_GIT_HASH@")
+
+# Was the Project built with Documentation?
+set(@PROJECT_NAME@_WITH_DOCUMENTATION @Build_Documentation@ CACHE BOOL "Was @PROJECT_NAME@ build with documentation?")
+
+# Was the Project built with PythonSupport?
+set(@PROJECT_NAME@_WITH_PYTHON_SUPPORT @PythonSupport@ CACHE BOOL "Was @PROJECT_NAME@ build with python support?")
+
+endif()
diff --git a/share/replace_and_rename.py b/share/replace_and_rename.py
new file mode 100755
index 00000000..b183fb40
--- /dev/null
+++ b/share/replace_and_rename.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python2
+
+import sys
+import os
+import glob
+
+if len(sys.argv) != 2:
+ print("Please pass the application name")
+ sys.exit()
+
+app_name = str(sys.argv[1]).lower()
+capital_name = app_name.upper()
+
+# Move app4triqs directories if necessary
+if os.path.isdir("c++/app4triqs"): os.rename("c++/app4triqs", "c++/" + app_name)
+if os.path.isdir("python/app4triqs"): os.rename("python/app4triqs", "python/" + app_name)
+
+# Ignore these files
+ignore_lst = [".git/", "replace_and_rename.py", "squash_history.sh"]
+
+# Find the root directory of app4triqs
+app4triqs_root = os.path.abspath(os.path.dirname(__file__) + "/..")
+
+# Recurse over all subdirectories and files
+for root, dirs, files in os.walk(app4triqs_root):
+
+ for fname in files:
+ fpath = os.path.join(root, fname)
+
+ # Ignore certain files / directories
+ if any(it in fpath for it in ignore_lst): continue
+
+ if os.path.isfile(fpath):
+ # Rename files containing app4triqs in their filename
+ if "app4triqs" in fname:
+ new_fpath = os.path.join(root, fname.replace("app4triqs", app_name))
+ os.rename(fpath, new_fpath)
+ fpath = new_fpath
+
+ # Replace app4triqs and APP4TRIQS in all files
+ with open(fpath, 'r') as f:
+ s = f.read()
+ if "app4triqs" in s or "APP4TRIQS" in s:
+ with open(fpath, 'w') as f:
+ f.write(s.replace("app4triqs", app_name).replace("APP4TRIQS", capital_name))
diff --git a/cmake/sitecustomize.py b/share/sitecustomize.py
similarity index 100%
rename from cmake/sitecustomize.py
rename to share/sitecustomize.py
diff --git a/share/squash_history.sh b/share/squash_history.sh
new file mode 100755
index 00000000..8c03c08f
--- /dev/null
+++ b/share/squash_history.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+git reset $(git commit-tree HEAD\^{tree} -m "Initialize project from github.com/triqs/app4triqs@$(git rev-parse --short HEAD)")
+git merge --allow-unrelated-histories -s ours HEAD@{1} -m "Track app4triqs skeleton"
+git remote rm origin
+git remote add app4triqs_remote https://github.com/triqs/app4triqs
diff --git a/share/triqs_dft_tools.modulefile.in b/share/triqs_dft_tools.modulefile.in
new file mode 100644
index 00000000..2c9befe8
--- /dev/null
+++ b/share/triqs_dft_tools.modulefile.in
@@ -0,0 +1,39 @@
+#%Module1.0
+#
+# To be installed as ${MODULEPATH}/@PROJECT_NAME@/@PROJECT_VERSION@
+
+set name @PROJECT_NAME@
+set version @PROJECT_VERSION@
+set root @CMAKE_INSTALL_PREFIX@
+set git_hash @PROJECT_GIT_HASH@
+
+set url "https://github.com/TRIQS/@PROJECT_NAME@"
+set description "An example application using cpp2py and triqs."
+
+module-whatis "$description"
+
+proc ModulesHelp { } {
+ global description url version git_hash
+ puts stderr "Description: $description"
+ puts stderr "URL: $url"
+ puts stderr "Version: $version"
+ puts stderr "Git hash: $git_hash"
+}
+
+# You may need to edit the next line if the triqs module
+# is installed under a different name in your setup.
+prereq triqs/@TRIQS_VERSION@
+
+# Only one version of @PROJECT_NAME@ can be loaded at a time
+conflict $name
+
+setenv @PROJECT_NAME@_ROOT $root
+setenv @PROJECT_NAME@_VERSION $version
+setenv @PROJECT_NAME@_GIT_HASH $git_hash
+
+prepend-path PATH $root/bin
+prepend-path CPLUS_INCLUDE_PATH $root/include
+prepend-path LIBRARY_PATH $root/lib
+prepend-path LD_LIBRARY_PATH $root/lib
+prepend-path CMAKE_PREFIX_PATH $root
+@MODFILE_PYTHON_PATH@
diff --git a/share/triqs_dft_toolsvars.sh.in b/share/triqs_dft_toolsvars.sh.in
new file mode 100644
index 00000000..492a7a26
--- /dev/null
+++ b/share/triqs_dft_toolsvars.sh.in
@@ -0,0 +1,10 @@
+# Source this in your environment.
+
+export @PROJECT_NAME@_ROOT=@CMAKE_INSTALL_PREFIX@
+
+export CPLUS_INCLUDE_PATH=@CMAKE_INSTALL_PREFIX@/include:$CPLUS_INCLUDE_PATH
+export PATH=@CMAKE_INSTALL_PREFIX@/bin:$PATH
+export LIBRARY_PATH=@CMAKE_INSTALL_PREFIX@/lib:$LIBRARY_PATH
+export LD_LIBRARY_PATH=@CMAKE_INSTALL_PREFIX@/lib:$LD_LIBRARY_PATH
+export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@:$CMAKE_PREFIX_PATH
+@EXPORT_PYTHON_PATH@
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index dac8f0db..9eaefe3d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,25 +1,6 @@
-# Copy h5 files to binary dir
-FILE(GLOB all_h5_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h5)
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${all_h5_files} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-# Copy other files
-FILE(COPY SrVO3.pmat SrVO3.struct SrVO3.outputs SrVO3.oubwin SrVO3.ctqmcout SrVO3.symqmc SrVO3.sympar SrVO3.parproj SrIrO3_rot.h5 hk_convert_hamiltonian.hk LaVO3-Pnma_hr.dat LaVO3-Pnma.inp DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+add_subdirectory(c++)
-# List all tests
-set(all_tests wien2k_convert hk_convert w90_convert sumkdft_basic srvo3_Gloc srvo3_transp sigma_from_file blockstructure analyse_block_structure_from_gf analyse_block_structure_from_gf2)
-
-set(python_executable ${TRIQS_PYTHON_EXECUTABLE})
-
-if(TEST_COVERAGE)
- set(python_executable ${PYTHON_COVERAGE} run --append --source "${CMAKE_BINARY_DIR}/python")
+if(PythonSupport)
+ add_subdirectory(python)
+ add_subdirectory(python/plovasp)
endif()
-
-foreach(t ${all_tests})
- add_test(NAME ${t} COMMAND ${python_executable} ${CMAKE_CURRENT_SOURCE_DIR}/${t}.py)
-endforeach()
-
-# Set the PythonPath : put the build dir first (in case there is an installed version).
-set_property(TEST ${all_tests} PROPERTY ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/python:$ENV{PYTHONPATH} )
-
-
-# VASP converter tests
-add_subdirectory(plovasp)
diff --git a/test/c++/CMakeLists.txt b/test/c++/CMakeLists.txt
new file mode 100644
index 00000000..071b5fd2
--- /dev/null
+++ b/test/c++/CMakeLists.txt
@@ -0,0 +1,35 @@
+# Copy h5 files to binary dir
+file(GLOB_RECURSE all_h5_ref_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.ref.h5)
+foreach(file ${all_h5_ref_files})
+ configure_file(${file} ${file} COPYONLY)
+endforeach()
+
+# List of all tests
+file(GLOB_RECURSE all_tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
+
+foreach(test ${all_tests})
+ get_filename_component(test_name ${test} NAME_WE)
+ get_filename_component(test_dir ${test} DIRECTORY)
+ add_executable(${test_name} ${test})
+ target_link_libraries(${test_name} ${PROJECT_NAME}_c gtest_main ${PROJECT_NAME}_warnings)
+ set_property(TARGET ${test_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_dir})
+ add_test(NAME ${test_name} COMMAND ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_dir})
+ # Run clang-tidy if found
+ if(CLANG_TIDY_EXECUTABLE)
+ set_target_properties(${test_name} PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE}")
+ endif()
+ # Run cppcheck if found
+ if(CPPCHECK_EXECUTABLE)
+ add_custom_command(
+ TARGET ${test_name}
+ COMMAND ${CPPCHECK_EXECUTABLE}
+ --enable=warning,style,performance,portability
+ --std=c++17
+ --template=gcc
+ --verbose
+ --force
+ --quiet
+ ${CMAKE_CURRENT_SOURCE_DIR}/${test}
+ )
+ endif()
+endforeach()
diff --git a/c++/plovasp/atm/test/reorder_flag.cpp b/test/c++/converters/vasp/reorder_flag.cpp
similarity index 100%
rename from c++/plovasp/atm/test/reorder_flag.cpp
rename to test/c++/converters/vasp/reorder_flag.cpp
diff --git a/c++/plovasp/atm/test/reorder_inds.cpp b/test/c++/converters/vasp/reorder_inds.cpp
similarity index 100%
rename from c++/plovasp/atm/test/reorder_inds.cpp
rename to test/c++/converters/vasp/reorder_inds.cpp
diff --git a/c++/plovasp/atm/test/testing.hpp b/test/c++/converters/vasp/testing.hpp
similarity index 100%
rename from c++/plovasp/atm/test/testing.hpp
rename to test/c++/converters/vasp/testing.hpp
diff --git a/c++/plovasp/atm/test/tet_weights.cpp b/test/c++/converters/vasp/tet_weights.cpp
similarity index 100%
rename from c++/plovasp/atm/test/tet_weights.cpp
rename to test/c++/converters/vasp/tet_weights.cpp
diff --git a/c++/plovasp/atm/test/weights1.cpp b/test/c++/converters/vasp/weights1.cpp
similarity index 100%
rename from c++/plovasp/atm/test/weights1.cpp
rename to test/c++/converters/vasp/weights1.cpp
diff --git a/test/plovasp/.gitignore b/test/plovasp/.gitignore
deleted file mode 100644
index 0d20b648..00000000
--- a/test/plovasp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.pyc
diff --git a/test/plovasp/converter/lunio3.out.h5_old b/test/plovasp/converter/lunio3.out.h5_old
deleted file mode 100644
index fb77f35c03344aa9bc09eb2bac381cf006506b13..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 372392
zcmeEP2|QI>7r#hplJt~DG-}qYsI5Vyfhf`B5=EIZ6s0niDIzjehRh`MnA&DC&vWKN
zqXwn)w7p>+HSP*~5RYwf5TU>~pdb-?DY=s41feJwG-!!Y~3y
z?q
z8nNaH{CGyy6zl@k%Y6?^C*$RfE!agko@S7tjexl5MyZ|=$l=2f!D%)wXLypJd{j?C
zO;cN656|dHYpCfSL76>iT|*6xBU(B-D6fYV$uE*8R9|26E6##(sN!;o$?u3hyPpH^xYP}-BMf=R0i`p7|uB>#bl*bRtJ)e^h1w8kj1!^zjNG~#Q=(`+6n2XA!J`LRdMPu<{#@H!CT(r<|FYx%U<}d_`noBH~knW(Wg{^N0E+Gp8RS5G?5m
z!M@~>XpPA;l0&T1oq!YXJ;JN6!F=sq_{WK$a!jg8xZxSp6!9TC0>41_p?pM#;}@tO
z)b*i!jI9%(`~DiG=BG{%R0}mfb^8B(f8XsPoDikP5xev6_P_7;eqO?;|L3@%Trxh$
zy3h-qW>z{a>*Q@fFBHiyLJm1E7(fi7>rS5p9Jv>
z#3$~Hm22O|C@AAiW}3V&F<{_9frs&b9FKpxf3^IJxLDGa
z9U0hu{8K#aha?^-K850s{P=9~qXiUCFT<$-PFLV`IZnT?!+3fi(pMZIxe8mCQ5>N+
zUaPCBqOPvnTjjv>_jlJr*S|P#zsq{)HKg&t{7z
zGgaJ!$HfZ=bg1~913jm#;>89;IlA9XYJT7GQm>0R<ZrqpBIptLyZ_^8u>H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