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

[ENH] Allow fractional seconds in scans file datetimes #470

Merged
merged 5 commits into from
May 23, 2020

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented May 13, 2020

Closes #469. Explicitly allows fractional seconds (i.e., sub-second resolution) in acq_time column of Scans file. Fractional seconds are (1) optional, (2) must follow a period, and (3) have no restriction on precision.

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

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

Thanks @tsalo. Could you please verify the state of the bids-validator regarding your changes?

  • does it validate the RFC3339 format in scans.tsv at all?
  • does it throw an error if we now optionally include microseconds?

answering these questions will help us to see what we need to implement in the validator before merging this PR (or in parallel to working on this PR)

@tsalo
Copy link
Member Author

tsalo commented May 13, 2020

@sappelhoff It look like bids-validator does validate the scans file, and it should raise an error (number 84, specifically) if microseconds are included. See here and here.

I can edit list.js easily enough, since the part that needs to be changed is essentially just a json. However, I don't know JavaScript, so I have no idea how to update checkAcqTimeFormat.js to allow optional sections in the datetime format that is being checked.

decreased. Dates that are shifted for anonymization purposes should be set to a
year 1925 or earlier to clearly distinguish them from unmodified data. Shifting
dates is RECOMMENDED, but not required.
in the following format `2009-06-15T13:45:30[.000000]` (year, month, day,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we here or somewhere state that the number of fractional digits is up to the user?

Copy link
Member Author

@tsalo tsalo May 13, 2020

Choose a reason for hiding this comment

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

What do you think of "No specific precision is required for fractional seconds, but the precision should be consistent across the dataset"?

Copy link
Member

Choose a reason for hiding this comment

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

No specific precision is required for fractional seconds, but the precision should be consistent across the dataset

👍 with a capital SHOULD

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@sappelhoff
Copy link
Member

ok, thanks for checking @tsalo

However, I don't know JavaScript, so I have no idea how to update checkAcqTimeFormat.js to allow optional sections in the datetime format that is being checked.

In that case, opening an issue on bids-validator would be a good idea and hopefully we find somebody to help us. Worst case we'll have to dig in ourselves (we'll see).

@tsalo
Copy link
Member Author

tsalo commented May 13, 2020

I just opened bids-standard/bids-validator#957. We'll see if anyone has the time and bandwidth to help.

yarikoptic
yarikoptic previously approved these changes May 22, 2020
Copy link
Collaborator

@yarikoptic yarikoptic left a comment

Choose a reason for hiding this comment

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

Even though it might lead to some BIDS tools breaking

  • addressing compatibility issue should be quite easy
  • necessity and benefits of adding sub-second precision IMHO outweigh aforementioned compatibility issue
  • waiting for BIDS 2.0 which has no clear roadmap/ETA to introduce such a change would be overkill

person based on the date and time of their scan would be decreased. Dates that
are shifted for anonymization purposes should be set to a year 1925 or earlier
to clearly distinguish them from unmodified data. Shifting dates is
RECOMMENDED, but not required.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can I be annoying and ask that you move each new sentence to a new line? This is a good example of a small change that forces the entire paragraph to be in the diff because we don't break at sentence boundaries. If we're going to have a big diff, why not make it one that helps us have smaller diffs in the future?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be good now.

@effigies
Copy link
Collaborator

Should note I agree with @yarikoptic. The spec doesn't have to wait on the validator. The validator is obliged to follow the spec.

effigies
effigies previously approved these changes May 22, 2020
Copy link
Collaborator

@effigies effigies left a comment

Choose a reason for hiding this comment

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

Thanks! I appreciate the extra effort.

@sappelhoff sappelhoff mentioned this pull request May 23, 2020
5 tasks
nicholst
nicholst previously approved these changes May 23, 2020
Copy link
Collaborator

@nicholst nicholst left a comment

Choose a reason for hiding this comment

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

I'm happy with this....

@tsalo tsalo dismissed stale reviews from nicholst and effigies via 042ca11 May 23, 2020 14:06
@sappelhoff
Copy link
Member

cool, we have 4 approvals (although they were dismissed by the last commit), so I am merging now. thanks @tsalo

@sappelhoff sappelhoff merged commit 5ebe6f2 into bids-standard:master May 23, 2020
@tsalo tsalo deleted the frac-sec branch May 23, 2020 14:22
satra added a commit to satra/bids-specification that referenced this pull request May 27, 2020
* upstream/master:
  [DOC] Auto-generate changelog entry for PR bids-standard#470
  Clarify precision of fractional seconds.
  Separate sentences.
  Square brackets seem to be a problem.
  Wrangle line lengths.
  Add optional fractional seconds to scans file datetimes.
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.

Allow microseconds in scans file datetimes
5 participants