Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e79939b
Get started on this PR.
jpivarski Oct 5, 2019
ff8f629
Bring basic getitems of ListOffsetArray up to speed.
jpivarski Oct 5, 2019
1abf837
Removed underscores from _numba.util functions.
jpivarski Oct 5, 2019
7cbc00b
Infrastructure for ListOffsetArray.getitem(tuple).
jpivarski Oct 5, 2019
0b5f315
ListOffsetArray and ListArray's Numba implementations are synchronized.
jpivarski Oct 5, 2019
9dcf700
Pass other getitem types through the tuple-handler.
jpivarski Oct 8, 2019
1a03600
A 64-bit ListArray-NumpyArray advanced array index works.
jpivarski Oct 8, 2019
f1da14f
Identities that have been tested are correct, but some id assignments…
jpivarski Oct 8, 2019
863e16d
Fixing wrong .id assignments.
jpivarski Oct 8, 2019
ba61aa5
Now all the .id assignments should be correct.
jpivarski Oct 8, 2019
ffb2b8f
Cleaned up all TODOs.
jpivarski Oct 8, 2019
2ec6377
Transfer to laptop.
jpivarski Oct 8, 2019
bb64e21
Use arraydecl to type NumpyArray slices.
jpivarski Oct 8, 2019
c39c050
Regularize NumpyArray's slice, just like any other.
jpivarski Oct 8, 2019
fd60d1e
Slicing 2-dimensional NumpyArray.
jpivarski Oct 8, 2019
6ac1788
test_current() is the platform for developing NumpyArray.getitem_next.
jpivarski Oct 8, 2019
1f24f97
[skip ci] in progress.
jpivarski Oct 9, 2019
6db10b8
Fancy indexes pass from ListArray to NumpyArray in Numba.
jpivarski Oct 9, 2019
51b70f5
Try to fix 32-bit error.
jpivarski Oct 9, 2019
5dd1b0f
ListArray.getitem_next(int) works.
jpivarski Oct 9, 2019
f522bc2
[skip ci] in progress.
jpivarski Oct 9, 2019
332a5c0
[skip ci] fixed a carry-issue in type, but there's badly formed LLVM IR.
jpivarski Oct 9, 2019
be5b501
ListArray32/64 and ListOffsetArray32/64 are all at the same level: ge…
jpivarski Oct 10, 2019
429b951
Probably fixed 32-bit issue.
jpivarski Oct 10, 2019
fa03bf6
Try the test without negative-correction on 32-bit.
jpivarski Oct 10, 2019
10e6f0f
More diagnostics for 32-bit.
jpivarski Oct 10, 2019
f48e4b4
Yet more diagnostics for 32-bit.
jpivarski Oct 10, 2019
61bd975
Yet yet more diagnostics for 32-bit.
jpivarski Oct 10, 2019
bb2dae0
Replace 'zext' with 'sext'.
jpivarski Oct 10, 2019
8436f83
Cleaned up all debugging code.
jpivarski Oct 10, 2019
35ee6c9
[skip ci] in progress.
jpivarski Oct 10, 2019
37e277b
Partially implemented ListArray.getitem_next(range).
jpivarski Oct 10, 2019
7552692
Homogenized ListArray and ListOffsetArray; ensured that nextoffsets f…
jpivarski Oct 10, 2019
c6033bc
Implemented ListOffsetArray.getitem_next(range, not advanced).
jpivarski Oct 10, 2019
df3afae
All of the Numba getitems seem to be done.
jpivarski Oct 10, 2019
70bd926
Updated README; ready to squash and merge.
jpivarski Oct 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ The following features of awkward 0.x will be features of awkward 1.x.
* 2019-09-21 (PR [#9](../../pull/9)): `Identity` is correctly passed through `NumpyArray` slices and `__getitem__` uses `get`, `slice`, or the full `getitem`, depending on argument complexity.
* 2019-09-26 (PR [#11](../../pull/11)): fully implemented `ListArray` and `ListOffsetArray`'s `__getitem__`.
* 2019-10-02 (PR [#12](../../pull/12)): implemented `ListArray.__getitem__(array)` in Numba, setting the pattern for all the other cases.
* 2019-10-04 (PR [#13](../../pull13)): turned the `Error` type into a struct and `handle_error` into a function that provides `Identity` (if available) and attempted index information. Numba also handles errors, but with messages that must be known at compile-time.
* 2019-10-04 (PR [#14](../../pull14)): brought `NumpyArray`, `ListArray`, and `ListOffsetArray` up-to-date on `getitem` for all cases (except `newaxis`) and tested them all as well. (Not including Numba.)
* 2019-10-04 (PR [#13](../../pull/13)): turned the `Error` type into a struct and `handle_error` into a function that provides `Identity` (if available) and attempted index information. Numba also handles errors, but with messages that must be known at compile-time.
* 2019-10-04 (PR [#14](../../pull/14)): brought `NumpyArray`, `ListArray`, and `ListOffsetArray` up-to-date on `getitem` for all cases (except `newaxis`) and tested them all as well. (Not including Numba.)
* 2019-10-10 (PR [#15](../../pull/15)): brought `NumpyArray`, `ListArray`, and `ListOffsetArray` up-to-date on `getitem` in Numba (except `newaxis` and `Ellipsis`).

## Roadmap

Expand Down
2 changes: 1 addition & 1 deletion VERSION_INFO
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.11
0.1.12
2 changes: 1 addition & 1 deletion awkward1/_numba/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def generic(self, args, kwargs):
if not isinstance(wheretpe, numba.types.BaseTuple):
wheretpe = numba.types.Tuple((wheretpe,))

wheretpe = util._typing_regularize_slice(wheretpe)
wheretpe = util.typing_regularize_slice(wheretpe)

if any(not isinstance(t, (numba.types.Integer, numba.types.SliceType, numba.types.EllipsisType, type(numba.typeof(numpy.newaxis)), numba.types.Array)) for t in wheretpe.types):
raise TypeError("only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`), and integer or boolean arrays (possibly jagged) are valid indices")
Expand Down
2 changes: 1 addition & 1 deletion awkward1/_numba/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, dmm, fe_type):
if xfile.find("./compounddef/location").attrib["file"].startswith("src/cpu-kernels"):
for xfcn in xfile.findall(".//memberdef[@kind='function']"):
name = xfcn.find("./name").text
if hasattr(kernels, name):
if hasattr(kernels, name) and name not in ("success", "failure"):
rettype = xfcn.find("./type").text
params = [(x.find("./declname").text, x.find("./type").text) for x in xfcn.findall("./param")]
getattr(kernels, name).name = name
Expand Down
23 changes: 23 additions & 0 deletions awkward1/_numba/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,29 @@ def lower_len(context, builder, sig, args):
proxyin = numba.cgutils.create_struct_proxy(tpe)(context, builder, value=val)
return numba.targets.arrayobj.array_len(context, builder, numba.types.intp(tpe.arraytpe), (proxyin.array,))

def lower_getitem_any(context, builder, idtpe, wheretpe, idval, whereval):
proxyin = numba.cgutils.create_struct_proxy(idtpe)(context, builder, value=idval)

if isinstance(wheretpe, numba.types.Integer):
proxyslice = numba.cgutils.create_struct_proxy(numba.types.slice2_type)(context, builder)
proxyslice.start = util.cast(context, builder, wheretpe, numba.intp, whereval)
proxyslice.stop = builder.add(proxyslice.start, context.get_constant(numba.intp, 1))
proxyslice.step = context.get_constant(numba.intp, 1)
wheretpe = numba.types.slice2_type
whereval = proxyslice._getvalue()

proxyout = numba.cgutils.create_struct_proxy(idtpe)(context, builder)
proxyout.ref = proxyin.ref
proxyout.fieldloc = proxyin.fieldloc
if isinstance(wheretpe, numba.types.BaseTuple):
proxyout.array = numba.targets.arrayobj.getitem_array_tuple(context, builder, idtpe.arraytpe(idtpe.arraytpe, wheretpe), (proxyin.array, whereval))
elif isinstance(wheretpe, numba.types.Array):
proxyout.array = numba.targets.arrayobj.fancy_getitem_array(context, builder, idtpe.arraytpe(idtpe.arraytpe, wheretpe), (proxyin.array, whereval))
else:
proxyout.array = numba.targets.arrayobj.getitem_arraynd_intp(context, builder, idtpe.arraytpe(idtpe.arraytpe, wheretpe), (proxyin.array, whereval))

return proxyout._getvalue()

@numba.typing.templates.infer_getattr
class type_methods(numba.typing.templates.AttributeTemplate):
key = IdentityType
Expand Down
Loading