google / google/gin-config

automatically generate a documentation of all configurables?

Open
#167 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.2k
Forks
122
Avg merge
5d 10h
Merged PRs (30d)
2

Description

Hi guys,

First of all, I really like your work! 👏. I have a question regarding documentation and transparency. If I have multiple places in my code that use `@gin.configurable`, can I somehow aggregate all those places and maybe even generate (Sphinx) documentation out of it?

Example:
```python
@gin.configurable
def fun_a(param_a: str, param_b: bool = False, param_c: Sequence[int] = (1, 2, 3)):
"""some docstring that even describes the parameters"""
pass

@gin.configurable
def fun_b(param_a: float = 1.0):
pass
```

Can I get output like
```
Configurables:

fun_a
param_a: string
I am parameter A.
param_b: bool, default `False`
I am parameter B.
param_c: Sequence of integers, default `(1, 2, 3)`
I am parameter A.

fun_b
param_a: float, default 1.0
I am parameter A.
```
maybe even in machine readable format that anything could read and further process.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.