TRIQS / tprf

TPRF: The Two-Particle Response Function tool box for TRIQS
https://triqs.github.io/tprf
Other
14 stars 12 forks source link

Autodoc on c++ wrapped python module does not work without having the module installed on the system #1

Closed HugoStrand closed 5 years ago

HugoStrand commented 5 years ago

Dear Nils,

I am having an issue building the TPRF doc. The problem is that sphinx does not find the python modules that are wrapped c++ code when running the global make of the project.

WARNING: the plot_directive extension does not declare if it is safe for parallel reading, assuming it isn't - please ask the extension author to check and make it explicit
WARNING: doing serial read
WARNING: autodoc: failed to import function u'lattice_dyson_g0_wk' from module u'triqs_tprf.lattice'; the following exception was raised:
No module named lattice
WARNING: autodoc: failed to import function u'lattice_dyson_g_wk' from module u'triqs_tprf.lattice'; the following exception was raised:
No module named lattice
WARNING: autodoc: failed to import function u'lattice_dyson_g_w' from module u'triqs_tprf.lattice'; the following exception was raised:
No module named lattice
WARNING: autodoc: failed to import function u'lindhard_chi00_wk' from module u'triqs_tprf.lattice'; the following exception was raised:
No module named lattice
WARNING: autodoc: failed to import function u'solve_rpa_PH' from module u'triqs_tprf.lattice'; the following exception was raised:
No module named lattice
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PH:14: WARNING: Block quote ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PH:16: WARNING: Definition list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PP:5: WARNING: Unexpected indentation.
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PP:15: WARNING: Block quote ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PP:17: WARNING: Definition list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PH:5: WARNING: Unexpected indentation.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PH:16: WARNING: Block quote ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PH:18: WARNING: Definition list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PP:5: WARNING: Unexpected indentation.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PP:16: WARNING: Block quote ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PP:18: WARNING: Definition list ends without a blank line; unexpected unindent.
WARNING: autodoc: failed to import function u'solve_local_bse' from module u'triqs_tprf.bse'; the following exception was raised:
No module named lattice
WARNING: autodoc: failed to import function u'solve_lattice_bse' from module u'triqs_tprf.bse'; the following exception was raised:
No module named lattice
WARNING: autodoc: failed to import function u'get_chi0_wnk' from module u'triqs_tprf.bse'; the following exception was raised:
No module named lattice
WARNING: autodoc: failed to import function u'screened_interaction_W' from module u'triqs_tprf.lattice'; the following exception was raised:
No module named lattice
WARNING: autodoc: failed to import function u'gw_self_energy' from module u'triqs_tprf.lattice'; the following exception was raised:
No module named lattice
WARNING: autodoc: failed to import function u'solve_eliashberg_fft' from module u'triqs_tprf.eliashberg'; the following exception was raised:
No module named lattice

My current workaround is to build the whole project and install it, and then remove the doc folder in the cbuild directory and run make again. Then I get no warnings about missing modules:

WARNING: the plot_directive extension does not declare if it is safe for parallel reading, assuming it isn't - please ask the extension author to check and make it explicit
WARNING: doing serial read
docstring of triqs_tprf.lattice.lattice_dyson_g0_wk:19: WARNING: Field list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.lattice.lattice_dyson_g_wk:19: WARNING: Field list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.lattice.lattice_dyson_g_wk:38: WARNING: Field list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.lattice.lattice_dyson_g_wk:56: WARNING: Field list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.lattice.lattice_dyson_g_w:20: WARNING: Field list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.lattice.solve_rpa_PH:16: WARNING: Field list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PH:14: WARNING: Block quote ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PH:16: WARNING: Definition list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PP:5: WARNING: Unexpected indentation.
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PP:15: WARNING: Block quote ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi0_from_gg2_PP:17: WARNING: Definition list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PH:5: WARNING: Unexpected indentation.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PH:16: WARNING: Block quote ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PH:18: WARNING: Definition list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PP:5: WARNING: Unexpected indentation.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PP:16: WARNING: Block quote ends without a blank line; unexpected unindent.
docstring of triqs_tprf.chi_from_gg2.chi_from_gg2_PP:18: WARNING: Definition list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.lattice.screened_interaction_W:5: WARNING: Unexpected indentation.
docstring of triqs_tprf.lattice.screened_interaction_W:16: WARNING: Field list ends without a blank line; unexpected unindent.
docstring of triqs_tprf.lattice.gw_self_energy:31: WARNING: Field list ends without a blank line; unexpected unindent.

All the other warnings are from malformed c++ documentation strings that are pulled into the python doc strings of the python module.

Is it possible to put the just built python modules in the path for sphinx so that the doc can be built before installing?

Best regards, Hugo

Wentzell commented 5 years ago

Hey Hugo,

The solution was to make the sphinx target depend on the generation of the modules at the CMake level.

This should be fixed with 0dd83d0