diff --git a/awkward/array/base.py b/awkward/array/base.py index 532243e9..fed473f9 100644 --- a/awkward/array/base.py +++ b/awkward/array/base.py @@ -35,6 +35,10 @@ import awkward.util class AwkwardArray(awkward.util.NDArrayOperatorsMixin): + """ + AwkwardArray: abstract base class + """ + def __array__(self, *args, **kwargs): # hitting this function is usually undesirable; uncomment to search for performance bugs # raise Exception("{0} {1}".format(args, kwargs)) @@ -187,6 +191,10 @@ def minby(self, function): return self[function(*args, **kwargs).argmin()] class AwkwardArrayWithContent(AwkwardArray): + """ + AwkwardArrayWithContent: abstract base class + """ + def __setitem__(self, where, what): if isinstance(where, awkward.util.string): self._content[where] = what diff --git a/awkward/array/chunked.py b/awkward/array/chunked.py index fecde3e3..9fa37caf 100644 --- a/awkward/array/chunked.py +++ b/awkward/array/chunked.py @@ -34,6 +34,10 @@ import awkward.util class ChunkedArray(awkward.array.base.AwkwardArray): + """ + ChunkedArray + """ + def __init__(self, chunks, counts=[]): self.chunks = chunks self.counts = counts @@ -610,6 +614,10 @@ def pandas(self): raise NotImplementedError class AppendableArray(ChunkedArray): + """ + AppendableArray + """ + def __init__(self, chunkshape, dtype, chunks=[]): self.chunkshape = chunkshape self.dtype = dtype diff --git a/awkward/array/indexed.py b/awkward/array/indexed.py index efa8f425..a90702fa 100644 --- a/awkward/array/indexed.py +++ b/awkward/array/indexed.py @@ -46,6 +46,10 @@ def invert(permutation): return out class IndexedArray(awkward.array.base.AwkwardArrayWithContent): + """ + IndexedArray + """ + def __init__(self, index, content): self.index = index self.content = content @@ -204,6 +208,10 @@ def pandas(self): return self._content[self._index].pandas() class ByteIndexedArray(IndexedArray): + """ + ByteIndexedArray + """ + def __init__(self, index, content, dtype): super(ByteIndexedArray, self).__init__(index, content) self.dtype = dtype @@ -363,6 +371,10 @@ def pandas(self): raise NotImplementedError class SparseArray(awkward.array.base.AwkwardArrayWithContent): + """ + SparseArray + """ + def __init__(self, length, index, content, default=None): self.length = length self.index = index diff --git a/awkward/array/jagged.py b/awkward/array/jagged.py index b08f1e4b..888adce8 100644 --- a/awkward/array/jagged.py +++ b/awkward/array/jagged.py @@ -102,6 +102,10 @@ def uniques2offsetsparents(uniques): return offsets, parents class JaggedArray(awkward.array.base.AwkwardArrayWithContent): + """ + JaggedArray + """ + def __init__(self, starts, stops, content): self.starts = starts self.stops = stops @@ -1089,6 +1093,10 @@ def pandas(self): return out class ByteJaggedArray(JaggedArray): + """ + ByteJaggedArray + """ + def __init__(self, starts, stops, content, subdtype): super(ByteJaggedArray, self).__init__(starts, stops, content) self.subdtype = subdtype diff --git a/awkward/array/masked.py b/awkward/array/masked.py index 5d225d05..e470100b 100644 --- a/awkward/array/masked.py +++ b/awkward/array/masked.py @@ -36,6 +36,10 @@ import awkward.util class MaskedArray(awkward.array.base.AwkwardArrayWithContent): + """ + MaskedArray + """ + ### WTF were the designers of numpy.ma thinking? # @staticmethod # def is_masked(x): @@ -278,6 +282,10 @@ def pandas(self): raise NotImplementedError class BitMaskedArray(MaskedArray): + """ + BitMaskedArray + """ + def __init__(self, mask, content, maskedwhen=True, lsborder=False): super(BitMaskedArray, self).__init__(mask, content, maskedwhen=maskedwhen) self.lsborder = lsborder @@ -505,6 +513,10 @@ def pandas(self): raise NotImplementedError class IndexedMaskedArray(MaskedArray): + """ + IndexedMaskedArray + """ + def __init__(self, mask, content, maskedwhen=-1): super(IndexedMaskedArray, self).__init__(mask, content, maskedwhen=maskedwhen) self._isvalid = False diff --git a/awkward/array/objects.py b/awkward/array/objects.py index 53566883..31fd10ce 100644 --- a/awkward/array/objects.py +++ b/awkward/array/objects.py @@ -36,6 +36,10 @@ import awkward.util class Methods(object): + """ + Methods: abstract mix-in + """ + @staticmethod def mixin(methods, awkwardtype): assert issubclass(methods, Methods) @@ -55,6 +59,10 @@ def maybemixin(sample, awkwardtype): return awkwardtype class ObjectArray(awkward.array.base.AwkwardArrayWithContent): + """ + ObjectArray + """ + def __init__(self, content, generator, args=(), kwargs={}): self.content = content self.generator = generator diff --git a/awkward/array/table.py b/awkward/array/table.py index 5e4e690d..753accec 100644 --- a/awkward/array/table.py +++ b/awkward/array/table.py @@ -35,9 +35,17 @@ import awkward.util class Table(awkward.array.base.AwkwardArray): + """ + Table + """ + ##################### class Row class Row(object): + """ + Table.Row + """ + __slots__ = ["_table", "_index"] def __init__(self, table, index): diff --git a/awkward/array/union.py b/awkward/array/union.py index e4c4c735..0be9f873 100644 --- a/awkward/array/union.py +++ b/awkward/array/union.py @@ -33,6 +33,10 @@ import awkward.util class UnionArray(awkward.array.base.AwkwardArray): + """ + UnionArray + """ + def __init__(self, tags, index, contents): self.tags = tags self.index = index diff --git a/awkward/array/virtual.py b/awkward/array/virtual.py index 38be4711..78febb5e 100644 --- a/awkward/array/virtual.py +++ b/awkward/array/virtual.py @@ -36,6 +36,10 @@ import awkward.util class VirtualArray(awkward.array.base.AwkwardArray): + """ + VirtualArray + """ + class TransientKey(object): def __init__(self, id): self._id = id diff --git a/awkward/derived/strings.py b/awkward/derived/strings.py index d3a0c276..ab1798c1 100644 --- a/awkward/derived/strings.py +++ b/awkward/derived/strings.py @@ -35,6 +35,10 @@ import awkward.array.objects class StringMethods(object): + """ + StringMethods + """ + def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): if method != "__call__": raise NotImplemented @@ -90,6 +94,10 @@ def tostring(x, decoder): return decoder(x, errors="replace")[0] class StringArray(StringMethods, awkward.array.objects.ObjectArray): + """ + StringArray + """ + def __init__(self, starts, stops, content, encoding="utf-8"): self._content = awkward.array.jagged.ByteJaggedArray(starts, stops, content, awkward.util.CHARTYPE) self._generator = tostring