@@ -3603,23 +3603,23 @@ array_to_tuple_array(PyObject *Py_UNUSED(m), PyObject *a)
3603
3603
}
3604
3604
3605
3605
//------------------------------------------------------------------------------
3606
- // Array2DTuple Iterator
3606
+ // ArrayToTupleIterator
3607
3607
3608
- static PyTypeObject A2DTupleType ;
3608
+ static PyTypeObject ATTType ;
3609
3609
3610
- typedef struct A2DTupleObject {
3610
+ typedef struct ATTObject {
3611
3611
PyObject_HEAD
3612
3612
PyArrayObject * array ;
3613
3613
npy_intp num_rows ;
3614
3614
npy_intp num_cols ;
3615
3615
Py_ssize_t pos ; // current index state, mutated in-place
3616
- } A2DTupleObject ;
3616
+ } ATTObject ;
3617
3617
3618
3618
static PyObject *
3619
- A2DTuple_new (PyArrayObject * array ,
3619
+ ATT_new (PyArrayObject * array ,
3620
3620
npy_intp num_rows ,
3621
3621
npy_intp num_cols ) {
3622
- A2DTupleObject * a2dt = PyObject_New (A2DTupleObject , & A2DTupleType );
3622
+ ATTObject * a2dt = PyObject_New (ATTObject , & ATTType );
3623
3623
if (!a2dt ) {
3624
3624
return NULL ;
3625
3625
}
@@ -3632,19 +3632,19 @@ A2DTuple_new(PyArrayObject* array,
3632
3632
}
3633
3633
3634
3634
static void
3635
- A2DTuple_dealloc ( A2DTupleObject * self ) {
3635
+ ATT_dealloc ( ATTObject * self ) {
3636
3636
Py_DECREF ((PyObject * )self -> array );
3637
3637
PyObject_Del ((PyObject * )self );
3638
3638
}
3639
3639
3640
3640
static PyObject *
3641
- A2DTuple_iter ( A2DTupleObject * self ) {
3641
+ ATT_iter ( ATTObject * self ) {
3642
3642
Py_INCREF (self );
3643
3643
return (PyObject * )self ;
3644
3644
}
3645
3645
3646
3646
static PyObject *
3647
- A2DTuple_iternext ( A2DTupleObject * self ) {
3647
+ ATT_iternext ( ATTObject * self ) {
3648
3648
Py_ssize_t i = self -> pos ;
3649
3649
if (i < self -> num_rows ) {
3650
3650
npy_intp num_cols = self -> num_cols ;
@@ -3686,30 +3686,30 @@ A2DTuple_iternext(A2DTupleObject *self) {
3686
3686
}
3687
3687
3688
3688
// static PyObject *
3689
- // A2DTuple_reversed(A2DTupleObject *self) {
3690
- // return A2DTuple_new (self->bi, !self->reversed);
3689
+ // ATT_reversed(ATTObject *self) {
3690
+ // return ATT_new (self->bi, !self->reversed);
3691
3691
// }
3692
3692
3693
3693
static PyObject *
3694
- A2DTuple_length_hint ( A2DTupleObject * self ) {
3694
+ ATT_length_hint ( ATTObject * self ) {
3695
3695
Py_ssize_t len = Py_MAX (0 , self -> num_rows - self -> pos );
3696
3696
return PyLong_FromSsize_t (len );
3697
3697
}
3698
3698
3699
- static PyMethodDef A2DTuple_methods [] = {
3700
- {"__length_hint__" , (PyCFunction )A2DTuple_length_hint , METH_NOARGS , NULL },
3701
- // {"__reversed__", (PyCFunction)A2DTuple_reversed , METH_NOARGS, NULL},
3699
+ static PyMethodDef ATT_methods [] = {
3700
+ {"__length_hint__" , (PyCFunction )ATT_length_hint , METH_NOARGS , NULL },
3701
+ // {"__reversed__", (PyCFunction)ATT_reversed , METH_NOARGS, NULL},
3702
3702
{NULL },
3703
3703
};
3704
3704
3705
- static PyTypeObject A2DTupleType = {
3705
+ static PyTypeObject ATTType = {
3706
3706
PyVarObject_HEAD_INIT (NULL , 0 )
3707
- .tp_basicsize = sizeof (A2DTupleObject ),
3708
- .tp_dealloc = (destructor ) A2DTuple_dealloc ,
3709
- .tp_iter = (getiterfunc ) A2DTuple_iter ,
3710
- .tp_iternext = (iternextfunc ) A2DTuple_iternext ,
3711
- .tp_methods = A2DTuple_methods ,
3712
- .tp_name = "arraykit.A2DTupleIterator " ,
3707
+ .tp_basicsize = sizeof (ATTObject ),
3708
+ .tp_dealloc = (destructor ) ATT_dealloc ,
3709
+ .tp_iter = (getiterfunc ) ATT_iter ,
3710
+ .tp_iternext = (iternextfunc ) ATT_iternext ,
3711
+ .tp_methods = ATT_methods ,
3712
+ .tp_name = "arraykit.ATTIterator " ,
3713
3713
};
3714
3714
3715
3715
// Given a 2D array, return an iterator of row tuples.
@@ -3729,10 +3729,9 @@ array_to_tuple_iter(PyObject *Py_UNUSED(m), PyObject *a)
3729
3729
if (ndim == 2 ) {
3730
3730
num_cols = PyArray_DIM (array , 1 );
3731
3731
}
3732
- return A2DTuple_new (array , num_rows , num_cols );
3732
+ return ATT_new (array , num_rows , num_cols );
3733
3733
}
3734
3734
3735
-
3736
3735
//------------------------------------------------------------------------------
3737
3736
// type resolution
3738
3737
0 commit comments