nimi-python icon indicating copy to clipboard operation
nimi-python copied to clipboard

Documentation for public custom types is sourced in metadata of properties/methods that use them

Open sbethur opened this issue 2 years ago • 1 comments

Description of issue

There are custom types that are accepted/returned by public methods:

  • WaveformInfo by fetch, fetch_into, and read methods in niscope
  • MeasurementStats by fetch_measurement_stats method in niscope
  • HistoryRAMCycleInformation by fetch_history_ram_cycle_information method in nidigital
  • LCRLoadCompensationSpot and LCRMeasurement (Soon-to-be-added methods in nidcpower 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

sbethur avatar Jul 18 '22 18:07 sbethur

FYI @olsl21, your PRs - #1771 and #1772 will be impacted by this.

sbethur avatar Jul 19 '22 14:07 sbethur