-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Hello,
I think I came across a parsing bug while using pyseq==0.9.0 in one of our tools.
Here is a minimal script to reproduce it, tested using multiple versions of python (from 3.9 to 3.11):
import pyseq
if __name__ == "__main__":
images = [
"s001_0030_1.jpg",
"s001_0030_2.jpg",
"s001_0090_1.jpg",
"s001_0090_2.jpg",
]
sequences = pyseq.get_sequences(images)
# This prints "Sequences found: [<pyseq.Sequence "s001_0030_1-2.jpg">, <pyseq.Sequence "s001_0090_1-2.jpg">]"
# which is the expected result.
print("Sequences found: ", sequences)
# This prints the following :
# s001_0030_2.jpg is in s001_0090_1-90.jpg <- This one is NOT expected
# s001_0090_1.jpg is in s001_0090_1-2.jpg
# s001_0090_2.jpg is in s001_0090_1-2.jpg
for image in images:
if sequences[1].contains(image):
print(f"{image} is in {sequences[1]}")As stated in the script's comments, here is what I have noticed to be "wrong":
s001_0030_2.jpgshould not be included ins001_0090_1-2.jpg- after calling
contains()on the sequence, its__str__()method returnss001_0090_1-90.jpginstead ofs001_0090_1-2.jpg
This is not a blocking issue on our part, I will tell our users to place their files in different folders as a workaround.
I'm at your disposal if you need more details.
Thanks in advance :)