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 some minor typing issues #592

Merged
merged 3 commits into from
Dec 10, 2024
Merged

Fix some minor typing issues #592

merged 3 commits into from
Dec 10, 2024

Conversation

alexey-cord-tech
Copy link
Contributor

Introduction and Explanation

A little tidy-up so that we can declare it py.typed and have the sdk_integration_tests be properly typed, too.

Known issues

There are some unfixable-ish issues anyway, but let's fix what's easy to fix.

@@ -260,7 +260,7 @@ def create_image_group(

def create_dicom_series(
self,
file_paths: List[str],
file_paths: Union[List[str], List[Path], List[Union[Path, str]]],
Copy link
Contributor

@MiloEnCord MiloEnCord May 21, 2024

Choose a reason for hiding this comment

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

s/List/Iterable/g if we're going for the most lenient definition for users convenience, like in the other method. Otherwise just Iterable[Path] instead of the whole union in both.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Iterable makes sense and in the spirit of keeping it as flexible as possible. Can probably be Iterable[Union[Path,str]] (unless mypy throws a fit?)

Copy link
Collaborator

@sergei-encord sergei-encord left a comment

Choose a reason for hiding this comment

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

Looks great!
Guys have a good point about accepting Iterable or Sequence rather than List type, but otherwise +1!

Copy link

github-actions bot commented Dec 9, 2024

Unit test report ((Pydantic 2.x)

189 tests   189 ✅  6s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit e71accc.

Copy link

github-actions bot commented Dec 9, 2024

Unit test report (Pydantic 1.x)

189 tests   189 ✅  5s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit e71accc.

Copy link

github-actions bot commented Dec 9, 2024

SDK integration test report

271 tests   271 ✅  23m 58s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit e71accc.

@alexey-cord-tech alexey-cord-tech merged commit 63b35da into master Dec 10, 2024
7 checks passed
@alexey-cord-tech alexey-cord-tech deleted the ak/typing-fixes branch December 10, 2024 11:20
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.

4 participants