Skip to content

test: type the grouped sum result so mypy passes again - #1194

Closed
MaykThewessen wants to merge 1 commit into
PyPSA:masterfrom
MaykThewessen:fix/mypy-grouped-sum-test
Closed

MaykThewessen wants to merge 1 commit into
PyPSA:masterfrom
MaykThewessen:fix/mypy-grouped-sum-test

Conversation

@MaykThewessen

Copy link
Copy Markdown
Contributor

Check types fails on master since #1192 (3 mypy errors in test/test_spec_operators.py): grouped_sum returns a union, so the untyped summed dict cannot go into assert_linequal. This narrows the result with an isinstance assert and types the dict. Test only, no behaviour change.

Note

The following content was generated by AI.

Checks
  • mypy . on this branch: Success: no issues found in 153 source files (master: 3 errors, same as CI run 44543554770).
  • test/test_spec_operators.py with mathspec installed: 143 passed.
  • pre-commit on the file passes.

Checklist

  • AI-generated content is marked (see AGENTS.md).
  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable). Not applicable: test-only typing fix.
  • A note for the release notes doc/release_notes.rst of the upcoming release is included. Not needed: no user-facing change.
  • I consent to the release of this PR's code under the MIT license.

🤖 Generated with Claude Code

grouped_sum returns a union, so the test dict needs a narrowed value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codspeed

codspeed Bot commented Nov 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 note

ℹ️ 181 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

✅ 181 untouched benchmarks
⏩ 181 skipped benchmarks1


Comparing MaykThewessen:fix/mypy-grouped-sum-test (2fdc759) with master (912a8c9)

Open in CodSpeed

Footnotes

  1. 181 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@FabianHofmann

Copy link
Copy Markdown
Collaborator

already solved on master - thanks!

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