Skip to content

Satisfy ruff's rules by adding a lot of docstrings.#76

Merged
josephmckinsey merged 4 commits intomainfrom
jm/more_docstrings
Feb 25, 2026
Merged

Satisfy ruff's rules by adding a lot of docstrings.#76
josephmckinsey merged 4 commits intomainfrom
jm/more_docstrings

Conversation

@josephmckinsey
Copy link
Copy Markdown
Collaborator

Some of these docstrings have been autogenerated but reviewed my me. Claude seemed to be around 95% accurate, and only 5 or so docstrings needed much attention. I've erred on the side of brevity in all cases.

Copy link
Copy Markdown
Collaborator

@AadilLatif AadilLatif left a comment

Choose a reason for hiding this comment

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

@josephmckinsey there is inconsistance between docstrings aand even in function signatures. Some functions are explicit in defining input type expect. Other sare not. Some docstrings have parameter (input / output ) definations other do not. we should be consistant, which ever way we go.

comp_type : str, optional
Component type identifier (not used in mock implementation).
"""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Where did this paratmeter list come from? Does not match function / class signature

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

links: list[Link]

def clean_model(self, target_directory="."):
"""Remove component directories, log files, and stray broker processes."""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alot of these docstrings do not have paraterer defination, errors raised etc. is that expected implmentation?

Copy link
Copy Markdown
Collaborator Author

@josephmckinsey josephmckinsey Feb 16, 2026

Choose a reason for hiding this comment

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

I've tried to change it so that most functions have longer descriptions with some exceptions on private functions and the CLI documentation. Some of the less commonly used utilities also have short docstrings still.

@@ -53,6 +54,7 @@ def plot_graph_matplotlib(wiring_diagram: WiringDiagram):


def get_graph_renderer(G): # noqa: N803
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is G? add typecast

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I did not add a typehint since that would require importing networkx, which would break installations without that dependency.

@josephmckinsey josephmckinsey merged commit c2fe0ec into main Feb 25, 2026
4 checks passed
@josephmckinsey josephmckinsey deleted the jm/more_docstrings branch February 25, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants