-
Notifications
You must be signed in to change notification settings - Fork 43
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
Dandi export fixes #1095
Dandi export fixes #1095
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of minor things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some formatting/efficiency comments. If these fixes can fit in before your vacation, great. If not, we can merge what we have and I'll do a clean-up pass later
src/spyglass/common/common_usage.py
Outdated
@@ -272,6 +274,26 @@ def make(self, key): | |||
query.list_file_paths(paper_key) + restr_graph.file_paths | |||
) | |||
|
|||
# Check for linked nwb objects and add them to the export | |||
exclude_files = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like you're adding items to file_paths, just to remove them again with the index, is that right? I think I would structure this as on overwrite, rather than a gather + remove
keep_links = set()
for file in file_paths:
if not (links := get_linked(...)):
keep_files.add(file)
logger.warning(...)
file_paths = {'file_path': link for link in keep_links}
unique_dicts
is slow. Adding things to a set enforces uniqueness as you go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, I 'll put in a cleaner method along these lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on my end (pending changelog conflicts)
Description
Fixes for the Dandi export process
dandi.organize
to edit the copied nwb to resolve external path issuessession_.nwb
) contains external links for e-series data (not permitted by dandi)DandiPath
check for non-copied file name. If so, stream that filetranslate_name_to_dandi
by using lookup of the object id when availableupdate_analysis_for_dandi_standards()
Development notes
Todo:Handle Raw nwb files
.nwb
)_.nwb
)e-series
,analog
)Alternative (?)
_.nwb
) filenwb
file when necessary in the docker image from the original on DandiChecklist:
CITATION.cff
alter
snippet for release notes.CHANGELOG.md
with PR number and description.