-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
Item object was originally implemented to resolve the characters representing the frame in a str via doing a comparisons str_parts and str_digits.
This behaviour has been superseded and exists in lss.util::find_matching_frame_substrings
eg--lsseq/src/lss/dataclass/item.py
Lines 19 to 34 in 73dad3e
| class Item: | |
| """ | |
| A primitive class for defining an abstract representation of an item. | |
| The purpose to be used to find the substring representing | |
| a frame against another item. | |
| Examples: | |
| >>> item = Item('mario01_v003.rgb') | |
| >>> item.name | |
| 'mario01_v003.rgb' | |
| >>> item.str_parts | |
| ['mario', '_v', '.rgb'] | |
| >>> item.str_digits | |
| ['01', '003'] | |
| """ |
Lines 11 to 31 in 73dad3e
| def find_matching_frame_substrings( | |
| str1: str, str2: str, | |
| strict=True) -> Optional[SubstrMatch]: | |
| """ | |
| Diff between str1 and str2 to to resolve the frame representation | |
| of each string. | |
| Examples: | |
| >>> find_matching_frame_substrings('file01_0040.rgb', 'file01_0041.rgb') | |
| SubstrMatch(pos=SubstrPos(start=7, end=11), groups=('0040', '0041')) | |
| >>> find_matching_frame_substrings('file1.03.rgb', 'file2.03.rgb') | |
| SubstrMatch(pos=SubstrPos(start=4, end=5), groups=('1', '2')) | |
| >>> bool(find_matching_frame_substrings('file02_0040.rgb', 'file01_0041.rgb')) | |
| False | |
| :param str1: The string object for comparison against. | |
| :param str2: The string to compare to the object string. | |
| :param strict: If True, the length of the digit padding | |
| must be the same when comparing |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels