Fix IndexError in create_long_loaddata #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the parsing of metadata from file names into
Metadata_channel
.To determine the channel number of an image, parse.img_channel runs the equivalent of:
Before, it was running:
'Some example image_A02_s4BC203976-D332-4A32-A12B-64DEEEBCFBF8.tif' ->
int(img_url.split('_')[3][1])
-> IndexErrorThe fix uses img_list instead of just_filenames:
'Some batch/2025-03-18/1234/TimePoint_1/Some example image_A02_s4BC203976-D332-4A32-A12B-64DEEEBCFBF8.tif' ->
int(img_url.split('_')[3][1])
-> 4I was surprised to find this, so this might need a second pair of eyes to make sure this fix is appropriate. My test was done with
new_ix: true
- maybe this needs to be applied only to new-format datasets?