Skip to content

docs: add module docstring and usage examples to public API - #25

Merged
Kotakku merged 1 commit into
mainfrom
doc/add-module-docstrings
Mar 21, 2026
Merged

docs: add module docstring and usage examples to public API#25
Kotakku merged 1 commit into
mainfrom
doc/add-module-docstrings

Conversation

@Kotakku

@Kotakku Kotakku commented Mar 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • __init__.py にモジュールdocstringを追加し、help(baglab) で基本的な使い方(load, subscript access, dot notation, stamp_to_sec, align_origin, explode_array)が表示されるようにした
  • Bag クラスのdocstringに「baglab.load() を使うこと」と subscript アクセスの例を追加
  • load() 関数に Examples セクションを追加

Motivation

AI ツールがインストール済みパッケージのみから API を推測する際、docstring が不十分だと bl.Bag(), bag.read(), 手動 t0 = min(...) のような誤った使い方のコードが生成される。help() で正しいパターンが表示されることでこれを防ぐ。

Test plan

  • help(baglab) で Quick start が表示されることを確認
  • help(baglab.load) で Examples が表示されることを確認
  • 既存テスト通過(1件の既存失敗を除く)

🤖 Generated with Claude Code

help(baglab) and help(baglab.load) now show the intended usage patterns
(load, subscript access, stamp_to_sec, etc.) so that AI tools and users
can discover the correct API from the installed package alone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Kotakku Kotakku changed the title doc: add module docstring and usage examples to public API docs: add module docstring and usage examples to public API Mar 21, 2026
@Kotakku
Kotakku merged commit e86845e into main Mar 21, 2026
3 of 4 checks passed
@Kotakku
Kotakku deleted the doc/add-module-docstrings branch March 26, 2026 11:37
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.

1 participant