-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More docstring updates, fix broken rst links
Add docutils func that adds a reference to the relative __init__.py of all files __doc__ in each submodule change sphinx configuration to be nitpicky which revealed a bunch of broken sphinx links which were then fixed (except ax and botorch links which can't be fixed right now because they don't build sphinx in a normal way. see facebook/Ax#1227 and see pytorch/botorch#1464 for more info on when ax and botroch can be linked). Add more docstrings
- Loading branch information
1 parent
11ee4f3
commit 8cdcef8
Showing
18 changed files
with
231 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
import inspect | ||
from pathlib import Path | ||
import importlib | ||
import pkgutil | ||
|
||
FILENAME = Path(__file__).name | ||
import boa | ||
|
||
|
||
def get_calling_file_path(): | ||
frames = inspect.stack() | ||
frame = 1 | ||
while (file_path := Path(frames[frame].filename)).name == FILENAME: | ||
frame += 1 | ||
return file_path | ||
def get_boa_submodules(): | ||
print(boa) | ||
module_list = [] | ||
packages = [] | ||
for module_finder, modname, is_pkg in pkgutil.walk_packages(boa.__path__): | ||
if is_pkg: | ||
packages.append(modname) | ||
if len(modname.split(".")) > 1: | ||
module_list.append(modname) | ||
return module_list | ||
|
||
|
||
def add_ref_to_rel_init(): | ||
file_path = get_calling_file_path() | ||
def import_boa_submod(submod_str): | ||
return importlib.import_module(f"boa.{submod_str}") | ||
|
||
parent = file_path.parent | ||
pathing_ls = [] | ||
for part in reversed(parent.parts): | ||
pathing_ls.append(part) | ||
if part == "boa": | ||
break | ||
pathing = ".".join(module for module in reversed(pathing_ls)) | ||
|
||
return f"""**See More Information Here**: :mod:`{pathing}`""" | ||
def add_ref_to_all_submodules_inits(): | ||
module_list = get_boa_submodules() | ||
for mod_str in module_list: | ||
submod = import_boa_submod(mod_str) | ||
info = f"""**Overview Information Here**: :mod:`{submod.__package__}`""" | ||
|
||
submod.__doc__ = f"{submod.__doc__}\n\n{info}" if submod.__doc__ else info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.