Skip to content

Fix docstring compliance (PY-D05) - #269

Merged
Felix-Mallinder merged 1 commit into
developfrom
Python_Toolkit-#268-FixDocstringCompliance
Nov 26, 2026
Merged

Felix-Mallinder merged 1 commit into
developfrom
Python_Toolkit-#268-FixDocstringCompliance

Conversation

@Felix-Mallinder

Copy link
Copy Markdown
Contributor

Issues addressed by this PR

Closes #268

Fixes the 9 docstring gaps that the bhom-python skill's PY-D05 check (#264, #265) reports on develop:

  • bhom_callable: documents identifier.
  • figure_to_base64: documents transparent.
  • default_scorer: adds a Returns: section.
  • embed_image, embed_image_file, decay_rate_smoother (both copies), cmap_sample_plot, spatial_heatmap: parameter descriptions now end with a full stop.

Each edited file also gets the BHoM copyright header (2015 - 2026), per the skill's PY-F06 rule. Only docstrings and comments change; there are no code changes.

Test files

From Python_Engine/Python, run check_docstrings.py src from the bhom-python skill (branch Python_Toolkit-#264-AddBHoMPythonClaudeSkill, .claude/skills/bhom-python/scripts/). It reports PY-D05: no findings. Every edited file still parses.

Changelog

  • Completed missing parameter, return and punctuation documentation in Python docstrings, and added BHoM copyright headers to the edited files.

Additional comments

The PY-F03 file-name findings from the same skill are out of scope here.

🤖 Generated with Claude Code

@Felix-Mallinder Felix-Mallinder added type:compliance Non-conforming to code guidelines AI Assisted Code Co-authored with AI priority:low Resources should be targeted to other issues first labels Nov 20, 2026
@Felix-Mallinder
Felix-Mallinder marked this pull request as ready for review November 20, 2026 14:57
@Felix-Mallinder Felix-Mallinder self-assigned this Nov 20, 2026

@SimosManiatis SimosManiatis left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I checked that only docstrings and comments changed (the code is identical once docstrings are stripped), and check_docstrings.py reports no PY-D05 findings.

Conflicts with #272. Both PRs edit the default_scorer docstring in searchable_list_box.py, and merging them gives a conflict. #272's new fuzzy_scorer and default_scorer also have no Returns: section, so PY-D05 will fail again after both merge. Could you add Returns: in #272 and rebase whichever PR goes second?

Copyright headers. No .py file in the repo has one yet, and PY-F06 is still on the unmerged skill branch (#264). Adding headers to just these 8 files makes the repo inconsistent.

Document missing parameters (bhom_callable identifier, figure_to_base64
transparent), add a Returns section to default_scorer, and end parameter
descriptions with a full stop. Add the BHoM copyright header (2015 - 2026)
to each edited file. Docstrings and comments only, no code changes.

Fixes #268

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Felix-Mallinder
Felix-Mallinder force-pushed the Python_Toolkit-#268-FixDocstringCompliance branch from 0d2a544 to 80cff09 Compare November 24, 2026 14:22

@SimosManiatis SimosManiatis left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Python review - Python_Toolkit #269

Scope: 80cff09 against develop (5d5ee53). Eight .py files. Docstrings and the copyright comment only.
Automated: check_docstrings.py reports PY-D05: no findings on this branch. Current develop has 10 findings, including fuzzy_scorer and default_scorer with no Returns: section. With docstrings and comments stripped, the code tokens match develop on all eight files. pytest: 100 passed. black would reformat these same files on develop as well.

Blockers

None in this diff.

Major

The ten PY-D05 findings on develop are cleared here.

  • figure_to_base64: the new transparent line matches the signature default (True).
  • fuzzy_scorer: Returns: matches the code (the score when it is at least min_score, otherwise None).
  • default_scorer: Returns: matches the code (200 for a word match, above any fuzzy score).

Earlier comments

This branch is rebased past #272, which is merged. fuzzy_scorer and default_scorer both have a Returns: section, so PY-D05 stays clean once this merges. Merging with current develop is clean: #273 does not touch these files.

The copyright headers stay. #265 has merged the skill onto develop, and PY-F06 asks for the header on every Python file a pull request changes. Files this PR does not touch stay as they are. These eight headers are the standard text, year 2015 - 2026.

Existing issues (not introduced by this PR)

  • PY-F04: six of these files already start with a UTF-8 BOM on develop. This branch keeps it, and the header text follows the BOM.
  • PY-F01: black would reformat these files on develop too.
  • bhom_callable still has argument_types={} (PY-C01) and a bare except (PY-E01). This diff does not change that code.

Verdict

Approve

@SimosManiatis SimosManiatis left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So the check_docstrings.py reports no PY-D05 findings on this branch. Current develop still has 10, including fuzzy_scorer and default_scorer with no Returns: section. With docstrings and comments stripped, the code in all eight files matches develop. pytest passed 100 tests on the rerun. The first run failed one Tk test with a local tcl_findLibrary error; that test is outside this diff, and the full suite then passed. The searchable-list tests, including fuzzy matching, passed both times so all good.

Also i saw that both scorers now have a Returns: section, and those lines match the code (200 for a word match, None when a fuzzy score is below min_score). figure_to_base64's new transparent line matches the signature default, True.

@Felix-Mallinder

Copy link
Copy Markdown
Contributor Author

@BHoMBot check required

@bhombot-ci

bhombot-ci Bot commented Nov 25, 2026

Copy link
Copy Markdown

@Felix-Mallinder to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

There are 195 requests in the queue ahead of you.

@Felix-Mallinder

Copy link
Copy Markdown
Contributor Author

@BHoMBot check ready-to-merge

@bhombot-ci

bhombot-ci Bot commented Nov 25, 2026

Copy link
Copy Markdown

@Felix-Mallinder to confirm, the following actions are now queued:

  • check ready-to-merge

There are 67 requests in the queue ahead of you.

@Felix-Mallinder

Copy link
Copy Markdown
Contributor Author

@BHoMBot check installer , check versioning

@bhombot-ci

bhombot-ci Bot commented Nov 25, 2026

Copy link
Copy Markdown

@Felix-Mallinder to confirm, the following actions are now queued:

  • check installer

There are 72 requests in the queue ahead of you.

@Felix-Mallinder

Copy link
Copy Markdown
Contributor Author

@BHoMBot check versioning

@bhombot-ci

bhombot-ci Bot commented Nov 25, 2026

Copy link
Copy Markdown

@Felix-Mallinder to confirm, the following actions are now queued:

  • check versioning

There are 73 requests in the queue ahead of you.

@bhombot-ci

bhombot-ci Bot commented Nov 25, 2026

Copy link
Copy Markdown

The check installer has already been run previously and recorded as a successful check. This check has not been run again at this time.

@Felix-Mallinder

Copy link
Copy Markdown
Contributor Author

@BHoMBot check ready-to-merge

@bhombot-ci

bhombot-ci Bot commented Nov 26, 2026

Copy link
Copy Markdown

@Felix-Mallinder to confirm, the following actions are now queued:

  • check ready-to-merge

There are 21 requests in the queue ahead of you.

@Felix-Mallinder
Felix-Mallinder merged commit d7bc2ea into develop Nov 26, 2026
19 checks passed
@Felix-Mallinder
Felix-Mallinder deleted the Python_Toolkit-#268-FixDocstringCompliance branch November 26, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Assisted Code Co-authored with AI priority:low Resources should be targeted to other issues first type:compliance Non-conforming to code guidelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docstrings missing parameters, Returns sections or ending punctuation

2 participants