@@ -226,7 +226,11 @@ dataeltype(y::DimWindowArray) = eltype(y.data.data)
226226
227227
228228
229- function xmap (f, ars:: Union{YAXArrays.Cubes.YAXArray,DimWindowArray} ...; output = XOutput (),inplace= default_inplace (f))
229+ function xmap (f, ars:: Union{YAXArrays.Cubes.YAXArray,DimWindowArray} ...;
230+ output= XOutput (),
231+ inplace= default_inplace (f),
232+ function_args= (),
233+ function_kwargs= (;))
230234 alldims = mapreduce (approxunion!,ars,init= []) do ar
231235 DD. dims (ar)
232236 end
@@ -243,10 +247,13 @@ function xmap(f, ars::Union{YAXArrays.Cubes.YAXArray,DimWindowArray}...; output
243247 output = (output,)
244248 end
245249 outaxinfo = map (output) do o
250+ nout_old = length (o. outaxes)
251+ n_added = - 1
246252 r = map (o. outaxes) do ax
247253 ax_indim = DD. dims (alldims,ax)
248254 if isnothing (ax_indim)
249- ax, length (outaxes)+ length (alldims)
255+ n_added += 1
256+ ax, nout_old + length (alldims) + n_added
250257 else
251258 idim = DD. dimnum (alldims,ax)
252259 ax, idim
@@ -276,7 +283,11 @@ function xmap(f, ars::Union{YAXArrays.Cubes.YAXArray,DimWindowArray}...; output
276283 sout = map (length,ax)
277284 DAE. create_outwindows (sout;dimsmap= dm,windows = w)
278285 end
279- daefunction = DAE. create_userfunction (f, (outtypes... ,), is_mutating= inplace,allow_threads= false )
286+ daefunction = DAE. create_userfunction (f, (outtypes... ,),
287+ is_mutating= inplace,
288+ allow_threads= false ,
289+ args= function_args,
290+ kwargs= function_kwargs)
280291 # Create DiskArrayEngine Input arrays
281292 input_arrays = map (ars) do ar
282293 a = to_windowarray (ar)
0 commit comments