looper icon indicating copy to clipboard operation
looper copied to clipboard

Error using `--sel-excl` flag: `TypeError: 'in <string>' requires string as left operand, not list`

Open nleroy917 opened this issue 9 months ago • 1 comments
trafficstars

I just hit an error using looper and the --sel-excl flag. I was trying to exclude a specific set of samples from running through my pipeline. As such I was using the --sel-attr + --sel-excl flags. Here is the full traceback:

 Traceback (most recent call last):
  File "/sfs/gpfs/tardis/home/xjk5hp/code/scripts/model-training/atacformer-scatlas-base/.venv/bin/looper", line 8, in <module>
    sys.exit(main_cli())
             ^^^^^^^^^^
  File "/sfs/gpfs/tardis/home/xjk5hp/code/scripts/model-training/atacformer-scatlas-base/.venv/lib/python3.11/site-packages/looper/cli_pydantic.py", line 357, in main_cli
    main()
  File "/sfs/gpfs/tardis/home/xjk5hp/code/scripts/model-training/atacformer-scatlas-base/.venv/lib/python3.11/site-packages/looper/cli_pydantic.py", line 353, in main
    return run_looper(args, parser, test_args=test_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/sfs/gpfs/tardis/home/xjk5hp/code/scripts/model-training/atacformer-scatlas-base/.venv/lib/python3.11/site-packages/looper/cli_pydantic.py", line 269, in run_looper
    run = Runner(prj)
          ^^^^^^^^^^^
  File "/sfs/gpfs/tardis/home/xjk5hp/code/scripts/model-training/atacformer-scatlas-base/.venv/lib/python3.11/site-packages/looper/looper.py", line 74, in __init__
    self.counter = LooperCounter(len(prj.samples))
                                     ^^^^^^^^^^^
  File "/sfs/gpfs/tardis/home/xjk5hp/code/scripts/model-training/atacformer-scatlas-base/.venv/lib/python3.11/site-packages/looper/project.py", line 63, in __getattr__
    return fetch_samples(
           ^^^^^^^^^^^^^^
  File "/sfs/gpfs/tardis/home/xjk5hp/code/scripts/model-training/atacformer-scatlas-base/.venv/lib/python3.11/site-packages/looper/project.py", line 829, in fetch_samples
    kept_samples = list(filter(keep, kept_samples))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/sfs/gpfs/tardis/home/xjk5hp/code/scripts/model-training/atacformer-scatlas-base/.venv/lib/python3.11/site-packages/looper/project.py", line 818, in keep
    return not hasattr(s, selector_attribute) or getattr(
                                                 ^^^^^^^^
TypeError: 'in <string>' requires string as left operand, not list

The reason I believe its the --sel-excl flag killing things is because of where this error originates. Moreover, running without this flag lets the pipeline run as normal.

nleroy917 avatar Feb 07 '25 14:02 nleroy917