Skip to content

feat: データモデルを設定駆動の DataSchema に汎用化 - #39

Merged
T3pp31 merged 2 commits into
masterfrom
feat/generic-data-schema
Sep 2, 2026
Merged

feat: データモデルを設定駆動の DataSchema に汎用化#39
T3pp31 merged 2 commits into
masterfrom
feat/generic-data-schema

Conversation

@T3pp31

@T3pp31 T3pp31 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

背景

卒論用途の CSV / gakuseki / bt_addrs 前提に縛られていたデータモデルを、他データセットでも扱えるよう抽象化する。

変更内容

  • config/blockchain.jsondata_schema を追加し、カラム名・CSVリネーム・ブロック input/output 形状を設定化
  • 受信データの 6 要素生リスト契約を ReceivedPayload dataclass に置換
  • MyBlockChainfilter_registered 注入を追加し、blockchain→pipeline の直接結合を緩める

影響範囲

領域 影響
src/ble_blockchain/ loader / myblock / main / delete_excess_data / 新規 types.py
config/(JSON) blockchain.jsondata_schema 追加(既定値は現行 CSV 互換)
settings*.json / keys/*.pem なし
tests/ ReceivedPayload 化、別カラム名・フィルタ注入の単テスト追加
docs/ / docs/diagrams/ 未更新(フォローアップ候補)
Raspberry Pi デプロイ 既定 schema なら既存手順のまま。実機 L2CAP 動作確認は未実施

Test plan

  • uv run pytest tests/(54 passed)
  • uv run pytest tests/integration/
  • 既定 data_schema で既存 CSV(事前取得データ.csv)相当のフィルタ・多数決が通ること
  • 別カラム名 schema(例: student_id / mac)でフィルタ・ブロック構築できること
  • Pi 実機での E2E(BLE / L2CAP)は本 PR スコープ外

不安点

  • README / Sphinx / draw.io は未更新(公開 API の説明追随が残る)
  • 実機(Raspberry Pi)での送受信確認は macOS 環境では未実施

🤖 Generated with Claude Code

Made with Cursor

T3pp31 and others added 2 commits September 3, 2026 07:48
CSV/gakuseki/bt_addrs の直書きを data_schema 設定と ReceivedPayload に置き換え、フィルタ注入で blockchain→pipeline の結合を緩める。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
CI の pylint 失敗を直し、テスト用 DataSchema ヘルパーを共通化した。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@T3pp31
T3pp31 merged commit 17c5f0d into master Sep 2, 2026
3 checks passed
@T3pp31
T3pp31 deleted the feat/generic-data-schema branch September 2, 2026 22:51
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