File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 11## Release notes
22
3- ### 0.13.5 -- May 13 , 2022
3+ ### 0.13.5 -- May 19 , 2022
44* Update - Import ABC from collections.abc for Python 3.10 compatibility
5+ * Bugfix - Fix multiprocessing value error (#1013 ) PR #1026
56
67### 0.13.4 -- March, 28 2022
78* Add - Allow reading blobs produced by legacy 32-bit compiled mYm library for matlab. PR #995
Original file line number Diff line number Diff line change @@ -173,8 +173,7 @@ def populate(
173173 :param limit: if not None, check at most this many keys
174174 :param max_calls: if not None, populate at most this many keys
175175 :param display_progress: if True, report progress_bar
176- :param processes: number of processes to use. When set to a large number, then
177- uses as many as CPU cores
176+ :param processes: number of processes to use. Set to None to use all cores
178177 :param make_kwargs: Keyword arguments which do not affect the result of computation
179178 to be passed down to each ``make()`` call. Computation arguments should be
180179 specified within the pipeline e.g. using a `dj.Lookup` table.
@@ -211,9 +210,10 @@ def handler(signum, frame):
211210
212211 keys = keys [:max_calls ]
213212 nkeys = len (keys )
213+ if not nkeys :
214+ return
214215
215- if processes > 1 :
216- processes = min (processes , nkeys , mp .cpu_count ())
216+ processes = min (* (_ for _ in (processes , nkeys , mp .cpu_count ()) if _ ))
217217
218218 error_list = []
219219 populate_kwargs = dict (
Original file line number Diff line number Diff line change 1- 0.13.5 -- May 13 , 2022
1+ 0.13.5 -- May 19 , 2022
22----------------------
33* Update - Import ABC from collections.abc for Python 3.10 compatibility
4+ * Bugfix - Fix multiprocessing value error (#1013) PR #1026
45
560.13.4 -- March 28, 2022
67----------------------
Original file line number Diff line number Diff line change @@ -69,6 +69,15 @@ def test_multi_processing(self):
6969 == len (self .subject ) * self .experiment .fake_experiments_per_subject
7070 )
7171
72+ def test_max_multi_processing (self ):
73+ assert self .subject , "root tables are empty"
74+ assert not self .experiment , "table already filled?"
75+ self .experiment .populate (processes = None )
76+ assert (
77+ len (self .experiment )
78+ == len (self .subject ) * self .experiment .fake_experiments_per_subject
79+ )
80+
7281 @raises (DataJointError )
7382 def test_allow_insert (self ):
7483 assert_true (self .subject , "root tables are empty" )
You can’t perform that action at this time.
0 commit comments