alan-turing-institute / empiarreader

Reader for EMPIAR datasets
BSD 3-Clause "New" or "Revised" License
8 stars 4 forks source link

Add 'simple' wildcard vs regular expression argument #32

Closed ots22 closed 1 year ago

ots22 commented 1 year ago

@ots22 sorry for the delay on this, yes that's exactly what observed. And thanks - I somehow missed that regex is required in that field! Initially I just tried changing . to \\. as it was the only regex-critical I thought was in there but that still failed in the same way. After copying the regex from the test with 10943 (ie: using filename_regexp=".*115048\\.mrc") the test succeeds instead. So looks like I'm just bad at regex!

I suspect a lot of the intended/potential userbase aren't regex experts though, so I'd like to float an idea:

If possible, I believe this would make empiarreader more accessible to those new to coding/python. Also, it might be nice to throw a more easily interpretable error upon this failure, but I'm unsure of the optimal way to implement that. Let me know your thoughts!

Originally posted by @JatGreer in https://github.com/alan-turing-institute/empiarreader/issues/22#issuecomment-1561553883

JatGreer commented 1 year ago

Implemented in pull request #33