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

Repeated Capabilites documentation improvements

Open ni-jfitzger opened this issue 3 years ago • 4 comments

  • [X] This contribution adheres to CONTRIBUTING.md.
  • [ ] ~I've updated CHANGELOG.md if applicable.~
  • [X] I've added tests applicable for this pull request

What does this Pull Request accomplish?

There are several issues open against the way we document usage of repeated capabilities in our rep_caps.rst pages.

Summary of Issues

  • We present implementation details that the user doesn't care about
    • These may be useful to contributors, but to everyone else they're just distracting.
  • We list all of the possible types that can be passed to the indexing operator but don't make it clear what the recommended or "pythonic" types are.
    • This information is worth keeping, but we need to provide better guidance.
  • We use channel_enabled in all of our examples, though it may not actually support the repeated capability in the example code and not all apis have a channel_enabled property.

This PR addresses these by doing the following:

  • Explicitly recommend what types to pass to the indexing operator.
  • Present examples which demonstrate accessing the repeated capability with some of our recommended types.
    • Do not present examples using other types.
  • Specify fields in metadata used to build real examples specific to each rep cap
    • New helper functions were added to return the snippet and explanation for each example

List issues fixed by this Pull Request below, if any.

  • Fix #1388
  • Fix #1334
  • Fix #1126

What testing has been done?

Local code generation with documentation inspection.

ni-jfitzger avatar Jan 21 '22 23:01 ni-jfitzger

Can one of the admins verify this patch?

nimi-bot avatar Jan 21 '22 23:01 nimi-bot

I haven't committed the results of tox -e codegen. I can do that when there's agreement on the contents of rep_caps.rst.mako.

ni-jfitzger avatar Jan 21 '22 23:01 ni-jfitzger

I haven't committed the results of tox -e codegen. I can do that when there's agreement on the contents of rep_caps.rst.mako.

No, please commit them before the PR is ready for review so we can see the effects and merge without having to track anything.

marcoskirsch avatar Jan 24 '22 19:01 marcoskirsch

committed the results of tox-e codegen as requested.

ni-jfitzger avatar Jan 24 '22 19:01 ni-jfitzger