8000 Remove recarray_fromrecords · astropy/astropy@7468364 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7468364

Browse files
committed
Remove recarray_fromrecords
1 parent c55980e commit 7468364

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ astropy.table
284284
- Changed default table configuration setting ``replace_warnings`` from
285285
``['slice']`` to ``[]``. This removes the default warning when replacing
286286
a table column that is a slice of another column. [#9144]
287+
- Removed the non-public method ``astropy.table.np_utils.recarray_fromrecords``.
288+
[#9165]
287289

288290
astropy.tests
289291
^^^^^^^^^^^^^

astropy/table/np_utils.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -171,26 +171,3 @@ def fix_column_name(val):
171171
raise
172172

173173
return val
174-
175-
176-
def recarray_fromrecords(rec_list):
177-
"""
178-
Partial replacement for `~numpy.core.records.fromrecords` which includes
179-
a workaround for the bug with unicode arrays described at:
180-
https://github.com/astropy/astropy/issues/3052
181-
182-
This should not serve as a full replacement for the original function;
183-
this only does enough to fulfill the needs of the table module.
184-
"""
185-
186-
# Note: This is just copying what Numpy does for converting arbitrary rows
187-
# to column arrays in the recarray module; it could be there is a better
188-
# way
189-
nfields = len(rec_list[0])
190-
obj = np.array(rec_list, dtype=object)
191-
array_list = [np.array(obj[..., i].tolist()) for i in range(nfields)]
192-
formats = []
193-
for obj in array_list:
194-
formats.append(obj.dtype.str)
195-
formats = ','.join(formats)
196-
return np.rec.fromarrays(array_list, formats=formats)

astropy/table/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from .column import (BaseColumn, Column, MaskedColumn, _auto_names, FalseArray,
2727
col_copy)
2828
from .row import Row
29-
from .np_utils import fix_column_name, recarray_fromrecords
29+
from .np_utils import fix_column_name
3030
from .info import TableInfo
3131
from .index import Index, _IndexModeContext, get_index
3232
from .connect import TableRead, TableWrite

0 commit comments

Comments
 (0)
0