-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
Description of issue
There are custom types that are accepted/returned by public methods:
WaveformInfobyfetch,fetch_into, andreadmethods inniscopeMeasurementStatsbyfetch_measurement_statsmethod inniscopeHistoryRAMCycleInformationbyfetch_history_ram_cycle_informationmethod innidigitalLCRLoadCompensationSpotandLCRMeasurement(Soon-to-be-added methods innidcpowerwill 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:
nimi-python/src/niscope/metadata/functions.py
Line 1303 in 3dda150
| 'description': '\nReturns a list of class instances with the following timing and scaling information about each waveform:\n\n- **relative_initial_x** (float) the time (in seconds) from the trigger to the first sample in the fetched waveform\n- **absolute_initial_x** (float) timestamp (in seconds) of the first fetched sample. This timestamp is comparable between records and acquisitions; devices that do not support this parameter use 0 for this output.\n- **x_increment** (float) the time between points in the acquired waveform in seconds\n- **channel** (str) channel name this waveform was acquired from\n- **record** (int) record number of this waveform\n- **gain** (float) the gain factor of the given channel; useful for scaling binary data with the following formula:\n\n .. math::\n\n voltage = binary data * gain factor + offset\n\n- **offset** (float) the offset factor of the given channel; useful for scaling binary data with the following formula:\n\n .. math::\n\n voltage = binary data * gain factor + offset\n\n- **samples** (array of float) floating point array of samples. Length will be of the actual samples acquired\n' |
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