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

Store attachment as single entry #277

Merged
merged 12 commits into from
Apr 12, 2023
Merged

Conversation

frankenjoe
Copy link
Collaborator

@frankenjoe frankenjoe commented Apr 11, 2023

Closes #275

As discussed in #275 it is sufficient to store the path of the attachment in the dependency file. This applies the necessary changes.

This basically changes the entry for an attached folder path/to/folder with ID attachment and the files path/to/folder/f1.txt and path/to/folder/sub/f2.txt from:

                          archive    ...
path/to/folder/f1.txt     attachment ...
path/to/folder/sub/f2.txt attachment ...

to:

               archive    ...
path/to/folder attachment ...

In addition, audb.Dependencies.attachment_files is removed and instead audb.Dependencies.attachment_ids and audb.Dependencies.attachments are added.

I will leave some comments in the code to make it easier to follow the changes.

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #277 (96e52be) into dev (cf5e730) will not change coverage.
The diff coverage is 100.0%.

❗ Current head 96e52be differs from pull request most recent head 6232a8f. Consider uploading reports for the commit 6232a8f to get more accurate results

Impacted Files Coverage Δ
audb/core/dependencies.py 100.0% <100.0%> (ø)
audb/core/load.py 100.0% <100.0%> (ø)
audb/core/load_to.py 100.0% <100.0%> (ø)
audb/core/publish.py 100.0% <100.0%> (ø)
audb/core/utils.py 100.0% <100.0%> (ø)

@frankenjoe frankenjoe requested a review from hagenw April 11, 2023 11:13
Copy link
Member

@hagenw hagenw left a comment

Choose a reason for hiding this comment

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

You also remove audb.Dependencies.attachment_files and add instead audb.Dependencies.attachment_ids and audb.Dependencies.attachments. Can you also add this to the description of the pull request.

audb/core/dependencies.py Outdated Show resolved Hide resolved
audb/core/dependencies.py Outdated Show resolved Hide resolved
audb/core/dependencies.py Outdated Show resolved Hide resolved
audb/core/load.py Show resolved Hide resolved
audb/core/load_to.py Outdated Show resolved Hide resolved
audb/core/utils.py Outdated Show resolved Hide resolved
tests/test_publish.py Show resolved Hide resolved
frankenjoe and others added 3 commits April 11, 2023 15:16
Co-authored-by: Hagen Wierstorf <hwierstorf@audeering.com>
Co-authored-by: Hagen Wierstorf <hwierstorf@audeering.com>
Co-authored-by: Hagen Wierstorf <hwierstorf@audeering.com>
audb/core/load_to.py Outdated Show resolved Hide resolved
audb/core/publish.py Outdated Show resolved Hide resolved
frankenjoe and others added 2 commits April 11, 2023 18:17
Co-authored-by: Hagen Wierstorf <hwierstorf@audeering.com>
@hagenw hagenw merged commit 4d23789 into dev Apr 12, 2023
@hagenw hagenw deleted the store-attachment-as-single-entry branch April 12, 2023 06:50
@hagenw hagenw added this to the attachments milestone Apr 17, 2023
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.

Handle attachments more efficiently
2 participants