Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit c660311

Browse files
committed
module renaming
1 parent 12021b8 commit c660311

5 files changed

Lines changed: 24 additions & 27 deletions

File tree

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
arraymap
33
============
44

5-
6-
<br>
7-
85
`arraymap` is a Python package containing high-performance autoincremented
96
integer-valued mappings.
107

automap.c renamed to arraymap.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ static PyTypeObject FAMIType = {
504504
.tp_iter = (getiterfunc) fami_iter,
505505
.tp_iternext = (iternextfunc) fami_iternext,
506506
.tp_methods = fami_methods,
507-
.tp_name = "automap.FrozenAutoMapIterator",
507+
.tp_name = "arraymap.FrozenAutoMapIterator",
508508
};
509509

510510

@@ -677,7 +677,7 @@ static PyTypeObject FAMVType = {
677677
.tp_dealloc = (destructor) famv_dealloc,
678678
.tp_iter = (getiterfunc) famv_fami_new,
679679
.tp_methods = famv_methods,
680-
.tp_name = "automap.FrozenAutoMapView",
680+
.tp_name = "arraymap.FrozenAutoMapView",
681681
.tp_richcompare = (richcmpfunc) famv_richcompare,
682682
};
683683

@@ -2115,7 +2115,7 @@ static PyTypeObject FAMType = {
21152115
.tp_hash = (hashfunc) fam_hash,
21162116
.tp_iter = (getiterfunc) fam_iter,
21172117
.tp_methods = fam_methods,
2118-
.tp_name = "automap.FrozenAutoMap",
2118+
.tp_name = "arraymap.FrozenAutoMap",
21192119
.tp_new = fam_new,
21202120
.tp_init = fam_init,
21212121
.tp_repr = (reprfunc) fam_repr,
@@ -2180,50 +2180,50 @@ static PyTypeObject AMType = {
21802180
.tp_base = &FAMType,
21812181
.tp_doc = "A grow-only autoincremented integer-valued mapping.",
21822182
.tp_methods = am_methods,
2183-
.tp_name = "automap.AutoMap",
2183+
.tp_name = "arraymap.AutoMap",
21842184
.tp_richcompare = (richcmpfunc) fam_richcompare,
21852185
};
21862186

21872187

21882188
//------------------------------------------------------------------------------
21892189
// module definition
21902190

2191-
static struct PyModuleDef automap_module = {
2191+
static struct PyModuleDef arraymap_module = {
21922192
.m_base = PyModuleDef_HEAD_INIT,
2193-
.m_doc = "High-performance autoincremented integer-valued mappings.",
2194-
.m_name = "automap",
2193+
.m_doc = "Dictionary-like lookup from NumPy array values to integer positions",
2194+
.m_name = "arraymap",
21952195
.m_size = -1,
21962196
};
21972197

21982198

21992199
PyObject *
2200-
PyInit_automap(void)
2200+
PyInit_arraymap(void)
22012201
{
22022202
import_array();
22032203

22042204
NonUniqueError = PyErr_NewExceptionWithDoc(
2205-
"automap.NonUniqueError",
2205+
"arraymap.NonUniqueError",
22062206
"ValueError for non-unique values.",
22072207
PyExc_ValueError,
22082208
NULL);
22092209
if (NonUniqueError == NULL) {
22102210
return NULL;
22112211
}
22122212

2213-
PyObject *automap = PyModule_Create(&automap_module);
2213+
PyObject *arraymap = PyModule_Create(&arraymap_module);
22142214
if (
2215-
!automap
2215+
!arraymap
22162216
|| PyType_Ready(&AMType)
22172217
|| PyType_Ready(&FAMIType)
22182218
|| PyType_Ready(&FAMVType)
22192219
|| PyType_Ready(&FAMType)
2220-
|| PyModule_AddObject(automap, "AutoMap", (PyObject *)&AMType)
2221-
|| PyModule_AddObject(automap, "FrozenAutoMap", (PyObject *)&FAMType)
2222-
|| PyModule_AddObject(automap, "NonUniqueError", NonUniqueError)
2220+
|| PyModule_AddObject(arraymap, "AutoMap", (PyObject *)&AMType)
2221+
|| PyModule_AddObject(arraymap, "FrozenAutoMap", (PyObject *)&FAMType)
2222+
|| PyModule_AddObject(arraymap, "NonUniqueError", NonUniqueError)
22232223
) {
2224-
Py_XDECREF(automap);
2224+
Py_XDECREF(arraymap);
22252225
return NULL;
22262226
}
2227-
return automap;
2227+
return arraymap;
22282228
}
22292229

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def get_ext_dir(*components: tp.Iterable[str]) -> tp.Sequence[str]:
1717

1818

1919
extension = setuptools.Extension(
20-
"automap",
21-
["automap.c"],
20+
"arraymap",
21+
["arraymap.c"],
2222
include_dirs=get_ext_dir("numpy", "core", "include"),
2323
library_dirs=get_ext_dir("numpy", "core", "lib"),
2424
libraries=["npymath"], # not including mlib at this time

test_automap_property.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
import pytest
1515

16-
from automap import AutoMap
17-
from automap import FrozenAutoMap
18-
from automap import NonUniqueError
16+
from arraymap import AutoMap
17+
from arraymap import FrozenAutoMap
18+
from arraymap import NonUniqueError
1919

2020
Keys = typing.Set[typing.Hashable]
2121

test_automap_unit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import sys
55
import numpy as np
66

7-
from automap import AutoMap
8-
from automap import FrozenAutoMap
9-
from automap import NonUniqueError
7+
from arraymap import AutoMap
8+
from arraymap import FrozenAutoMap
9+
from arraymap import NonUniqueError
1010

1111

1212
def test_am_extend():

0 commit comments

Comments
 (0)