If attributes are documented in the __init__
method (see class below), their types are missing after rendering (see the screenshot).
class MolecularFamily:
def __init__(self, family_id: str):
"""Class to model molecular family.
Args:
family_id: Unique id for the molecular family.
Attributes:
family_id: Unique id for the molecular family.
spectra_ids: Set of spectrum ids in the molecular family.
"""
self.family_id: str = family_id
self.spectra_ids: set[str] = set()
self._spectra: set[Spectrum] = set()
self._strains: StrainCollection = StrainCollection()
WRITE MRE / INSTRUCTIONS HERE
PASTE TRACEBACK HERE
Not matter where attributes are documented (module level, class level or __init__
method), their types should be extracted and rendered properly.
python -m mkdocstrings_handlers.python.debug # | xclip -selection clipboard
mkdocs
v1.5.3mkdocstrings
v0.24.1mkdocstrings-python
v1.9.0griffe
v0.42.0mkdocs.yml
plugins
- mkdocstrings:
handlers:
python:
options:
members_order: source
filters: ["!^_"]
merge_init_into_class: true
show_if_no_docstring: true
show_root_heading: true
show_root_full_path: false
show_signature_annotations: true
signature_crossrefs: true
separate_signature: true
show_symbol_type_heading: true
show_symbol_type_toc: true
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too