nimi-python
nimi-python copied to clipboard
Documentation for public custom types is sourced in metadata of properties/methods that use them
Description of issue
There are custom types that are accepted/returned by public methods:
-
WaveformInfo
byfetch
,fetch_into
, andread
methods inniscope
-
MeasurementStats
byfetch_measurement_stats
method inniscope
-
HistoryRAMCycleInformation
byfetch_history_ram_cycle_information
method innidigital
-
LCRLoadCompensationSpot
andLCRMeasurement
(Soon-to-be-added methods innidcpower
will use these)
In the current code generator design, when generating the documentation for the properties/methods that use them, the docstring defined for the custom types are not used, but rather the docstring embedded in the metadata of the properties/methods are used.
e.g.: Documentation for fetch
: https://nimi-python.readthedocs.io/en/master/niscope/class.html#fetch (See the return value)
The source for documentation:
https://github.com/ni/nimi-python/blob/3dda150f74e9410693b198409c3b1e6f3cb32c22/src/niscope/metadata/functions.py#L1303
Drawbacks of current design:
- Creation and maintenance of the custom type documentation is cumbersome
- If the same type is used by multiple API, then we need to duplicate the documentation strings
FYI @olsl21, your PRs - #1771 and #1772 will be impacted by this.