Skip to content

Error on get_files import #231

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

Closed
DarylWM opened this issue Oct 6, 2022 · 4 comments
Closed

Error on get_files import #231

DarylWM opened this issue Oct 6, 2022 · 4 comments

Comments

@DarylWM
Copy link

DarylWM commented Oct 6, 2022

Thanks for this handy library. I'm keen to use it but I'm a bit stuck on the import statement that's failing.

Traceback (most recent call last):
  File "main.py", line 5, in <module>
    from deid.dicom import get_files
  File "/Users/darylwilding-mcbride/anaconda3/envs/dicom-anon/lib/python3.8/site-packages/deid-0.2.36-py3.8.egg/deid/dicom/__init__.py", line 3, in <module>
    from .pixels import DicomCleaner, has_burned_pixels, clean_pixel_data
  File "/Users/darylwilding-mcbride/anaconda3/envs/dicom-anon/lib/python3.8/site-packages/deid-0.2.36-py3.8.egg/deid/dicom/pixels/__init__.py", line 2, in <module>
    from .detect import has_burned_pixels
  File "/Users/darylwilding-mcbride/anaconda3/envs/dicom-anon/lib/python3.8/site-packages/deid-0.2.36-py3.8.egg/deid/dicom/pixels/detect.py", line 22, in <module>
    dicom_files: Union[list[DcmOrStr], DcmOrStr],
TypeError: 'type' object is not subscriptable

What have I missed?

@vsoch
Copy link
Member

vsoch commented Oct 6, 2022

This looks like a bug that was added with a new release - can you try the last two versions and see if it happens? I’ll get started on a fix here.

@vsoch
Copy link
Member

vsoch commented Oct 6, 2022

okay here is a branch with a fix to test (when tests pass!) #232 I had mixed feelings about adding custom typing - largely it is useful in some cases, but also can lead to bugs (as we see here). I think for the time being I'm happier not having it.

Give that branch a test - let me know if it works and I'll get a release in asap!

@DarylWM
Copy link
Author

DarylWM commented Oct 6, 2022

Thanks @vsoch, that branch has resolved the issue. I appreciate your prompt response.

@vsoch
Copy link
Member

vsoch commented Oct 6, 2022

Thank you for reporting the bug! The fix is now in https://pypi.org/project/deid/0.2.37/. Closing, and please open other issues that might arise - we did a bit of a refactor for the data and dicom clean functionality recently.

And just a note I'm off to bed, so any other issues I'll be back tomorrow!

@vsoch vsoch closed this as completed Oct 6, 2022
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

No branches or pull requests

2 participants