Skip to content

Fix for Evaluator config value parser#477

Merged
riccardosavorgnan merged 1 commit into
emerge/temp_trainingfrom
ricky/fix-eval-parameters-parser
Jun 4, 2026
Merged

Fix for Evaluator config value parser#477
riccardosavorgnan merged 1 commit into
emerge/temp_trainingfrom
ricky/fix-eval-parameters-parser

Conversation

@riccardosavorgnan
Copy link
Copy Markdown
Collaborator

Fixes the value parsing for the Evaluator classes in base.py. Tested with:

source .venv/bin/activate && python -c "
cases = [
    ('false', False), ('False', False), ('FALSE', False),
    ('0', False), ('no', False), ('No', False),
    ('true', True), ('True', True), ('1', True), ('yes', True),
    (0, False), (1, True), (False, False), (True, True),
]
for raw, expected in cases:
    if isinstance(raw, str):
        result = raw.strip().lower() not in ('false', '0', 'no')
    else:
        result = bool(raw)
    status = 'OK' if result == expected else 'FAIL'
    print(f'{status}  {repr(raw)!s:12} -> {result}')
"
OK  'false'      -> False
OK  'False'      -> False
OK  'FALSE'      -> False
OK  '0'          -> False
OK  'no'         -> False
OK  'No'         -> False
OK  'true'       -> True
OK  'True'       -> True
OK  '1'          -> True
OK  'yes'        -> True
OK  0            -> False
OK  1            -> True
OK  False        -> False
OK  True         -> True

@riccardosavorgnan riccardosavorgnan merged commit 001012a into emerge/temp_training Jun 4, 2026
12 checks passed
@riccardosavorgnan riccardosavorgnan deleted the ricky/fix-eval-parameters-parser branch June 4, 2026 15:45
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

Successfully merging this pull request may close these issues.

2 participants