Enhance docstrings for JansenRitParams and JansenRitModel#317
Open
Enhance docstrings for JansenRitParams and JansenRitModel#317
Conversation
…it.py Co-authored-by: JohnWangDataAnalyst <16167104+JohnWangDataAnalyst@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enhance docstrings for Jansen-Rit model classes and methods
Enhance docstrings for JansenRitParams and JansenRitModel
Mar 16, 2026
Collaborator
|
@JohnWangDataAnalyst please do the following for this:
|
JohnWangDataAnalyst
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docstrings in
whobpyt/models/jansen_rit/jansen_rit.pywere incomplete, inconsistent, and contained unresolved???placeholders and TODO comments leaking into public-facing docs. This PR rewrites all class- and method-level docstrings to NumPy style with no code logic changes.JansenRitParamsg(P-to-P gain),y0(EEG baseline offset),k/ki(external input scaling),cy0(leadfield projection scale)g_f,g_b,lmas kwargs-only attributes with appropriate notesJansenRitModelAttibutes), removed TODO comments from docstringsteps_per_TR,w_p2e,w_p2i,w_p2p__init__: documented all parameters includingparams; clarified thatoutput_sizeis overridden bylm.shape[0]Methods
createIC/createDelayIC: added docs forstate_lb,state_ub,delays_maxsetModelSCParameters: rewrote to explain gain matrix initialization; added Notes that this is auto-called in__init__forward: corrected tensor shapes (e.g.externalis(node_size, steps_per_TR, TRs_per_window)), documented all keys of the returnednext_statedict, and clarified the two-level integration loopOriginal prompt
The docstrings for the Jansen-Rit model classes and relevant methods within
whobpyt/models/jansen_rit/jansen_rit.pyare inconsistent and incomplete, although partial documentation exists. Please enhance all class-level and function-level docstrings for bothJansenRitParamsandJansenRitModel, as well as all their methods (such as__init__,createIC,createDelayIC,setModelSCParameters, andforward).Do not modify any code logic. Only update docstrings in
whobpyt/models/jansen_rit/jansen_rit.py.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: add doctrings on jansen rid model?
Assistant: The Jansen-Rit model in the GriffithsLab/whobpyt repository is implemented in the file:
whobpyt/models/jansen_rit/jansen_rit.py(GitHub link)This file already has some docstrings, but improvements and additions can be made for function-level docstrings, especially for the
JansenRitModelandJansenRitParamsclasses and their main methods such as__init__,createIC,createDelayIC,setModelSCParameters, andforward.Here is a suggested update for function and class docstrings, focusing on clarity and completeness, following standard Python conventions: