docs for types added
This commit is contained in:
parent
9fc5ea2dc1
commit
38eda3edcf
|
@ -0,0 +1,5 @@
|
||||||
|
# gaspype.FloatArray
|
||||||
|
|
||||||
|
```{eval-rst}
|
||||||
|
.. autoclass:: gaspype.FloatArray
|
||||||
|
```
|
|
@ -6,8 +6,12 @@ import fnmatch
|
||||||
from io import TextIOWrapper
|
from io import TextIOWrapper
|
||||||
|
|
||||||
|
|
||||||
def write_classes(f: TextIOWrapper, patterns: list[str], module_name: str, title: str, description: str = '', exclude: list[str] = []) -> None:
|
def write_manual(f: TextIOWrapper, doc_files: list[str], title: str) -> None:
|
||||||
|
write_dochtree(f, title, doc_files)
|
||||||
|
|
||||||
|
|
||||||
|
def write_classes(f: TextIOWrapper, patterns: list[str], module_name: str, title: str, description: str = '', exclude: list[str] = []) -> None:
|
||||||
|
"""Write the classes to the file."""
|
||||||
module = importlib.import_module(module_name)
|
module = importlib.import_module(module_name)
|
||||||
|
|
||||||
classes = [
|
classes = [
|
||||||
|
@ -17,7 +21,6 @@ def write_classes(f: TextIOWrapper, patterns: list[str], module_name: str, title
|
||||||
obj.__doc__ and '(Automatic generated stub)' not in obj.__doc__)
|
obj.__doc__ and '(Automatic generated stub)' not in obj.__doc__)
|
||||||
]
|
]
|
||||||
|
|
||||||
"""Write the classes to the file."""
|
|
||||||
if description:
|
if description:
|
||||||
f.write(f'{description}\n\n')
|
f.write(f'{description}\n\n')
|
||||||
|
|
||||||
|
@ -36,7 +39,7 @@ def write_classes(f: TextIOWrapper, patterns: list[str], module_name: str, title
|
||||||
|
|
||||||
|
|
||||||
def write_functions(f: TextIOWrapper, patterns: list[str], module_name: str, title: str, description: str = '', exclude: list[str] = []) -> None:
|
def write_functions(f: TextIOWrapper, patterns: list[str], module_name: str, title: str, description: str = '', exclude: list[str] = []) -> None:
|
||||||
|
"""Write the classes to the file."""
|
||||||
module = importlib.import_module(module_name)
|
module = importlib.import_module(module_name)
|
||||||
|
|
||||||
functions = [
|
functions = [
|
||||||
|
@ -45,7 +48,6 @@ def write_functions(f: TextIOWrapper, patterns: list[str], module_name: str, tit
|
||||||
any(fnmatch.fnmatch(name, pat) for pat in patterns if pat not in exclude))
|
any(fnmatch.fnmatch(name, pat) for pat in patterns if pat not in exclude))
|
||||||
]
|
]
|
||||||
|
|
||||||
"""Write the classes to the file."""
|
|
||||||
if description:
|
if description:
|
||||||
f.write(f'{description}\n\n')
|
f.write(f'{description}\n\n')
|
||||||
|
|
||||||
|
@ -74,8 +76,9 @@ def write_dochtree(f: TextIOWrapper, title: str, items: list[str]):
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
with open('docs/source/_autogenerated/index.md', 'w') as f:
|
with open('docs/source/_autogenerated/index.md', 'w') as f:
|
||||||
f.write('# Classes and functions\n\n')
|
f.write('# Classes and functions\n\n')
|
||||||
#f.write('## Classes\n\n')
|
|
||||||
write_classes(f, ['*'], 'gaspype', title='Classes')
|
write_classes(f, ['*'], 'gaspype', title='Classes')
|
||||||
|
|
||||||
#f.write('## Functions\n\n')
|
|
||||||
write_functions(f, ['*'], 'gaspype', title='Functions')
|
write_functions(f, ['*'], 'gaspype', title='Functions')
|
||||||
|
|
||||||
|
write_manual(f, ['../ndfloat', '../floatarray'], title='Types')
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# gaspype.NDFloat
|
||||||
|
|
||||||
|
```{eval-rst}
|
||||||
|
.. autoclass:: gaspype.NDFloat
|
||||||
|
```
|
Loading…
Reference in New Issue