|
28 | 28 | import pytorch_sphinx_theme
|
29 | 29 | import torchrl
|
30 | 30 |
|
31 |
| -# Suppress warnings - TODO |
32 |
| -# suppress_warnings = [ 'misc.highlighting_failure' ] |
| 31 | +# Suppress warnings |
33 | 32 | warnings.filterwarnings("ignore", category=UserWarning)
|
34 | 33 |
|
35 | 34 | project = "torchrl"
|
|
86 | 85 | "torchvision": ("https://pytorch.org/vision/stable/", None),
|
87 | 86 | }
|
88 | 87 |
|
| 88 | + |
| 89 | +def kill_procs(gallery_conf, fname): |
| 90 | + import os |
| 91 | + |
| 92 | + import psutil |
| 93 | + |
| 94 | + # Get the current process |
| 95 | + current_proc = psutil.Process(os.getpid()) |
| 96 | + # Iterate over all child processes |
| 97 | + for child in current_proc.children(recursive=True): |
| 98 | + # Kill the child process |
| 99 | + child.terminate() |
| 100 | + print(f"Killed child process with PID {child.pid}") # noqa: T201 |
| 101 | + |
| 102 | + |
89 | 103 | sphinx_gallery_conf = {
|
90 | 104 | "examples_dirs": "reference/generated/tutorials/", # path to your example scripts
|
91 | 105 | "gallery_dirs": "tutorials", # path to where to save gallery generated output
|
|
95 | 109 | "notebook_images": "reference/generated/tutorials/media/", # images to parse
|
96 | 110 | "download_all_examples": True,
|
97 | 111 | "abort_on_example_error": True,
|
98 |
| - "show_memory": True, |
| 112 | + # "show_memory": True, |
| 113 | + "plot_gallery": "False", |
99 | 114 | "capture_repr": ("_repr_html_", "__repr__"), # capture representations
|
100 | 115 | "write_computation_times": True,
|
| 116 | + # "compress_images": ("images", "thumbnails"), |
| 117 | + "reset_modules": (kill_procs, "matplotlib", "seaborn"), |
101 | 118 | }
|
102 | 119 |
|
103 | 120 | napoleon_use_ivar = True
|
|
0 commit comments