Robust AFL Operators

The functions in this module closely correspond to AFL calls, but they preprocess arrays as needed to satisfy any requirements that SciDB imposes on the schemas of arrays used as AFL arguments.

As an example, the AFL merge function requires that its two input arrays have the same attribute list, number of dimensions, and dimension start index. The merge() function performs this preprocessing as needed.

scidbpy.robust.join(a, b)

Robust AFL join operation

Parameters:

a : SciDBArray

Left array

b : SciDBArray

Right array

Returns:

result : SciDBArray

join(a, b)

Notes

Performs any of the following steps if needed:

  • Broadcast A and B to equal shapes
  • Align array origins
  • Match chunk sizes and overlaps
scidbpy.robust.merge(a, b)

Robust AFL merge operation

Parameters:

a : SciDBArray

Left array

b : SciDBArray

Right array

Returns:

result : SciDBArray

merge(a, b)

Notes

Performs any of the following steps if needed:

  • Broadcast A and B to equal shapes
  • Match attribute names, if unambiguous
  • Align array origins
scidbpy.robust.gemm(a, b, c)

Robust AFL gemm operation

Performs a * b + c

Redimensions inputs if necessary

Parameters:

a : SciDBArray

First array

b : SciDBArray

Second array

c : SciDBArray

Third array

Returns:

result : SciDBArray

a * b + c

scidbpy.robust.cumulate(array, *args)

Robust AFL cumulate call

Parameters:

array : Array to cumulate

*args: Additional arguments to pass to AFL cumulate()

Returns:

cumulate(array, *args)

Notes

Re-chunks array to have no chunk overlap, if needed

scidbpy.robust.reshape(array, *args)

Robust AFL reshape

scidbpy.robust.gesvd(array, *args)

Robust AFL svd call

Parameters:

array : SciDBArray

*args : Subsequent arguments to SVD AFL call

Notes

Rechunks array if needed by AFL

scidbpy.robust.thin(array, *args)

Robust AFL thin call

Parameters:

array : SciDBArray

The array to thin

args: sequence of ints

sequence of start, step for each dimension

Notes

The array is redimensioned if necessary, so that the chunk size is a multiple of the thin steps

scidbpy.robust.cross_join(a, b, *dims)

Robust AFL cross_join

Parameters:

a : SciDBArray

The left array in the join

b : SciDBArray

The right array in the join

*dims : Pairs of dimension names

The dimensions to join along

Notes

Arrays will be rechunked as needed for the cross join to run

scidbpy.robust.uniq(a, is_sorted=False)

Robust AFL uniq operator

Parameters:

a : SciDBArray

Array to compute unique elements of. Must have a single attribute

is_sorted: bool

Whether the array is pre_sorted

Returns:

u : SciDBArray

The unique elements of A

Notes

Will flatten and/or sort the input as necessar