An extra indent appears in the docs when the experimental decorator is added to a method of a class. This does not happen with a top level (i.e., not nested) class or function.
experimental decorator to a method of a classThe following figure shows the docs of Study.enqueue_trial. An extra indent appears after the second paragraph.

no extra indent is shown after the second paragraph
For example, the docs of Study.get_trials, which does not have the experimental decorator, appears as expected.

The following figure shows another example. The docs of the train function of LightGBMTuner has no extra indent. Although the function has an experimental decorator, it belongs to the top level classes.

It seems we need to indent the .. note:: block when decorating a class method.
>>> print(Study.enqueue_trial.__doc__)
Enqueue a trial with given parameter values.
You can fix the next sampling parameters which will be evaluated in your
objective function.
Example:
.. testcode::
import optuna
def objective(trial):
x = trial.suggest_uniform('x', 0, 10)
return x ** 2
study = optuna.create_study()
study.enqueue_trial({'x': 5})
study.enqueue_trial({'x': 0})
study.optimize(objective, n_trials=2)
assert study.trials[0].params == {'x': 5}
assert study.trials[1].params == {'x': 0}
Args:
params:
Parameter values to pass your objective function.
.. note::
Added in v1.2.0 as an experimental feature. The interface may change in newer versions
without prior notice. See https://github.com/optuna/optuna/releases/tag/v1.2.0.
>>> print(lightgbm_tuner.train.__doc__)
Wrapper of LightGBM Training API to tune hyperparameters.
It tunes important hyperparameters (e.g., `min_child_samples` and `feature_fraction`) in a
stepwise manner. Arguments and keyword arguments for `lightgbm.train()
<https://lightgbm.readthedocs.io/en/latest/pythonapi/lightgbm.train.html>`_ can be passed.
.. note::
Added in v0.18.0 as an experimental feature. The interface may change in newer versions
without prior notice. See https://github.com/optuna/optuna/releases/tag/v0.18.0.
@g-votte
Can I work on this?
@harupy
Sure! Please go for it!
Most helpful comment
@g-votte
Can I work on this?