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

[MRG] Improve file handling, add overwrite parameter #78

Merged
merged 17 commits into from Aug 7, 2021

Conversation

sappelhoff
Copy link
Member

closes #63

  • better file handling: Delete intermediate files when writing fails
  • better input checks: raise error when ch_names is not list of str (or list of int which we can easily turn into str)
  • add overwrite parameter and set new default (False) --> previously pybv always overwrote files, which was a bit dangerous IMHO

Also adds tests for all of those

@sappelhoff sappelhoff added the enhancement New feature or request label Aug 6, 2021
@sappelhoff sappelhoff added this to the 0.6.0 milestone Aug 6, 2021
@codecov
Copy link

codecov bot commented Aug 6, 2021

Codecov Report

Merging #78 (efbb1fc) into main (e68158d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #78   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          346       386   +40     
=========================================
+ Hits           346       386   +40     
Impacted Files Coverage Δ
pybv/io.py 100.00% <100.00%> (ø)
pybv/tests/test_bv_writer.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e68158d...efbb1fc. Read the comment docs.

@sappelhoff sappelhoff changed the title Improve file handling, add overwrite parameter [MRG] Improve file handling, add overwrite parameter Aug 6, 2021
Copy link
Collaborator

@cbrnr cbrnr left a comment

Choose a reason for hiding this comment

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

In addition to my specific comments I was wondering if os.path could also be replace by pathlib not just in the tests but also in the rest of the code?

pybv/io.py Outdated Show resolved Hide resolved
pybv/io.py Outdated Show resolved Hide resolved
pybv/io.py Outdated Show resolved Hide resolved
pybv/io.py Outdated Show resolved Hide resolved
Co-authored-by: Clemens Brunner <clemens.brunner@gmail.com>
@sappelhoff
Copy link
Member Author

In addition to my specific comments I was wondering if os.path could also be replace by pathlib not just in the tests but also in the rest of the code?

Yes, I thought about that myself. Would probably be prettier/clearer. Feel free to open an issue that then somebody can do at some point.

pybv/io.py Outdated Show resolved Hide resolved
@sappelhoff sappelhoff merged commit f80452c into bids-standard:main Aug 7, 2021
@sappelhoff sappelhoff deleted the maint/file/handling branch August 7, 2021 06:21
@cbrnr
Copy link
Collaborator

cbrnr commented Aug 9, 2021

Thanks @sappelhoff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

better file management
3 participants