-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add docstring to add_recording #1010
Conversation
This does add |
Yeah, we've known that for a while You should have a chat with @pauladkisson sometime; we solved this problem on ROIExtractors by creating a custom pre-commit that ensures all publically exposed functions and classes have docstrings (which include from inheritance) |
I don't really like that solution : P I remember finding the pre-commit annoying in roi-extractors. Makes me less likely to want to contribute. It was something about enforcing spaces that did not make a lot of sense to me. I will have to thing again. |
I think you're talking about a separate pre-commit for pydocstyle which ensures strict numpy style compliance The check for ensuring public functions have a non-empty docstring is its own thing (so that Have you tried writing docstring using GitHub copilot? For me it formats everything perfectly, takes less than 15 seconds per method, and gets it almost perfect in the descriptions. So nowadays I don't think the cost is high at all to enforce |
Actually, on roiextractors it's a custom github workflow (not pre-commit) that ensures all publicly exposed functions and classes have docstrings. So, it just has to be satisfied before merging, which is really not much of a burden at all. |
I stand corrected, thanks for explaining it to me guys. I will check it out. |
I think it makes sense to enforce that all functions and methods must either be marked as private with a For modules, I have found it annoying and often repetitive to need to create docstrings for basic (duplicated here: catalystneuro/.github#17) |
See catalystneuro/.github#17 (comment) part 2 for full details But in summary, if we do a better job of controlling what we publically expose as submodules then we can indeed ignore the majority of |
Co-authored-by: Ben Dichter <[email protected]>
Not that it has any bearing on what is desirable but note that with the changes in #1011 functions no longer require a docstring for autodoc to display then. That was a configuration option not a requirement. Check out here: Now it is displayed even if this has not been merged. |
@h-mayorquin thanks that's helpful to know. I still think we should require docstrings for non-private methods. |
Agree, will check out the solution of roiextractors mentioned above. |
So, is the docstring OK, can we merge this? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1010 +/- ##
==========================================
- Coverage 91.43% 91.25% -0.19%
==========================================
Files 127 127
Lines 7540 7555 +15
==========================================
Hits 6894 6894
- Misses 646 661 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
|
add_recording
is not showing up in the API somehow. I am wondering if it is the lack of docstring...anyway, a docstring is good to add anyway so adding it here.