-
Notifications
You must be signed in to change notification settings - Fork 1
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
Consider using ISO8601 for date component #31
Comments
Thanks a lot @glopesdev for taking the time to read the specification and to raise this issue. I like the idea of merging the Regarding the specific formatting, I do love That's why we went for the The options below would not break the key-value convention: datetime.fromisoformat("20230810")
datetime.fromisoformat("20230810T1453")
datetime.fromisoformat("20230810T145328Z") But these are not very friendly to human eyes (especially the last two). Let's have @JoeZiminski also weigh in, as he has implemented relevant functionality in datashuttle. |
Hey @glopesdev thanks a lot for this! That's a very useful suggestion to use ISO8601 formatting for datetime, previously I have been stuck on the best way to represent this. Currently in datashuttle there are keywords (
The datetime format in datashuttle (as above) actually needs fixing, because it breaks BIDS, so ISO8601 format is perfect. I would suggest to maintain flexibility, separate |
@niksirbi @JoeZiminski thanks for the feedback, it's interesting that when I first read the BIDS Specification I only noticed If this was the principle, then actually there wouldn't be any parsing problems in accepting values with multiple However, I now realize they do say that values also must be strictly "alphanumeric" so I guess that excludes any symbols. It's interesting since further down in the specification they do mention that date time information "MUST be expressed in the following format Anyway, I agree your proposal may be the best compromise if indeed other BIDS parsers do not understand values with multiple dashes. |
Hey @glopesdev thanks a lot for this, I didn't know that about the date time information formatting for BIDS, that is quite confusing. I agree it must be specifically for the sidecar json metadata as it cannot be for folder / filenames. I agree to err on the side of caution and avoid non-alphanumeric characters in case they case problems down the line with BIDS parsers, even though in theory it would not be an issue to have a parsing scheme. Another benefit is that it is easier to researchers to remember the I'll make an issue on |
closed with #38 Thanks @glopesdev! |
https://github.com/neuroinformatics-unit/SWC-Blueprint/blob/4699e3c4d95e0265d7f06fcf40c75af8a4107a7c/docs/source/specification.md?plain=1#L60
It can sometimes happen that an experimenter wants to run multiple sessions of the same subject on the same day, so it would be nice to standardize an optional time component for the BIDS path.
A widely used option which would be backwards compatible with the current one is ISO 8601. The current date string format is already a valid ISO 8601 string. This has the further advantage that it can be immediately parsed with the new
datetime.fromisoformat
class method from python 3.11.The proposal would be to extend
date
intodatetime
and simply allow for any valid ISO 8601 string that thefromisoformat
method would also accept. Examples below adapted from their docs:All the above strings are parsed successfully by the method (my bias, I particularly like the last format since it makes for a more human-readable datetime string which is still file-system compatible and standards-compliant).
The text was updated successfully, but these errors were encountered: