|
67 | 67 |
|
68 | 68 | autosummary_generate = True |
69 | 69 |
|
| 70 | +autodoc_mock_imports = ["ansys.dpf.core.examples.python_plugins"] |
70 | 71 |
|
71 | 72 | # Add any paths that contain templates here, relative to this directory. |
72 | 73 | # templates_path = ['_templates'] |
|
85 | 86 | # |
86 | 87 | # This is also used if you do content translation via gettext catalogs. |
87 | 88 | # Usually you set "language" from the command line for these cases. |
88 | | -language = None |
| 89 | +language = "en" |
89 | 90 |
|
90 | 91 | # List of patterns, relative to source directory, that match files and |
91 | 92 | # directories to ignore when looking for source files. |
|
99 | 100 | # -- Sphinx Gallery Options |
100 | 101 | from sphinx_gallery.sorting import FileNameSortKey |
101 | 102 |
|
| 103 | + |
| 104 | +def reset_servers(gallery_conf, fname, when): |
| 105 | + import psutil |
| 106 | + from ansys.dpf.core import server |
| 107 | + import gc |
| 108 | + |
| 109 | + gc.collect() |
| 110 | + server.shutdown_all_session_servers() |
| 111 | + |
| 112 | + proc_name = "Ans.Dpf.Grpc" |
| 113 | + nb_procs = 0 |
| 114 | + for proc in psutil.process_iter(): |
| 115 | + try: |
| 116 | + # check whether the process name matches |
| 117 | + if proc_name in proc.name(): |
| 118 | + # proc.kill() |
| 119 | + nb_procs += 1 |
| 120 | + except psutil.NoSuchProcess: |
| 121 | + pass |
| 122 | + print(f"Counted {nb_procs} {proc_name} processes {when} the example.") |
| 123 | + |
| 124 | + |
102 | 125 | sphinx_gallery_conf = { |
103 | 126 | # convert rst to md for ipynb |
104 | 127 | "pypandoc": True, |
|
118 | 141 | # 'first_notebook_cell': ("%matplotlib inline\n" |
119 | 142 | # "from pyvista import set_plot_theme\n" |
120 | 143 | # "set_plot_theme('document')"), |
| 144 | + "reset_modules_order": 'both', |
| 145 | + "reset_modules": (reset_servers,), |
121 | 146 | } |
122 | 147 |
|
123 | 148 | autodoc_member_order = "bysource" |
124 | 149 |
|
125 | 150 |
|
126 | 151 | # -- Options for HTML output ------------------------------------------------- |
| 152 | +html_short_title = html_title = "PyDPF-Core" |
127 | 153 | html_theme = "ansys_sphinx_theme" |
128 | 154 | html_logo = pyansys_logo_black |
129 | 155 | html_theme_options = { |
130 | | - "github_url": "https://github.com/pyansys/DPF-Core", |
| 156 | + "github_url": "https://github.com/pyansys/pydpf-core", |
131 | 157 | "show_prev_next": False, |
132 | | - "logo_link": "https://dpfdocs.pyansys.com/" # navigate to the main page |
| 158 | + "show_breadcrumbs": True, |
| 159 | + "additional_breadcrumbs": [ |
| 160 | + ("PyAnsys", "https://docs.pyansys.com/"), |
| 161 | + ], |
133 | 162 | } |
134 | 163 |
|
135 | 164 |
|
|
0 commit comments