Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nleroy917 opened this issue Feb 7, 2025 · 1 comment

Comments

@nleroy917
Copy link
Member

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
Copy link
Member Author

Somehow a duplicate got made. Closing this.

@github-project-automation github-project-automation bot moved this to Done in PEP Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant