Skip to content

Sequence.contains() : Errors with sequences that contain unrelated numbers #89

@robin-vagner

Description

@robin-vagner

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.jpg should not be included in s001_0090_1-2.jpg
  • after calling contains() on the sequence, its __str__() method returns s001_0090_1-90.jpg instead of s001_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 :)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions