yjmantilla / sovabids

A python package for the automatic conversion of EEG datasets to the BIDS standard, with a focus on making the most out of metadata.
https://sovabids.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Parsing the filepath: regex vs custom parser #16

Closed yjmantilla closed 3 years ago

yjmantilla commented 3 years ago

So for parsing the filepath I originally had in mind something like this functionality from mp3tag:

Basically the user inputs the pattern using percentages to delimitate the fields.

This is also possible with regex like this:

image image

Each strategy has their strength and weaknesses:

As of now I'm supporting the custom parser but I think supporting regex will allow more flexibility for power users.

stebo85 commented 3 years ago

I vote for using an already established technique like regex because people already know this and creating your own parser always looks easier than it is in the end

yjmantilla commented 3 years ago

@stebo85 I had already implemented the custom parser; it works well enough, but the point of regex being the standard is a good argument. I do find the custom parser more intuitive for non-technical users.

I will try to implement the regex one and maybe put the whole parsing backend through regex, that is , translating the percentage notation of the custom parser to a regex pattern instead of being a parser itself. That way all is done through regex and the percentage notation is optional and only for non-technical users.

yjmantilla commented 3 years ago

closing this since it is already implemented in regex and the percentage notation translation to regex is also already implemented.