aeye-lab / pymovements

A python package for processing eye movement data
https://pymovements.readthedocs.io
MIT License
57 stars 11 forks source link

feat: Optionally remove single-child top-level directory from extracted archives #579

Closed josephine-funken closed 8 months ago

josephine-funken commented 9 months ago

Description

Removes top-level directories from extracted files if its only child is a directory. This top-level directory in the archive is unnecessary and creates longer file paths than needed.

Fixes issue #401

Implemented changes

Type of change

How Has This Been Tested?

Checklist:

SiQube commented 9 months ago

@josephine-funken thank you for this great work! there seems to be a merge conflict which needs to be removed first -- if you have any questions how to resolve it feel free to reach out.

codecov[bot] commented 9 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (417a305) 100.00% compared to head (3118012) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #579 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 52 52 Lines 2337 2348 +11 Branches 582 587 +5 ========================================= + Hits 2337 2348 +11 ``` | [Files](https://app.codecov.io/gh/aeye-lab/pymovements/pull/579?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab) | Coverage Δ | | |---|---|---| | [src/pymovements/dataset/dataset.py](https://app.codecov.io/gh/aeye-lab/pymovements/pull/579?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab#diff-c3JjL3B5bW92ZW1lbnRzL2RhdGFzZXQvZGF0YXNldC5weQ==) | `100.00% <100.00%> (ø)` | | | [src/pymovements/dataset/dataset\_download.py](https://app.codecov.io/gh/aeye-lab/pymovements/pull/579?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab#diff-c3JjL3B5bW92ZW1lbnRzL2RhdGFzZXQvZGF0YXNldF9kb3dubG9hZC5weQ==) | `100.00% <ø> (ø)` | | | [src/pymovements/utils/archives.py](https://app.codecov.io/gh/aeye-lab/pymovements/pull/579?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab#diff-c3JjL3B5bW92ZW1lbnRzL3V0aWxzL2FyY2hpdmVzLnB5) | `100.00% <100.00%> (ø)` | | | [src/pymovements/utils/downloads.py](https://app.codecov.io/gh/aeye-lab/pymovements/pull/579?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab#diff-c3JjL3B5bW92ZW1lbnRzL3V0aWxzL2Rvd25sb2Fkcy5weQ==) | `100.00% <ø> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

josephine-funken commented 9 months ago

Added functionality to remove top-level directories to downloads.download_and_extract_archive() and added parameter to corresponding test.