docs: add module docstring and usage examples to public API - #25
Merged
Conversation
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>
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.
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 が表示されることを確認🤖 Generated with Claude Code