Repository navigation
Clear all 22 mypy errors in signal_processor.py (#432 session 5) - #444
Merged
Merged
Conversation
Two TypedDicts plus six annotations: - `ai_topology`: mixes a str, a List[str], and later a Dict[str, float] in one literal, widening to Sequence[str] (the structural ancestor of str and List[str]) under mypy -- which has no .append(). Since this shape is local to one function (not a shared schema like #431's RECORDING_SCHEMAS/LENS_CONFIG), annotated Dict[str, Any] rather than adding a dedicated TypedDict, matching galaxyscope.py's `observation` precedent. - `directory_group_data`: mixes int/float/List[float] per entry, same "object" widening as record_keeper.py's folder_stats. Added a DirectoryGroupData TypedDict this time (used across a longer stretch of the function than ai_topology, worth naming). - `fingerprint`/`local_fingerprint`: Dict[str, float], matching _classify_archetype's own declared Tuple[str, float, Dict[str, float]] return type. - `archetype_counts`/`static_counts`: Dict[str, int] tallies. - `ecosystem_fingerprint`: Dict[str, Dict[str, Any]]. - `bottlenecks`: Dict[str, List[Dict[str, Any]]], matching what's later .append()'d into each of its three keys. - `report`: Dict[str, Any] -- a wide result structure whose sibling literal values (file_impact, function_impact, systemic_bottlenecks, ...) are different nested shapes; mypy's per-key inference on a plain dict literal doesn't keep them distinct, and a TypedDict for something this wide isn't worth it. 126 -> 104 unique baseline entries. Verified: signal_processor.py reports zero mypy errors after this change ("Success: no issues found in 1 source file"). flake8, dead_key_audit.py --ci, full pytest suite (866 passed, 1 deselected, 1 pre-existing xfail) all clean.
Contributor
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
Part of #429/#432, one file per session. This session: `signal_processor.py` (the largest remaining file, 22 errors).
Two `TypedDict`s plus six annotations -- no shared/exported schema this time, so most of these stayed function-local:
126 → 104 unique baseline entries.
Test plan