@@ -160,7 +160,6 @@ def populate(
160160 max_calls = None ,
161161 display_progress = False ,
162162 processes = 1 ,
163- return_success_count = False ,
164163 make_kwargs = None ,
165164 ):
166165 """
@@ -177,12 +176,13 @@ def populate(
177176 :param max_calls: if not None, populate at most this many keys
178177 :param display_progress: if True, report progress_bar
179178 :param processes: number of processes to use. Set to None to use all cores
180- :param return_success_count: if True, return the count of successful `make()` calls.
181- If suppress_errors is also True, returns a tuple: (success_count, errors)
182179 :param make_kwargs: Keyword arguments which do not affect the result of computation
183180 to be passed down to each ``make()`` call. Computation arguments should be
184181 specified within the pipeline e.g. using a `dj.Lookup` table.
185182 :type make_kwargs: dict, optional
183+ :return: a dict with two keys
184+ "success_count": the count of successful ``make()`` calls in this ``populate()`` call
185+ "error_list": the error list if "suppress_errors" is set to True, otherwise None
186186 """
187187 if self .connection .in_transaction :
188188 raise DataJointError ("Populate cannot be called during a transaction." )
@@ -275,12 +275,10 @@ def handler(signum, frame):
275275 if reserve_jobs :
276276 signal .signal (signal .SIGTERM , old_handler )
277277
278- if suppress_errors and return_success_count :
279- return sum (success_list ), error_list
280- if suppress_errors :
281- return error_list
282- if return_success_count :
283- return sum (success_list )
278+ return {
279+ "success_count" : sum (success_list ),
280+ "error_list" : error_list if suppress_errors else None ,
281+ }
284282
285283 def _populate1 (
286284 self , key , jobs , suppress_errors , return_exception_objects , make_kwargs = None
@@ -291,7 +289,8 @@ def _populate1(
291289 :param key: dict specifying job to populate
292290 :param suppress_errors: bool if errors should be suppressed and returned
293291 :param return_exception_objects: if True, errors must be returned as objects
294- :return: (key, error) when suppress_errors=True, otherwise None
292+ :return: (key, error) when suppress_errors=True,
293+ True if successfully invoke one `make()` call, otherwise None
295294 """
296295 make = self ._make_tuples if hasattr (self , "_make_tuples" ) else self .make
297296
0 commit comments