Skip to content

Conversation

@ClePol
Copy link
Member

@ClePol ClePol commented May 17, 2023

I had a crash where my time format in the recon-surf was 'Di 16. Mai 17:36:34 CEST 2023', which is localized to german.

I'm not sure why that's the case, but it wouldn't hurt to have a fallback to try to read the local timeformat. The function dateutil.parser.parse does not consider local timeformats, but datetime.datetime.strptime does.

Edit: This in not a problem in docker, but when running the recon-all pipeline locally. With this fix in the stable branch the pipeline runs locally without error.

@LeHenschel LeHenschel requested a review from af-a May 19, 2023 10:45
@LeHenschel
Copy link
Contributor

Looks fine with me. Before merging, I would suggest that @AhmedFaisal95 makes sure that this does not break anything inside the time extraction scripts.

@af-a
Copy link
Contributor

af-a commented Jun 13, 2023

Hi @ClePol. Thanks for the suggestion.

The locale check makes sense, but we can't use datetime.datetime.strptime because it fails in some cases where the recon-surf date-time string contains an extra empty space in a single-digit day sub-string, e.g. "#@# Intensity Normalization2 Tue Jan 3 06:30:17 UTC 2023" (instead of "#@# Intensity Normalization2 Tue Jan 17 HH:MM:SS UTC 2023").

This is why we switched from datetime.datetime.strptime to dateutil.parser.parse, which is more robust can handle this case, a while ago (see 073d019).
Note: At the time, we decided to only support the standard English datetime format in favour of the more robust parser.

I suggest that we find a different solution that still considers the local locale settings.

Let me know if you have any ideas.

@ClePol
Copy link
Member Author

ClePol commented Jun 13, 2023 via email

@m-reuter
Copy link
Member

will merge this for now as it is only a fallback. If any of you has an idea how to do this better, please do another PR.

@m-reuter m-reuter merged commit 41b03f6 into Deep-MI:dev Jun 14, 2023
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.

4 participants