You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[searchlight] sys.exit used in _get_block_data #156
Indeed, I am saying that an exception should be raised in distribute, such that the user code can decide what to do, instead of exiting the program as we are doing now. This is the approach we are using everywhere else in BrainIAK.
In practice, in addition to raising an exception in _get_block_data, the exception should be caught and a new one raised in distribute (so the user does not see the implementation details in the traceback).
Instead, it would be simpler to check the input shape in distribute and just remove the else code from _get_block_data.
is the mask argument guaranteed to be a numpy array, and or the 4d arrays inside subjects, should there be an instance check and maybe a np.array(<argument>) if isinstance(<argument>, np.ndarray) returns false?
thinking of something like:
assertmask.ndim==3, "mask should be a 3D array"for (idx, subj) inenumerate(subjects):
assertsubj.ndim==4, \
"expected 4D data for index {} in subjects".format(idx)
We should also check mask. And arguments should be np.ndarray instances. It is better if users explicitly apply np.array to other data structures themselves and deal with potential issues.
Activity
YSanchezAraujo commentedon Jun 21, 2017
@mihaic are you saying the exception should be raised here instead of here
mihaic commentedon Jun 21, 2017
@YSanchezAraujo, thanks for looking into this issue.
Indeed, I am saying that an exception should be raised in
distribute, such that the user code can decide what to do, instead of exiting the program as we are doing now. This is the approach we are using everywhere else in BrainIAK.In practice, in addition to raising an exception in
_get_block_data, the exception should be caught and a new one raised indistribute(so the user does not see the implementation details in the traceback).Instead, it would be simpler to check the input shape in
distributeand just remove theelsecode from_get_block_data.YSanchezAraujo commentedon Jun 21, 2017
thanks for the response, some questions:
is the
maskargument guaranteed to be a numpy array, and or the 4d arrays insidesubjects, should there be an instance check and maybe anp.array(<argument>)ifisinstance(<argument>, np.ndarray)returns false?thinking of something like:
mihaic commentedon Jun 21, 2017
We should also check
mask. And arguments should benp.ndarrayinstances. It is better if users explicitly applynp.arrayto other data structures themselves and deal with potential issues.minor: single quote to double (#156)
Use redismodules for task table and result table. (#156)