Skip to content

Make autodoc_typehints mode work with nitpicky mode #1787

Open
@ydcjeff

Description

@ydcjeff

📚 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions