Python docstring for message documentation
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- documentation, tooling
调研方向
将 statistics_msgs/msg/MetricsMessage.msg 中的源代码注释与 issue 中所示的生成的 statistics_msgs.msg._metrics_message 类进行比较。首先定位生成该类的 rosidl Python 生成路径,然后识别现有的生成测试。当源文件中的消息和字段文档出现在相应的 Python docstrings 中,并且有测试覆盖时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Enhancement Request
Required Info:
- Operating System:
- Ubuntu 20.04
- Installation type:
- Source
- Version or commit hash:
- git branch: Humble
- DDS implementation:
- N/A
- Client library (if applicable):
- rclpy
Steps to reproduce issue
When looking at a message class documentation in Python, the message comments don't really show making it more complicated to understand the message.
For example take the statistics_msgs/MetricsMessage, the source file has lots of good documentation for the message itself as well as for each of the fields contained in the message.
When looking at the python documentation for the message, we see:
Help on class MetricsMessage in module statistics_msgs.msg._metrics_message:
class MetricsMessage(builtins.object)
| MetricsMessage(**kwargs)
|
| Message class 'MetricsMessage'.
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| get_fields_and_field_types() from statistics_msgs.msg._metrics_message.Metaclass_MetricsMessage
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| measurement_source_name
| Message field 'measurement_source_name'.
|
| metrics_source
| Message field 'metrics_source'.
|
| statistics
| Message field 'statistics'.
|
| unit
| Message field 'unit'.
|
| window_start
| Message field 'window_start'.
|
| window_stop
| Message field 'window_stop'.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| SLOT_TYPES = (<rosidl_parser.definition.UnboundedString object>, <rosi...
|
| __hash__ = None
All of this without any of the message creator help data.
Expected behavior
Instead, we could build in the documentation comments from the original message documentation into the python class docstring making it better for developers to access the documentation.
A potential outcome for this message type:
Help on class MetricsMessage in module statistics_msgs.msg._metrics_message:
class MetricsMessage(builtins.object)
| MetricsMessage(**kwargs)
|
| Message class 'MetricsMessage'.
|
| A generic metrics message providing statistics for measurements from different sources. For example,
|
| measure a system's CPU % for a given window yields the following data points over a window of time:
| - average cpu %
| - std deviation
| - min
| - max
| - sample count
|
| These are all represented as different 'StatisticDataPoint's.
|
| Fields:
| measurement_source_name (string): Name metric measurement source, e.g., node, topic, or process name
| metrics_source (string): Name of the metric being measured, e.g. cpu_percentage, free_memory_mb, message_age, etc.
| unit (string): Unit of measure of the metric, e.g. percent, mb, seconds, etc.
| window_start (builtin_interfaces/Time): Measurement window start time
| window_stop (builtin_interfaces/Time): Measurement window end time
| statistics (sequence<statistics_msgs/StatisticDataPoint>): A list of statistics data point, defined in StatisticDataPoint.msg
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __init__(self, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| get_fields_and_field_types() from statistics_msgs.msg._metrics_message.Metaclass_MetricsMessage
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
<..snip..>
Feature request
Feature description
Transfer message file documentation into python docstrings for the corresponding message.
- 主要语言
- EmberScript
- 星标
- 26
- 派生
- 68
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ros2/rosidl_python 的其他 Issue
-
Eliminate array resetting loop in _msg_support.c.em可能已有人在做 @Lidang-Jiang 于 164 天前认领。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 72/100
ros2/rosidl_python#255 · 1 个 reaction ·
-
bug
难度 3/5 1-2 天 新手友好度 56/100
ros2/rosidl_python#264 · 2 条评论 ·
-
Message named pkg/Duration with field builtin_interfaces/Duration is invalid可能已有人在做 @Lidang-Jiang 于 163 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 55/100
ros2/rosidl_python#257 · 8 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
ros2/rosidl_python#242 ·
-
难度 3/5 1-2 天 新手友好度 32/100
ros2/rosidl_python#219 · 2 条评论 ·
查看 ros2/rosidl_python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
[Docs] README: FAQ setup command, IDA in the intro, Node badge可能已有人在做 @akram1089 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
documentation need help question
难度 1/5 1-3 小时 新手友好度 66/100
phonology024/babelscribe#26 ·
-
难度 1/5 1-3 小时 新手友好度 72/100