Skip to content

pop_chansel duplicates parse_text_tokens and raises StopIteration on an empty quoted token #508

Closed

Description

@neuromechanist

🤖 Found while reviewing #463; not part of that PR.

pop_chansel._parse_text (src/eegprep/functions/popfunc/pop_chansel.py) re-implements the quoted-token parsing that parse_text_tokens (src/eegprep/functions/miscfunc/value_parsing.py) already provides, and its copy still has the bug that #463 fixed in the shared helper: an empty quoted token raises.

Reproduction:

from eegprep.functions.miscfunc.value_parsing import parse_text_tokens
from eegprep.functions.popfunc.pop_chansel import _parse_text

parse_text_tokens("'', Cz")  # ['', 'Cz']
_parse_text("'', Cz")        # StopIteration

Ordinary input such as Cz, 'Fp1' gives the same result from both.

Suggested fix: delete _parse_text and call parse_text_tokens, keeping the existing pop_chansel tests and adding one for an empty quoted token. parse_text_tokens also strips surrounding braces, so check that the channel-list text field behaves the same for {...} input.

Activity

  1. added
    bug
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions