Conversation
…t existing .edf files in the directory (user copied only relevant files)
Wiebke
left a comment
There was a problem hiding this comment.
Overall looks great.
I left a few very minor comments, the one regarding date comparison is likely of more relevance for the similar if a simple sort mechanism on strings is in use there currently.
|
|
||
| # Compare two dates and select the later one | ||
| if hi_date is not None and lo_date is not None: | ||
| gb_dictionary["Date"] = hi_date if hi_date > lo_date else lo_date |
There was a problem hiding this comment.
At this point, both hi_date and lo_date should be of type string. Given that the format in the header is of form e.g. Sat Apr 1 11:35:48 2023 this may be lead to incorrect ordering if high and low scan happen to involve a date switch.
This is unlikely to matter much here, but would be important to take into account in e.g. sorting according to date.
There was a problem hiding this comment.
The latest commit now addresses this, and compares the two dates as datetime objects 👍🏼
tiled/config/custom/gb.py
Outdated
| lo_header = lo_file.header | ||
| lo_date = lo_header.get("Date") |
There was a problem hiding this comment.
Any particular reason why the remainder of the header information is not added to the metadata?
There was a problem hiding this comment.
The header information will now be added to the metadata dictionary. Previously, only the date was required from the header, but the header data will not be added to avoid loss of any information.
tiled/config/custom/gb.py
Outdated
| # File does not exist, set the date as None - empty metadata dictionary is | ||
| # returned in the parse_txt_accompanying_edf method |
There was a problem hiding this comment.
This seems to be a slightly outdated comment.
There was a problem hiding this comment.
The comment isn't outdated, but it will be written in a better way to explain why an empty dictionary is needed.
Wiebke
left a comment
There was a problem hiding this comment.
Nice work!
One aspect that remains to be investigated in regards to the adapters is why gb adapter is called multiple times: If a corresponding .edf does not exist for a .gb file, the warning regarding this gets logged three times.
Testing and attempting to debug #10, indicates that this is not related to this adapter in particular, but would be good to understand overall.
This branch deals with the adapter for .gb files. Additional functionality has been added for .gb file ingestion. The goal is to take metadata associated with the .edf images associated to the respective sfloat .gb image: the hi and lo .edf images. The helper function create new indices if the same key exists with different values in the hi and low images' metadata, in order to not lose information.
The current version works in ingesting .gb files when there are .edf files with the associated .txt files. But there is a bug when ingesting a folder with just .gb files. This adapter needs debugging. The current terminal output looks like this:
with a final error statement of:
AttributeError: 'NoneType' object has no attribute 'new'