Skip to content

Commit

Permalink
redo array table of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermeleobas committed Mar 15, 2022
1 parent 6f1285c commit 3cd9c85
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 70 deletions.
59 changes: 4 additions & 55 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,58 +70,7 @@ The set of types below are only materialize inside the OmniSciDB SQL Engine. Thu
one cannot create and use them inside the REPL, for instance.


.. raw:: html

<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%">
<col style="width: 90%">
</colgroup>
<tbody>
<tr class="row-odd">
<td>
<p><a class="reference internal" href="omnisci/array.html" title="rbc.omnisci_backend.Array">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">rbc.omnisci_backend.Array</span>
</code></a></p>
</td>
<td><p></p></td>
</tr>
<tr class="row-even">
<td>
<p><a class="reference internal" href="omnisci/bytes.html" title="rbc.omnisci_backend.Bytes">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">rbc.omnisci_backend.Bytes</span>
</code></a></p>
</td>
<td><p></p></td>
</tr>
<tr class="row-odd">
<td>
<p><a class="reference internal" href="omnisci/column.html" title="rbc.omnisci_backend.Column">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">rbc.omnisci_backend.Column</span>
</code></a></p>
</td>
<td><p></p></td>
</tr>
<tr class="row-even">
<td>
<p><a class="reference internal" href="omnisci/outputcolumn.html" title="rbc.omnisci_backend.OutputColumn">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">rbc.omnisci_backend.OutputColumn</span>
</code></a></p>
</td>
<td><p></p></td>
</tr>
<tr class="row-odd">
<td>
<p><a class="reference internal" href="omnisci/columnlist.html" title="rbc.omnisci_backend.ColumnList">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">rbc.omnisci_backend.ColumnList</span>
</code></a></p>
</td>
<td><p></p></td>
</tr>
</tbody>
</table>
.. autosummary::
:toctree: generated/

rbc.omnisci_backend.Array
100 changes: 99 additions & 1 deletion rbc/omnisci_backend/omnisci_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
OmnisciBufferType,
omnisci_buffer_constructor)
from numba.core import extending, types
from typing import Union, TypeVar


T = TypeVar('T')


class OmnisciArrayType(OmnisciBufferType):
Expand All @@ -31,7 +35,101 @@ def buffer_extra_members(self):


class Array(Buffer):
pass
"""
In HeavyDB, an Array of type `T` is represented as follows:
.. code-block:: C
{
T* data,
int64_t size,
int8_t is_null
}
Array is a contiguous block of memory that behaves like a python list.
Example
.. code-block:: python
from numba import types
from rbc.omnisci_backend import Array
@omnisci('int64[](int64)')
def create_and_fill_array(size):
arr = Array(size, types.int64)
for i in range(size):
a[i] = i
return a
"""

def __init__(self, size: int, dtype: Union[str, types.Type]) -> None:
pass

def is_null(self) -> bool:
pass

@property
def dtype(self):
"""
Data type of the array elements.
"""
pass

@property
def device(self):
"""
❌ Not implemented
Hardware device the array data resides on.
"""
pass

@property
def mT(self):
"""
❌ Not implemented
Transpose of a amtrix (or a stack of matrices).
"""
pass

@property
def ndim(self):
"""
❌ Not implemented
Number of array dimensions (axes).
"""
pass

@property
def shape(self):
"""
❌ Not implemented
Array dimensions.
"""
pass

@property
def size(self):
"""
❌ Not implemented
Number of elements in an array.
"""
pass

@property
def T(self):
"""
❌ Not implemented
Transpose of the array.
"""
pass


@extending.lower_builtin(Array, types.Integer, types.StringLiteral)
Expand Down
7 changes: 0 additions & 7 deletions rbc/stdlib/array_attributes.py

This file was deleted.

7 changes: 0 additions & 7 deletions rbc/stdlib/array_methods.py

This file was deleted.

0 comments on commit 3cd9c85

Please sign in to comment.