Python docstring for message documentation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- documentation, tooling
Direzione di ricerca
Confronta i commenti del sorgente in statistics_msgs/msg/MetricsMessage.msg con la classe generata statistics_msgs.msg._metrics_message mostrata nella issue. Inizia individuando il percorso di generazione Python di rosidl che produce questa classe, quindi identifica i test di generazione esistenti. Il lavoro è completato quando la documentazione del messaggio e dei suoi campi proveniente dal sorgente appare nelle docstrings Python corrispondenti ed è coperta dai test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- EmberScript
- Stelle
- 26
- Fork
- 68
- Merge medio
- 2g 13h
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ros2/rosidl_python
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ros2/rosidl_python#255 · 1 reazione ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
ros2/rosidl_python#264 · 2 commenti ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
ros2/rosidl_python#257 · 8 commenti ·
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
ros2/rosidl_python#242 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 32/100
ros2/rosidl_python#219 · 2 commenti ·
Tutte le issue di ros2/rosidl_python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bancolombia/sentinel#22 ·
-
test md ApertaCI
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
optimization optimization:agents-md-curator
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
objectionary/hone-maven-plugin#1061 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
redhat-developer/rhdh-plugins#4887 · 2 commenti ·