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

[DAR-3579][External] Resolved legacy NifTI annotation import blocker #917

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

JBWilkie
Copy link
Collaborator

Problem

Work introduced in darwin-py 1.0.4 introduced a bug when importing NifTI annotations in the using the legacy method. When doing this, we turn the importer into a partial function. In 1.0.4 we introduced a function that checks the format of the importer. However, it does not work with partial functions, resulting in:

Traceback (most recent call last):   File "test.py", line 12, in <module>     importer.import_annotations(dataset, parser, ANNOTATION_PATHS, append=True)   File "/Users/john/Documents/code/development/darwin-py/darwin/importer/importer.py", line 851, in import_annotations     annotation_format = _get_annotation_format(importer)   File "/Users/john/Documents/code/development/darwin-py/darwin/importer/importer.py", line 1521, in _get_annotation_format     return importer.__module__.split(".")[3] AttributeError: 'functools.partial' object has no attribute '__module__'

Solution

Allow _get_annotation_format() to work with partial functions. This is temporary, and we can remove it in a future version when we have finished migrating NifTI annotation imports from the legacy method to the new method

Changelog

Resolved bug with legacy NifTI annotation imports

Copy link

linear bot commented Aug 27, 2024

@JBWilkie JBWilkie merged commit 00fd6a9 into master Aug 27, 2024
24 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