From d925655f9650ce326eadebe210078669ddd16462 Mon Sep 17 00:00:00 2001 From: janvanrijn Date: Fri, 3 Mar 2017 15:31:03 +0100 Subject: [PATCH] if else around non guaranteed run element --- openml/runs/__init__.py | 4 ++-- openml/runs/functions.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openml/runs/__init__.py b/openml/runs/__init__.py index 38c869fe0..562327d34 100644 --- a/openml/runs/__init__.py +++ b/openml/runs/__init__.py @@ -1,4 +1,4 @@ from .run import OpenMLRun -from .functions import (run_task, get_run, list_runs) +from .functions import (run_task, get_run, list_runs, get_runs) -__all__ = ['OpenMLRun', 'run_task', 'get_run', 'list_runs'] +__all__ = ['OpenMLRun', 'run_task', 'get_run', 'list_runs', 'get_runs'] diff --git a/openml/runs/functions.py b/openml/runs/functions.py index 04ad168a6..efc74e314 100644 --- a/openml/runs/functions.py +++ b/openml/runs/functions.py @@ -200,7 +200,11 @@ def _create_run_from_xml(xml): uploader_name = run['oml:uploader_name'] task_id = int(run['oml:task_id']) task_type = run['oml:task_type'] - task_evaluation_measure = run['oml:task_evaluation_measure'] + if 'oml:task_evaluation_measure' in run: + task_evaluation_measure = run['oml:task_evaluation_measure'] + else: + task_evaluation_measure = None + flow_id = int(run['oml:flow_id']) flow_name = run['oml:flow_name'] setup_id = int(run['oml:setup_id'])