Skip to content

Fix two misspellings of target_treeitem in tree_overview docstrings - #844

Merged
smathot merged 1 commit into
open-cogsci:nightingalefrom
dylanpulver:docs-fix-target-treeitem-name
Dec 1, 2026
Merged

smathot merged 1 commit into
open-cogsci:nightingalefrom
dylanpulver:docs-fix-target-treeitem-name

Conversation

@dylanpulver

Copy link
Copy Markdown
Contributor

What changed

TreeOverview has two drop handlers that both take target_treeitem, and both docstrings spell it wrong — differently:

line method documented actual parameter
398 drop_event_item_existing target_tree_item target_treeitem
566 drop_event_item_new target_treeite target_treeitem

Numpydoc matches entries by name, so neither currently documents anything, and target_treeitem reads as undocumented in both. The second is a truncation — the trailing m is simply missing.

Both misspellings are unique in the package: target_tree_item appears 1 time, target_treeite (not followed by m) appears 1 time, and the correct target_treeitem appears 76 times. Two lines in one file.

How it was checked

  • ast.parse on the file — exit 0.
  • ast.get_docstring plus the signature for both methods: drop_event_item_existing now documents data, e and target_treeitem with none unresolved. Before the change each method had one documented name that matched no parameter.
  • grep -cE 'target_tree_item|target_treeite([^m]|$)' on the file — 2 before, 0 after.
  • A docstring scan of the package reports 11 entries that resolve to no argument before this change and 9 after, i.e. exactly these two and nothing else disturbed.
  • ruff check and ruff format --check, before and after, with the file stashed and git status --porcelain asserted empty to get a true baseline. Check output is identical (11 pre-existing findings in both runs) and the format result is unchanged — the file was already reported as needing reformatting before my change, so that is pre-existing. Note the repo does not configure ruff, so those ran on ruff's defaults rather than a project config.

I have not run the test suite: this is a two-word docstring change with no runtime effect, and OpenSesame's suite needs a Qt environment that is not set up here. I would rather say that than report a result I did not obtain.

Not changed

A scan finds 9 other docstring entries in libqtopensesame/ that do not resolve to a real argument — among them qtopensesame.py's save_file documenting dummy, remember and catch while taking only self, and run_experiment documenting fullscreen. Those look like they need a judgement about intent rather than a rename, so I left every one of them out to keep this to a single claim. Happy to look at them separately if useful.

🤖 Generated with Claude Code

drop_event_item_existing documented "target_tree_item" and
drop_event_item_new documented "target_treeite". Both parameters are
target_treeitem, which is the spelling used in the other 76 places.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@smathot

smathot commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this! 👍

@smathot
smathot merged commit cbe4b04 into open-cogsci:nightingale Dec 1, 2026
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