| 679 | |
| 680 | @classmethod |
| 681 | def parse_stg_layers_indices(cls, stg_layers_indices: str) -> List[List[int]]: |
| 682 | # First split by "], " to separate the lists, but preserve the closing bracket |
| 683 | lists = [s + "]" for s in stg_layers_indices.split("],")[:-1]] |
| 684 | # Add the last list which already has its closing bracket |
| 685 | if stg_layers_indices.strip(): |
| 686 | lists.append(stg_layers_indices.split("],")[-1]) |
| 687 | |
| 688 | result = [] |
| 689 | for s in lists: |
| 690 | s = s.strip() |
| 691 | if s == "[]": # Empty list case |
| 692 | result.append([]) |
| 693 | else: |
| 694 | # Remove brackets and whitespace |
| 695 | s = s.strip("[]").strip() |
| 696 | if not s: # Handle case like "[]" after split |
| 697 | result.append([]) |
| 698 | else: |
| 699 | # Split by comma and convert to integers |
| 700 | numbers = [int(n.strip()) for n in s.split(",") if n.strip()] |
| 701 | result.append(numbers) |
| 702 | |
| 703 | return result |
| 704 | |
| 705 | def get_guider( |
| 706 | self, |