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

[FIX] make sure running tsvread then tsvwrite does not change the file content #160

Closed
wants to merge 111 commits into from

Conversation

Remi-Gau
Copy link
Collaborator

fixes #156

  • run test on some data from bids example and not an extra tsv file
  • support saving row wise structure? This could be pushed to later.

The classic structure tends to not work where mixing types.

  logFile.onset = [2; NaN];
  logFile.trial_type = {'motion_up'; 'static'};
  logFile.duration = [1; 4];
  logFile.speed = [NaN; 4];
  logFile.is_fixation = {'true'; '3'};

  % Leads to trouble
  %   logFile.is_fixation = {'true';3};
  %   logFile.is_fixation = {true;3}; 

For example mixing logical and numeric does not work in a cell: it prints to the file but the test fails afterwards.

But the previous structure format could allow mixing the format of elements that would end up in the same column of the tsv.

  logFile(1, 1).onset = 2;
  logFile(1, 1).trial_type = 'motion_up';
  logFile(1, 1).duration = 1;
  logFile(1, 1).speed = [];
  logFile(1, 1).is_fixation = true;

  logFile(2, 1).onset = NaN;
  logFile(2, 1).trial_type = 'static';
  logFile(2, 1).duration = 4;
  logFile(2, 1).speed = 4;
  logFile(2, 1).is_fixation = 3;

So we could support this too.

HenkMutsaerts and others added 30 commits January 10, 2021 16:01
…equest/patch

[ENH] update schema - changes by create-pull-request action
…equest/patch

Changes by create-pull-request action
…equest/patch

Changes by create-pull-request action
Update ExploreASL/bids-matlab
…equest/patch

Changes by create-pull-request action
[MISC] refactor and add tests for layout asl
…equest/patch

Changes by create-pull-request action
…equest/patch

Changes by create-pull-request action
@Remi-Gau
Copy link
Collaborator Author

No rush to make a decision on this. If I don't hear back I will silence the test and we can revisit the issue later. :-)

@codecov
Copy link

codecov bot commented Feb 23, 2021

Codecov Report

Merging #160 (1dd2d2e) into master (cca6d50) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #160   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          11      11           
  Lines         864     864           
======================================
  Misses        864     864           
Flag Coverage Δ
unittests 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
+bids/+internal/file_utils.m 0.00% <0.00%> (ø)
+bids/+util/tsvwrite.m 0.00% <0.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 cca6d50...fc0e617. Read the comment docs.

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.

bids.util.tsvwrite does not correctly write fields and values from struct to output tsv
2 participants