diff --git a/doc/api.rst b/doc/api.rst new file mode 100644 index 0000000000000000000000000000000000000000..19f4e14d8ee242a956fb3a69134c00fd7999c303 --- /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 e918f68fff53c12bfaedcd566e3b1e04a81f85c6..78e66b2e9eb744c992d1fbb18791f9a8d991806c 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 05258158e0095e09c65add082a00fc9bddcd96d9..2bb151cd7bd77363e725d64af61fab0cf78ae45a 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 ef1996020b0ef1b6722ca9b30a002289a53c7070..6b420f2c783b171ba319bd57d57125ec6d9ef6d0 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 21fc6d798e7b2811242c8fadabfb3718f92c3aee..05c664651fb2ec9524ca324ae3a7fc5e971c4aab 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 ff4bec7947b81a1721e5603cd8c9f3e177926d63..2da894a72d3464c5b5e2a3c7ed0388a082d332bd 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