Skip to content
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

Fix Type hint #2195

Merged
merged 4 commits into from
Jul 17, 2024
Merged

Fix Type hint #2195

merged 4 commits into from
Jul 17, 2024

Conversation

ZhipengXue97
Copy link
Contributor

Description

Fix Several type check warnings reported by Pyre@Google, which were outdated after code modifications.

Detail

  1. update the return type of function color_to_triple from tuple[int, int, int] to Union[list, tuple[int, int, int]], according to the condition check, color could be list and directly return after commit 3613061
  2. update the return type of function build_dataset from tuple[DataLoader, DataLoader, DataLoader] to tuple[DataLoader, DataLoader, DataLoader | None], the test_dl is init as None and could directly return if self.test_ds is None after commit d193109
  3. update the return type of function validate_augmentors from str to list[str], the input v is list[str] and directly return after condition check after commit adac1a2
  4. update the return type of function _build_dataset from tuple[Dataset, Dataset, Dataset] to Dataset, since the function only returns a Dataset after commit d193109
  5. update the return type of function _build_dataset from tuple[Dataset, Dataset, Dataset] to Dataset, since the function only returns a Dataset after commit d193109

@AdeelH
Copy link
Collaborator

AdeelH commented Jul 15, 2024

Thank you very much for the PR! We require contributors to sign a CLA before their changes can be accepted. See instructions here: https://docs.rastervision.io/en/stable/CONTRIBUTING.html#contributor-license-agreement-cla. Let me know when you've submitted it.

@ZhipengXue97
Copy link
Contributor Author

Hi, @AdeelH, I have signed and submitted the CLA.

@AdeelH
Copy link
Collaborator

AdeelH commented Jul 16, 2024

The CI failure looks to be formatting-related. You will need to run scripts/format_code and scripts/style_tests using the versions of flake8 and yapf in requirements-dev.txt.

Copy link
Collaborator

@AdeelH AdeelH left a comment

Choose a reason for hiding this comment

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

Thanks!

@AdeelH AdeelH merged commit a25fa34 into azavea:master Jul 17, 2024
2 checks passed
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.15%. Comparing base (9f7237d) to head (e9e98c4).
Report is 41 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2195      +/-   ##
==========================================
- Coverage   90.22%   90.15%   -0.07%     
==========================================
  Files         198      198              
  Lines        9888     9888              
==========================================
- Hits         8921     8915       -6     
- Misses        967      973       +6     

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

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