Skip to content

Mypy cleanup#933

Merged
emeryberger merged 4 commits into
masterfrom
mypy-cleanup
Aug 14, 2025
Merged

Mypy cleanup#933
emeryberger merged 4 commits into
masterfrom
mypy-cleanup

Conversation

@emeryberger
Copy link
Copy Markdown
Member

No description provided.

@emeryberger emeryberger requested a review from Copilot August 13, 2025 21:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR focuses on cleaning up type hints and addressing mypy warnings throughout the Scalene codebase. The changes improve type safety and code quality by adding proper type annotations, assertions, and modernizing certain patterns.

Key changes include:

  • Adding type annotations and assertions for better type safety
  • Replacing OrderedDict with Dict where ordering is not required
  • Modernizing code patterns (e.g., simplifying if-else logic)
  • Adding proper inheritance relationships and type ignores for mypy compatibility

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scalene/scalene_profiler.py Adds noqa comment, assertion for null check, improves function signature, changes list to tuple
scalene/scalene_preload.py Replaces print with warnings.warn for better error handling
scalene/scalene_neuron.py Simplifies boolean return logic
scalene/scalene_magics.py Adds type ignore comments for IPython magic decorators
scalene/scalene_leak_analysis.py Replaces OrderedDict with Dict in type hints
scalene/scalene_json.py Replaces OrderedDict with Dict and adds explicit type annotation
scalene/scalene_apple_gpu.py Adds proper inheritance, type annotations, and type ignore comments
ruff.toml Adds B028 to ignored lint rules

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread scalene/scalene_profiler.py
Comment thread scalene/scalene_json.py Outdated
Comment thread scalene/scalene_apple_gpu.py
emeryberger and others added 2 commits August 13, 2025 17:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@emeryberger emeryberger merged commit a5624f7 into master Aug 14, 2025
22 checks passed
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