Skip to content

🔧 mypy fix typing in pyramid.py #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

Conversation

Jiaqi-Lv
Copy link
Collaborator

Fixed typing issue in pyramid.py.

@Jiaqi-Lv Jiaqi-Lv changed the title :hammer mypy fix typing in pyramid.py 🔧 mypy fix typing in pyramid.py May 30, 2025
@Jiaqi-Lv Jiaqi-Lv changed the title 🔧 mypy fix typing in pyramid.py 🔧 'mypy' fix typing in pyramid.py May 30, 2025
@Jiaqi-Lv Jiaqi-Lv changed the title 🔧 'mypy' fix typing in pyramid.py 🔧 mypy fix typing in pyramid.py May 30, 2025
@Jiaqi-Lv Jiaqi-Lv self-assigned this May 30, 2025
@Jiaqi-Lv Jiaqi-Lv added the dev tools Changes/Updates in Development tools label May 30, 2025
@@ -399,6 +395,19 @@ def __iter__(self: TilePyramidGenerator) -> Iterator:
for x, y in np.ndindex(self.tile_grid_size(level)):
yield self.get_tile(level=level, x=x, y=y)

def _compression_mode_to_literal(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TarFile.open() requires mode to be Literal type, which means it can not be a normal str type and it can not be assigned from another variable, it has to be a literal string. I think this is the best way to do it.

Copy link
Collaborator

@measty measty May 30, 2025

Choose a reason for hiding this comment

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

@Jiaqi-Lv I fixed this mypy issue yesterday in PR #841, in a way that I think changes less code - take a look and let me know if you think its ok, otherwise we will have some merge issues if we try to merge that PR after this one. That PR is ready for review now anyway, so shouldn't have to wait long to merge it in

Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.69%. Comparing base (6b4a75a) to head (3e4d550).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #938   +/-   ##
========================================
  Coverage    99.69%   99.69%           
========================================
  Files           71       71           
  Lines         8934     8943    +9     
  Branches      1171     1174    +3     
========================================
+ Hits          8907     8916    +9     
  Misses          23       23           
  Partials         4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev tools Changes/Updates in Development tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants