ignite icon indicating copy to clipboard operation
ignite copied to clipboard

Make `autodoc_typehints` mode work with nitpicky mode

Open ydcjeff opened this issue 4 years ago • 2 comments

📚 Documentation

Currently we have imported the class in the handlers and metrics docs with module.class_name and class_name. handlers docs [source] and metrics docs [source]

This seems inconsistent. The reason why we have to import like this is we are using nitpicky mode to make sure all references are updated. For example, here returns EarlyStopping instance which is referenced to the class EarlyStopping which we need to write ignite.handlers.early_stopping.EarlyStopping to make reference work.

The idea is to have those references work even if we write the docs with full sub-module path or module path. Current handlers docs:

.. autosummary::
    :nosignatures:
    :toctree: generated

    checkpoint.Checkpoint
    DiskSaver
    checkpoint.ModelCheckpoint
    early_stopping.EarlyStopping
    terminate_on_nan.TerminateOnNan
    TimeLimit
    timing.Timer
    global_step_from_engine

Handlers docs we want:

.. autosummary::
    :nosignatures:
    :toctree: generated

    Checkpoint
    DiskSaver
    ModelCheckpoint
    EarlyStopping
    TerminateOnNan
    TimeLimit
    Timer
    global_step_from_engine

This is also same for metrics docs

Related sphinx conf : autodoc_typehints and nitpicky

ydcjeff avatar Mar 14 '21 14:03 ydcjeff

Related to this merged PR : https://github.com/pytorch/ignite/pull/1780

vfdev-5 avatar Mar 14 '21 15:03 vfdev-5

I'll look into it.

ahmedo42 avatar Mar 15 '21 10:03 ahmedo42