Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

TomDonoghue
Copy link
Member

@TomDonoghue TomDonoghue commented Jul 5, 2023

This is an update adding more functionality to programmatically managing docstrings, with the overall goal of being able to copy around docstrings sections automatically instead of copy / pasting in the source code.

This is a somewhat forward looking update (will be more useful / important as we add more objects that may share parameters, etc), but here already gets used with the FOOOFGroup object to copy over sections.

In terms of reviewing, it's mostly annoying string manipulation, and any thoughts are more than welcome - but in terms of evaluating functionality, I checked that this works when building the docsite, which is what I'm largely using to check that this ultimately work:

This is the built docsite page for FOOOFGroup:
Screen Shot 2023-07-05 at 7 18 16 PM

This show what the source code page shows (showing the changes are enacted):
Screen Shot 2023-07-05 at 7 18 38 PM

@TomDonoghue TomDonoghue added the 1.1 Targetted for a fooof 1.1 release. label Jul 5, 2023
@fooof-tools fooof-tools deleted a comment from codecov-commenter Jul 5, 2023
Copy link
Contributor

@voytek voytek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, I didn't even know this was an option.

@TomDonoghue
Copy link
Member Author

Very nice, I didn't even know this was an option.

I mean, it's sorta a hack - but once you take Python's "everything is an object" thing seriously, then you can treat docstrings as string objects that can be programmatically updated and attached to objects! MNE does something similar, which I think is where I first got the idea here (though we're doing a simpler version).

@TomDonoghue TomDonoghue merged commit e89c033 into main Jul 7, 2023
@TomDonoghue TomDonoghue deleted the docstrings branch July 7, 2023 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.1 Targetted for a fooof 1.1 release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants