Merge branch 'fix-docstrings-imperative' into 'master'

Use imperative mood in constructor docstrings

See merge request micro-ROS/ros_tracing/tracetools_analysis!35
This commit is contained in:
Christophe Bedard 2019-12-27 19:23:51 +00:00
commit d152e1c017
11 changed files with 15 additions and 13 deletions

View file

@ -27,7 +27,7 @@ class CpuTimeDataModel(DataModel):
""" """
def __init__(self) -> None: def __init__(self) -> None:
"""Constructor.""" """Create a CpuTimeDataModel."""
super().__init__() super().__init__()
self.times = pd.DataFrame(columns=[ self.times = pd.DataFrame(columns=[
'tid', 'tid',

View file

@ -28,7 +28,7 @@ class ProfileDataModel(DataModel):
""" """
def __init__(self) -> None: def __init__(self) -> None:
"""Constructor.""" """Create a ProfileDataModel."""
super().__init__() super().__init__()
self.times = pd.DataFrame(columns=[ self.times = pd.DataFrame(columns=[
'tid', 'tid',

View file

@ -27,7 +27,7 @@ class Ros2DataModel(DataModel):
""" """
def __init__(self) -> None: def __init__(self) -> None:
"""Constructor.""" """Create a Ros2DataModel."""
super().__init__() super().__init__()
# Objects (one-time events, usually when something is created) # Objects (one-time events, usually when something is created)
self.contexts = pd.DataFrame(columns=['context_handle', self.contexts = pd.DataFrame(columns=['context_handle',

View file

@ -40,7 +40,7 @@ class EventMetadata():
tid: int = None, tid: int = None,
) -> None: ) -> None:
""" """
Constructor. Create an EventMetadata.
Parameters with a default value of `None` are not mandatory, Parameters with a default value of `None` are not mandatory,
since they are not always present. since they are not always present.
@ -115,7 +115,7 @@ class EventHandler(Dependant):
**kwargs, **kwargs,
) -> None: ) -> None:
""" """
Constructor. Create an EventHandler.
TODO make subclasses pass on their *DataModel to this class TODO make subclasses pass on their *DataModel to this class
@ -173,7 +173,7 @@ class DependencySolver():
**kwargs, **kwargs,
) -> None: ) -> None:
""" """
Constructor. Create a DependencySolver.
:param initial_dependants: the initial dependant instances, in order :param initial_dependants: the initial dependant instances, in order
:param kwargs: the parameters to pass on to new instances :param kwargs: the parameters to pass on to new instances
@ -251,7 +251,7 @@ class Processor():
**kwargs, **kwargs,
) -> None: ) -> None:
""" """
Constructor. Create a Processor.
:param handlers: the `EventHandler`s to use for processing :param handlers: the `EventHandler`s to use for processing
:param kwargs: the parameters to pass on to new handlers :param kwargs: the parameters to pass on to new handlers
@ -368,7 +368,7 @@ class ProcessingProgressDisplay():
processing_elements: List[str], processing_elements: List[str],
) -> None: ) -> None:
""" """
Constructor. Create a ProcessingProgressDisplay.
:param processing_elements: the list of elements doing processing :param processing_elements: the list of elements doing processing
""" """

View file

@ -34,6 +34,7 @@ class CpuTimeHandler(EventHandler):
self, self,
**kwargs, **kwargs,
) -> None: ) -> None:
"""Create a CpuTimeHandler."""
# Link event to handling method # Link event to handling method
handler_map = { handler_map = {
'sched_switch': 'sched_switch':

View file

@ -47,7 +47,7 @@ class ProfileHandler(EventHandler):
**kwargs, **kwargs,
) -> None: ) -> None:
""" """
Constructor. Create a ProfileHandler.
:param address_to_func: the mapping from function address (`int` or hex `str`) to name :param address_to_func: the mapping from function address (`int` or hex `str`) to name
""" """

View file

@ -34,6 +34,7 @@ class Ros2Handler(EventHandler):
self, self,
**kwargs, **kwargs,
) -> None: ) -> None:
"""Create a Ros2Handler."""
# Link a ROS trace event to its corresponding handling method # Link a ROS trace event to its corresponding handling method
handler_map = { handler_map = {
'ros2:rcl_init': 'ros2:rcl_init':

View file

@ -35,7 +35,7 @@ class DataModelUtil():
data_model: DataModel, data_model: DataModel,
) -> None: ) -> None:
""" """
Constructor. Create a DataModelUtil.
:param data_model: the data model :param data_model: the data model
""" """

View file

@ -28,7 +28,7 @@ class CpuTimeDataModelUtil(DataModelUtil):
data_model: CpuTimeDataModel, data_model: CpuTimeDataModel,
) -> None: ) -> None:
""" """
Constructor. Create a CpuTimeDataModelUtil.
:param data_model: the data model object to use :param data_model: the data model object to use
""" """

View file

@ -34,7 +34,7 @@ class ProfileDataModelUtil(DataModelUtil):
data_model: ProfileDataModel, data_model: ProfileDataModel,
) -> None: ) -> None:
""" """
Constructor. Create a ProfileDataModelUtil.
:param data_model: the data model object to use :param data_model: the data model object to use
""" """

View file

@ -34,7 +34,7 @@ class Ros2DataModelUtil(DataModelUtil):
data_model: Ros2DataModel, data_model: Ros2DataModel,
) -> None: ) -> None:
""" """
Constructor. Create a Ros2DataModelUtil.
:param data_model: the data model object to use :param data_model: the data model object to use
""" """