Skip to content

Commit

Permalink
Wrote a demo for Numba. (#87)
Browse files Browse the repository at this point in the history
Very little was actually changed to get the Numba demo going. The `"__str__"` parameter became `"__typestr__"` and UnionArray got its `tostring` fixed (previously missing `tags` and `index`).

Two versions of the notebook were written: the "EVALUATED" and "UNEVALUATED" forms.

* Start working on a demo for Numba.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Changed parameter '__str__' to '__typestr__' and included tags and index in UnionArray::tostring.

* Writing.

* Writing.

* Writing.

* Writing.

* Writing.

* Split into evaluated and unevaluated versions.

* Split into evaluated and unevaluated versions.
  • Loading branch information
jpivarski authored Jan 22, 2020
1 parent ec2d8b7 commit 2efb982
Show file tree
Hide file tree
Showing 28 changed files with 9,147 additions and 1,049 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
studies/**/sample-*
docs/demos/countries.geojson
docs/demos/test-program
docs/demos/test-program.cpp

############################################################# IDEs

Expand Down
2 changes: 1 addition & 1 deletion VERSION_INFO
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.86
0.1.87
8 changes: 4 additions & 4 deletions awkward1/behavior/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def __iter__(self):
yield x

awkward1.classes["char"] = CharBehavior
byte = awkward1.layout.PrimitiveType("uint8", {"__class__": "char", "__str__": "byte", "encoding": None})
utf8 = awkward1.layout.PrimitiveType("uint8", {"__class__": "char", "__str__": "utf8", "encoding": "utf-8"})
byte = awkward1.layout.PrimitiveType("uint8", {"__class__": "char", "__typestr__": "byte", "encoding": None})
utf8 = awkward1.layout.PrimitiveType("uint8", {"__class__": "char", "__typestr__": "utf8", "encoding": "utf-8"})

class StringBehavior(awkward1.highlevel.Array):
def __iter__(self):
Expand All @@ -45,5 +45,5 @@ def __eq__(self, other):
raise NotImplementedError("return one boolean per string, not lists of booleans per character")

awkward1.classes["string"] = StringBehavior
bytestring = awkward1.layout.ListType(byte, {"__class__": "string", "__str__": "bytes"})
string = awkward1.layout.ListType(utf8, {"__class__": "string", "__str__": "string"})
bytestring = awkward1.layout.ListType(byte, {"__class__": "string", "__typestr__": "bytes"})
string = awkward1.layout.ListType(utf8, {"__class__": "string", "__typestr__": "string"})
4 changes: 2 additions & 2 deletions awkward1/signatures/ListOffsetArray_8cpp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="src/libawkward/array/ListOffsetArray.cpp" line="52" column="11" bodyfile="src/libawkward/array/ListOffsetArray.cpp" bodystart="52" bodyend="54"/>
<location file="src/libawkward/array/ListOffsetArray.cpp" line="20" column="11" bodyfile="src/libawkward/array/ListOffsetArray.cpp" bodystart="20" bodyend="22"/>
</memberdef>
<memberdef kind="function" id="namespaceawkward_1aa3d73a21953e0578aa577329c38dc0ed" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<templateparamlist>
Expand All @@ -124,7 +124,7 @@
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="src/libawkward/array/ListOffsetArray.cpp" line="57" column="11" bodyfile="src/libawkward/array/ListOffsetArray.cpp" bodystart="57" bodyend="59"/>
<location file="src/libawkward/array/ListOffsetArray.cpp" line="25" column="11" bodyfile="src/libawkward/array/ListOffsetArray.cpp" bodystart="25" bodyend="27"/>
</memberdef>
</sectiondef>
<briefdescription>
Expand Down
16 changes: 11 additions & 5 deletions awkward1/signatures/NumpyArray_8cpp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<includes local="yes">awkward/type/PrimitiveType.h</includes>
<includes local="yes">awkward/type/RegularType.h</includes>
<includes local="yes">awkward/type/ArrayType.h</includes>
<includes local="yes">awkward/array/RegularArray.h</includes>
<includes local="yes">awkward/util.h</includes>
<includes local="yes">awkward/array/NumpyArray.h</includes>
<incdepgraph>
Expand Down Expand Up @@ -45,11 +46,13 @@
</childnode>
<childnode refid="12" relation="include">
</childnode>
<childnode refid="13" relation="include">
</childnode>
</node>
<node id="10">
<label>awkward/type/ArrayType.h</label>
</node>
<node id="11">
<node id="12">
<label>awkward/util.h</label>
</node>
<node id="4">
Expand All @@ -61,7 +64,10 @@
<node id="5">
<label>awkward/cpu-kernels/identities.h</label>
</node>
<node id="12">
<node id="11">
<label>awkward/array/RegularArray.h</label>
</node>
<node id="13">
<label>awkward/array/NumpyArray.h</label>
</node>
<node id="9">
Expand Down Expand Up @@ -104,7 +110,7 @@
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="src/libawkward/array/NumpyArray.cpp" line="141" column="8" bodyfile="src/libawkward/array/NumpyArray.cpp" bodystart="141" bodyend="180"/>
<location file="src/libawkward/array/NumpyArray.cpp" line="159" column="8" bodyfile="src/libawkward/array/NumpyArray.cpp" bodystart="159" bodyend="198"/>
</memberdef>
<memberdef kind="function" id="namespaceawkward_1adf8a5960d7cc8e8447e7357e7416a1dd" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>const std::vector&lt; ssize_t &gt;</type>
Expand All @@ -121,7 +127,7 @@
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="src/libawkward/array/NumpyArray.cpp" line="607" column="21" bodyfile="src/libawkward/array/NumpyArray.cpp" bodystart="607" bodyend="616"/>
<location file="src/libawkward/array/NumpyArray.cpp" line="626" column="21" bodyfile="src/libawkward/array/NumpyArray.cpp" bodystart="626" bodyend="635"/>
</memberdef>
<memberdef kind="function" id="namespaceawkward_1aadc1072e0733b797c5e796c493958e92" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>const std::vector&lt; ssize_t &gt;</type>
Expand All @@ -138,7 +144,7 @@
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="src/libawkward/array/NumpyArray.cpp" line="618" column="21" bodyfile="src/libawkward/array/NumpyArray.cpp" bodystart="618" bodyend="625"/>
<location file="src/libawkward/array/NumpyArray.cpp" line="637" column="21" bodyfile="src/libawkward/array/NumpyArray.cpp" bodystart="637" bodyend="644"/>
</memberdef>
</sectiondef>
<briefdescription>
Expand Down
8 changes: 7 additions & 1 deletion awkward1/signatures/RegularArray_8cpp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<includes local="yes">awkward/type/ArrayType.h</includes>
<includes local="yes">awkward/type/UnknownType.h</includes>
<includes local="yes">awkward/array/NumpyArray.h</includes>
<includes local="yes">awkward/array/ListOffsetArray.h</includes>
<includes local="yes">awkward/array/RegularArray.h</includes>
<incdepgraph>
<node id="7">
Expand All @@ -35,7 +36,7 @@
<node id="5">
<label>awkward/cpu-kernels/identities.h</label>
</node>
<node id="12">
<node id="13">
<label>awkward/array/RegularArray.h</label>
</node>
<node id="11">
Expand All @@ -44,6 +45,9 @@
<node id="8">
<label>awkward/type/RegularType.h</label>
</node>
<node id="12">
<label>awkward/array/ListOffsetArray.h</label>
</node>
<node id="3">
<label>sstream</label>
</node>
Expand Down Expand Up @@ -72,6 +76,8 @@
</childnode>
<childnode refid="12" relation="include">
</childnode>
<childnode refid="13" relation="include">
</childnode>
</node>
</incdepgraph>
<innernamespace refid="namespaceawkward">awkward</innernamespace>
Expand Down
72 changes: 72 additions & 0 deletions awkward1/signatures/UnionArray_8cpp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.16">
<compounddef id="UnionArray_8cpp" kind="file" language="C++">
<compoundname>UnionArray.cpp</compoundname>
<includes local="no">sstream</includes>
<includes local="no">type_traits</includes>
<includes local="yes">awkward/cpu-kernels/identities.h</includes>
<includes local="yes">awkward/cpu-kernels/getitem.h</includes>
<includes local="yes">awkward/type/UnionType.h</includes>
<includes local="yes">awkward/type/ArrayType.h</includes>
<includes local="yes">awkward/type/UnknownType.h</includes>
<includes local="yes">awkward/Slice.h</includes>
<includes local="yes">awkward/array/UnionArray.h</includes>
<incdepgraph>
<node id="6">
<label>awkward/type/UnionType.h</label>
</node>
<node id="7">
<label>awkward/type/ArrayType.h</label>
</node>
<node id="5">
<label>awkward/cpu-kernels/getitem.h</label>
</node>
<node id="8">
<label>awkward/type/UnknownType.h</label>
</node>
<node id="4">
<label>awkward/cpu-kernels/identities.h</label>
</node>
<node id="1">
<label>src/libawkward/array/UnionArray.cpp</label>
<link refid="UnionArray_8cpp"/>
<childnode refid="2" relation="include">
</childnode>
<childnode refid="3" relation="include">
</childnode>
<childnode refid="4" relation="include">
</childnode>
<childnode refid="5" relation="include">
</childnode>
<childnode refid="6" relation="include">
</childnode>
<childnode refid="7" relation="include">
</childnode>
<childnode refid="8" relation="include">
</childnode>
<childnode refid="9" relation="include">
</childnode>
<childnode refid="10" relation="include">
</childnode>
</node>
<node id="10">
<label>awkward/array/UnionArray.h</label>
</node>
<node id="2">
<label>sstream</label>
</node>
<node id="9">
<label>awkward/Slice.h</label>
</node>
<node id="3">
<label>type_traits</label>
</node>
</incdepgraph>
<innernamespace refid="namespaceawkward">awkward</innernamespace>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="src/libawkward/array/UnionArray.cpp"/>
</compounddef>
</doxygen>
4 changes: 2 additions & 2 deletions awkward1/signatures/cpu-kernels_2util_8cpp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="src/cpu-kernels/util.cpp" line="137" column="7" bodyfile="src/cpu-kernels/util.cpp" bodystart="7" bodyend="14"/>
<location file="src/cpu-kernels/util.cpp" line="294" column="7" bodyfile="src/cpu-kernels/util.cpp" bodystart="7" bodyend="14"/>
</memberdef>
<memberdef kind="function" id="cpu-kernels_2util_8cpp_1a69d244cb4c4419fe8eb9391fc8c42506" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>struct Error</type>
Expand All @@ -57,7 +57,7 @@
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="src/cpu-kernels/util.cpp" line="137" column="7" bodyfile="src/cpu-kernels/util.cpp" bodystart="16" bodyend="23"/>
<location file="src/cpu-kernels/util.cpp" line="294" column="7" bodyfile="src/cpu-kernels/util.cpp" bodystart="16" bodyend="23"/>
</memberdef>
</sectiondef>
<briefdescription>
Expand Down
Loading

0 comments on commit 2efb982

Please sign in to comment.