[skip ci] renamed _add_generic_pointwise provided_func argument to callback
This commit is contained in:
parent
793f4e22ba
commit
482db1ac3b
|
@ -1402,7 +1402,7 @@ class Result:
|
|||
|
||||
def _job_pointwise(self,
|
||||
group: str,
|
||||
provided_func: Callable,
|
||||
callback: Callable,
|
||||
datasets: Dict[str, str],
|
||||
args: Dict[str, str],
|
||||
lock: LockBase) -> List[Union[None, Any]]:
|
||||
|
@ -1418,7 +1418,7 @@ class Result:
|
|||
'meta': {k:(v.decode() if not h5py3 and type(v) is bytes else v) \
|
||||
for k,v in loc.attrs.items()}}
|
||||
lock.release()
|
||||
r = provided_func(**datasets_in,**args)
|
||||
r = callback(**datasets_in,**args)
|
||||
return [group,r]
|
||||
except Exception as err:
|
||||
print(f'Error during calculation: {err}.')
|
||||
|
@ -1433,7 +1433,7 @@ class Result:
|
|||
|
||||
Parameters
|
||||
----------
|
||||
func : function
|
||||
callback : function
|
||||
Callback function that calculates a new dataset from one or
|
||||
more datasets per HDF5 group.
|
||||
datasets : dictionary
|
||||
|
@ -1459,7 +1459,7 @@ class Result:
|
|||
print('No matching dataset found, no data was added.')
|
||||
return
|
||||
|
||||
default_arg = partial(self._job_pointwise,provided_func=func,datasets=datasets,args=args,lock=lock)
|
||||
default_arg = partial(self._job_pointwise,callback=func,datasets=datasets,args=args,lock=lock)
|
||||
|
||||
for group,result in util.show_progress(pool.imap_unordered(default_arg,groups),len(groups)): #type: ignore
|
||||
if not result:
|
||||
|
|
Loading…
Reference in New Issue