-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Expand processor/provider docs #98
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #98 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 521 521
=========================================
Hits 521 521 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #98 will not alter performanceComparing Summary
|
docs/getting_started.md
Outdated
if hasattr(thing, name): | ||
return thing.name | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we're going to add this, then the return type annotation should be changed to str | None
. But I also feel like it's a bit contrived here... since Thing
always has an attribute name
... so it's not a great example of a processor that may or may not return a value (like, for example napari.get_current_viewer
). So, if you think an example of this is needed (in addition to the text above in the "multiple providers" note) then let's add a new section with a new provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah examples are hard. I don't think it's needed, the doc should be enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lucyleeow! Yep everything is pretty much correct! I made a couple slight wording changes and elaborations. One more comment left to discuss then lets merge.
Oh one more thing I wanted to mention is that if a default value is provided, no provider will attempt to inject. It seems obvious but e.g. if you have |
yep! Good thing to add |
(if you ever run into a case where you need/want to be able to override default values with injected values, that would be a reasonable feature request, probably added as a parameter to |
Thanks for making the changes! I didn't have time to add a note on default values so did it here: #99 |
Expand the processor/provider docs in 'getting started'. In particular how the store iterates over processors/providers.
Hopefully it is correct 😬