17
17
18
18
# * Axis.sequence? geo.seq('A31', 'A38') (equivalent to geo['A31..A38'])
19
19
20
- # * re-implement row_totals/col_totals? or what do we do with them?
20
+ # ? re-implement row_totals/col_totals? or what do we do with them?
21
21
22
22
# * time specific API so that we know if we go for a subclass or not
23
23
@@ -397,7 +397,7 @@ def __getitem__(self, key):
397
397
398
398
def __setitem__ (self , key , value ):
399
399
# we still need to prepare the key instead of letting numpy handle everything so that
400
- # existing (integer)LArray keys are handled correctly (broadcasted using axes names).
400
+ # existing (integer)LArray keys are broadcasted correctly (using axes names).
401
401
self .array .__setitem__ (self ._prepare_key (key , wildcard = True ), value , translate_key = False )
402
402
403
403
@@ -710,7 +710,7 @@ def meta(self, meta):
710
710
"instead of {}" .format (type (meta ).__name__ ))
711
711
self ._meta = meta if isinstance (meta , Metadata ) else Metadata (meta )
712
712
713
- # TODO: rename to posnonzero and implement a label version of nonzero
713
+ # TODO: rename to inonzero and implement a label version of nonzero
714
714
# TODO: implement wildcard argument to avoid producing the combined labels
715
715
def nonzero (self ):
716
716
r"""
@@ -1273,6 +1273,9 @@ def __bool__(self):
1273
1273
# Python 2
1274
1274
__nonzero__ = __bool__
1275
1275
1276
+ # TODO: this should be a thin wrapper around a method in AxisCollection
1277
+ # TODO: either support a list (of axes names) as first argument here (and set_labels)
1278
+ # or don't support that in set_axes
1276
1279
def rename (self , renames = None , to = None , inplace = False , ** kwargs ):
1277
1280
"""Renames axes of the array.
1278
1281
@@ -8379,6 +8382,7 @@ def stack(elements=None, axis=None, title=None, meta=None, **kwargs):
8379
8382
axis = Axis (axis )
8380
8383
if elements is None :
8381
8384
if not isinstance (axis , Axis ) and sys .version_info [:2 ] < (3 , 6 ):
8385
+ # XXX: this should probably be a warning, not an error
8382
8386
raise TypeError ("axis argument should provide label order when using keyword arguments on Python < 3.6" )
8383
8387
elements = kwargs .items ()
8384
8388
elif kwargs :
@@ -8394,6 +8398,8 @@ def stack(elements=None, axis=None, title=None, meta=None, **kwargs):
8394
8398
axis = elements .axes [axis ]
8395
8399
values = [elements [k ] for k in axis ]
8396
8400
elif isinstance (elements , dict ):
8401
+ # TODO: support having no Axis object for Python3.7 (without error or warning)
8402
+ # XXX: we probably want to support this with a warning on Python < 3.7
8397
8403
assert isinstance (axis , Axis )
8398
8404
values = [elements [v ] for v in axis .labels ]
8399
8405
elif isinstance (elements , Iterable ):
0 commit comments