qdrant / quaterion

Blazing fast framework for fine-tuning similarity learning models
https://quaterion.qdrant.tech/
Apache License 2.0
643 stars 45 forks source link

Update documentation content and formatting before release #46

Closed joein closed 2 years ago

joein commented 2 years ago

@generall @monatis let's collect all things which should be done in documentation before release.

I think it would be better if this issue contains a bunch of comments with task lists like this:

Epic:

Routine:

Optional:

joein commented 2 years ago

Try to find a way to get rid of inherited documented class members like training: bool in contrastive_loss (This seems to me like a bug in sphinx)

Sphinx shows class attributes of base classes if they are public (those which have no _ in the beginning).

I found two possible ways to get rid of it, however I don't like either of them.

The first one is to use autodoc-skip-member and exclude undesirable members by their names. I haven't found a way to get fully qualified name like torch.nn.Module.trainable and it seems like we can only filter by the name itself, which is obviously undesirable.

def skip_member(app, what, name, obj, skip, options):
    if name in (
        "batch_size",
        "dataset",
        "drop_last",
        "num_workers",
        "original_params",
        "pin_memory",
        "prefetch_factor",
        "sampler",
        "timeout",
        "trainable",
    ):
        return True

def setup(app):
    app.connect("autodoc-skip-member", skip_member)

The other way is to exclude undoc-members from sphinx-apidoc, which will require us to have docstring for each member we want to see in the documentation. This option seems more acceptable but requires further investigation.

joein commented 2 years ago

Provide links to custom types definitions in signatures

We are able to show type aliases as they are via https://github.com/qdrant/quaterion/blob/032343e6e07e8e226b303d334d52acdab37106d9/docs/source/conf.py#L58-L63

(doc)

And I guess this is the reason sphinx does not provide links to such types. I tried to replace a value KeyExtractorType with quaterion.train.cache.cache_config.KeyExtractorType, it didn't change anything