-
Notifications
You must be signed in to change notification settings - Fork 2
Abstractmethod docstrings are not inherited in API reference #255
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Description
As is being tracked here, we do not get docstrings in our reference API for abstract methods that are set by child classes, i.e.,
class DiscretionaryTrip(ABC):
...
@abstractmethod
def choose_destination(self) -> str:
"""Selects a destination for the discretionary activity.
Returns:
str: Selected destination zone name.
"""
class DiscretionaryTripOD(DiscretionaryTrip):
...
def choose_destination(self) -> str:
zone = sample_weighted(self.destination_p)
area = self._od.labels.destination_zones[zone]
return areaPython passes the abstract method docstring down to the child class (help(my_discretionary_trip_od_model.choose_destination) will return the expected docstring), but this isn't the case in the docs:
Related links
Version
0.2
Proposed change
Repeat docstring in child class methods until mkdocstrings/griffe#96 is fixed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
