From a1c1518600cbb2517fd817db8b8bb133abe3f398 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen <pauli.t.virtanen@jyu.fi> Date: Tue, 23 Apr 2024 15:55:02 +0300 Subject: [PATCH] doc: more docs --- doc/api.rst | 26 ++++++++++++++++++++++++++ doc/conf.py | 4 ++-- doc/index.rst | 3 ++- doc/meson.build | 5 +++-- usadelndsoc/meson.build | 22 ++++++++++++---------- usadelndsoc/solver.py | 23 ++++++++++++++++++++++- 6 files changed, 67 insertions(+), 16 deletions(-) create mode 100644 doc/api.rst diff --git a/doc/api.rst b/doc/api.rst new file mode 100644 index 0000000..19f4e14 --- /dev/null +++ b/doc/api.rst @@ -0,0 +1,26 @@ +=== +API +=== + +.. tableofcontents:: + +.. automodule:: usadelndsoc.solver + :members: + :undoc-members: + +.. automodule:: usadelndsoc.util + :members: call_with_params, vectorize_parallel + :undoc-members: + +.. py:data:: usadelndsoc.matsubara + :members: + :undoc-members: + +.. automodule:: usadelndsoc + :members: + :undoc-members: + +.. py:data:: usadelndsoc.logger + + `logging.Logger` instance used. + diff --git a/doc/conf.py b/doc/conf.py index e918f68..78e66b2 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -3,9 +3,9 @@ copyright = '2024, Pauli Virtanen' author = 'Pauli Virtanen' release = '0.1' -extensions = [] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon'] #templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] -html_theme = 'alabaster' +html_theme = 'nature' #html_static_path = ['_static'] diff --git a/doc/index.rst b/doc/index.rst index 0525815..2bb151c 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -7,10 +7,11 @@ usadelndsoc =========== .. toctree:: - :maxdepth: 2 + :maxdepth: 1 :caption: Contents: discretization + api Indices and tables ================== diff --git a/doc/meson.build b/doc/meson.build index ef19960..6b420f2 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -1,6 +1,6 @@ python_doc = py_mod.find_installation( 'python3', - modules: ['sphinx'], + modules: ['sphinx', 'numpydoc'], required: false ) @@ -11,6 +11,7 @@ endif doc_files = files( 'index.rst', 'discretization.rst', + 'api.rst', 'conf.py', ) @@ -23,7 +24,7 @@ custom_target('doc', '@CURRENT_SOURCE_DIR@', # source dir '@OUTPUT@', # output dir ], - depend_files: doc_files, + depend_files: [doc_files, usadelndsoc_sources], depends: [usadelndsoc_pymod], output: 'html', build_by_default: true, diff --git a/usadelndsoc/meson.build b/usadelndsoc/meson.build index 21fc6d7..05c6646 100644 --- a/usadelndsoc/meson.build +++ b/usadelndsoc/meson.build @@ -1,3 +1,14 @@ +usadelndsoc_sources = files( + '__init__.py', + '_plotting_data.py', + 'bcs.py', + 'core.py', + 'matsubara.py', + 'plotting.py', + 'solver.py', + 'util.py', +) + usadelndsoc_pymod = py3.extension_module( '_core', ['../src/core.cpp'], @@ -7,16 +18,7 @@ usadelndsoc_pymod = py3.extension_module( ) py3.install_sources( - [ - '__init__.py', - '_plotting_data.py', - 'bcs.py', - 'core.py', - 'matsubara.py', - 'plotting.py', - 'solver.py', - 'util.py', - ], + usadelndsoc_sources, pure : false, subdir : 'usadelndsoc', ) diff --git a/usadelndsoc/solver.py b/usadelndsoc/solver.py index ff4bec7..2da894a 100644 --- a/usadelndsoc/solver.py +++ b/usadelndsoc/solver.py @@ -494,11 +494,21 @@ class Solver: copy=False, ).tocsc() - @functools.wraps(_solve) def solve(self, omega, **kw): """ Solve for a given value of omega. + Parameters + ---------- + omega : complex + Matsubara frequency to solve at + tol : float + maxiter : int + preconditioner : {None, "none", "umfpack", "pyamg"} + solver : {None, "cg", "tfqmr", "lgmres", "gcrotmk", "gmres"} + restart : int + finite_difference : bool + Returns ------- result : Result @@ -560,6 +570,17 @@ class Solver: """ Solve for many values of omega. + Parameters + ---------- + omega : array of complex + Matsubara frequencies to solve at + tol : float + maxiter : int + preconditioner : {None, "none", "umfpack", "pyamg"} + solver : {None, "cg", "tfqmr", "lgmres", "gcrotmk", "gmres"} + restart : int + finite_difference : bool + Returns ------- result : Result -- GitLab