44import xmltodict
55
66from .setup import OpenMLSetup , OpenMLParameter
7- from openml .flows import sklearn_to_flow , flow_exists
7+ from openml .flows import flow_exists
88
99
1010def setup_exists (flow , model = None ):
@@ -74,7 +74,7 @@ def get_setup(setup_id):
7474 return _create_setup_from_xml (result_dict )
7575
7676
77- def setup_list (flow = None , tag = None , offset = None , size = None ):
77+ def list_setups (flow = None , tag = None , setup = None , offset = None , size = None ):
7878 """List all setups matching all of the given filters.
7979
8080 Perform API call `/setup/list/{filters}
@@ -85,6 +85,8 @@ def setup_list(flow=None, tag=None, offset=None, size=None):
8585
8686 tag : str, optional
8787
88+ setup : list(int), optional
89+
8890 offset : int, optional
8991
9092 size : int, optional
@@ -100,6 +102,8 @@ def setup_list(flow=None, tag=None, offset=None, size=None):
100102 api_call += "/offset/%d" % int (offset )
101103 if size is not None :
102104 api_call += "/limit/%d" % int (size )
105+ if size is not None :
106+ api_call += "/setup/%s" % ',' .join ([str (int (i )) for i in setup ])
103107 if flow is not None :
104108 api_call += "/flow/%s" % flow
105109 if tag is not None :
@@ -120,11 +124,11 @@ def _list_setups(api_call):
120124 % str (setups_dict ))
121125 elif '@xmlns:oml' not in setups_dict ['oml:setups' ]:
122126 raise ValueError ('Error in return XML, does not contain '
123- '"oml:runs "/@xmlns:oml: %s'
127+ '"oml:setups "/@xmlns:oml: %s'
124128 % str (setups_dict ))
125129 elif setups_dict ['oml:setups' ]['@xmlns:oml' ] != 'http://openml.org/openml' :
126130 raise ValueError ('Error in return XML, value of '
127- '"oml:runs "/@xmlns:oml is not '
131+ '"oml:seyups "/@xmlns:oml is not '
128132 '"http://openml.org/openml": %s'
129133 % str (setups_dict ))
130134
0 commit comments