Skip to content

Commit 2d62835

Browse files
committed
Custom arguments are passed to populate() in an explicit "make_kwargs" argument.
1 parent d35471e commit 2d62835

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

datajoint/autopopulate.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def _jobs_to_do(self, restrictions):
9696

9797
def populate(self, *restrictions, suppress_errors=False, return_exception_objects=False,
9898
reserve_jobs=False, order="original", limit=None, max_calls=None,
99-
display_progress=False, **kwargs):
99+
display_progress=False, make_kwargs=None):
100100
"""
101101
rel.populate() calls rel.make(key) for every primary key in self.key_source
102102
for which there is not already a tuple in rel.
@@ -108,7 +108,7 @@ def populate(self, *restrictions, suppress_errors=False, return_exception_object
108108
:param display_progress: if True, report progress_bar
109109
:param limit: if not None, checks at most that many keys
110110
:param max_calls: if not None, populates at max that many keys
111-
:param kwargs: additional custom keyword arguments that will be passed down to each make() call
111+
:param kwargs: optional dict containing arguments that will be passed down to each make() call
112112
"""
113113
if self.connection.in_transaction:
114114
raise DataJointError('Populate cannot be called during a transaction.')
@@ -151,8 +151,8 @@ def handler(signum, frame):
151151
call_count += 1
152152
self.__class__._allow_insert = True
153153
try:
154-
if kwargs:
155-
make(dict(key), **kwargs)
154+
if make_kwargs is not None:
155+
make(dict(key), **make_kwargs)
156156
else:
157157
make(dict(key))
158158
except (KeyboardInterrupt, SystemExit, Exception) as error:

0 commit comments

Comments
 (0)