Skip to content

Commit 31f52cf

Browse files
CLN: rename do_integrity_check to verify_integrity in internals (#39989)
1 parent d527b88 commit 31f52cf

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

pandas/core/internals/array_manager.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class ArrayManager(DataManager):
7979
----------
8080
arrays : Sequence of arrays
8181
axes : Sequence of Index
82-
do_integrity_check : bool, default True
82+
verify_integrity : bool, default True
8383
8484
"""
8585

@@ -95,14 +95,14 @@ def __init__(
9595
self,
9696
arrays: List[Union[np.ndarray, ExtensionArray]],
9797
axes: List[Index],
98-
do_integrity_check: bool = True,
98+
verify_integrity: bool = True,
9999
):
100100
# Note: we are storing the axes in "_axes" in the (row, columns) order
101101
# which contrasts the order how it is stored in BlockManager
102102
self._axes = axes
103103
self.arrays = arrays
104104

105-
if do_integrity_check:
105+
if verify_integrity:
106106
self._axes = [ensure_index(ax) for ax in axes]
107107
self._verify_integrity()
108108

@@ -607,7 +607,7 @@ def get_slice(self, slobj: slice, axis: int = 0) -> ArrayManager:
607607
new_axes = list(self._axes)
608608
new_axes[axis] = new_axes[axis][slobj]
609609

610-
return type(self)(arrays, new_axes, do_integrity_check=False)
610+
return type(self)(arrays, new_axes, verify_integrity=False)
611611

612612
def fast_xs(self, loc: int) -> ArrayLike:
613613
"""
@@ -831,7 +831,7 @@ def _reindex_indexer(
831831
new_axes = list(self._axes)
832832
new_axes[axis] = new_axis
833833

834-
return type(self)(new_arrays, new_axes, do_integrity_check=False)
834+
return type(self)(new_arrays, new_axes, verify_integrity=False)
835835

836836
def take(self, indexer, axis: int = 1, verify: bool = True, convert: bool = True):
837837
"""
@@ -909,7 +909,7 @@ def unstack(self, unstacker, fill_value) -> ArrayManager:
909909
new_columns = unstacker.get_new_columns(self._axes[1])
910910
new_axes = [new_index, new_columns]
911911

912-
return type(self)(new_arrays, new_axes, do_integrity_check=False)
912+
return type(self)(new_arrays, new_axes, verify_integrity=False)
913913

914914
# TODO
915915
# equals

pandas/core/internals/concat.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ def concatenate_array_managers(
8080
concat_compat([mgrs[i].arrays[j] for i in range(len(mgrs))])
8181
for j in range(len(mgrs[0].arrays))
8282
]
83-
return ArrayManager(arrays, [axes[1], axes[0]], do_integrity_check=False)
83+
return ArrayManager(arrays, [axes[1], axes[0]], verify_integrity=False)
8484
else:
8585
# concatting along the columns -> combine reindexed arrays in a single manager
8686
assert concat_axis == 0
8787
arrays = list(itertools.chain.from_iterable([mgr.arrays for mgr in mgrs]))
88-
return ArrayManager(arrays, [axes[1], axes[0]], do_integrity_check=False)
88+
return ArrayManager(arrays, [axes[1], axes[0]], verify_integrity=False)
8989

9090

9191
def concatenate_managers(

pandas/core/internals/managers.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class BlockManager(DataManager):
128128
----------
129129
blocks: Sequence of Block
130130
axes: Sequence of Index
131-
do_integrity_check: bool, default True
131+
verify_integrity: bool, default True
132132
133133
Notes
134134
-----
@@ -151,7 +151,7 @@ def __init__(
151151
self,
152152
blocks: Sequence[Block],
153153
axes: Sequence[Index],
154-
do_integrity_check: bool = True,
154+
verify_integrity: bool = True,
155155
):
156156
self.axes = [ensure_index(ax) for ax in axes]
157157
self.blocks: Tuple[Block, ...] = tuple(blocks)
@@ -163,7 +163,7 @@ def __init__(
163163
f"number of axes ({self.ndim})"
164164
)
165165

166-
if do_integrity_check:
166+
if verify_integrity:
167167
self._verify_integrity()
168168

169169
# Populate known_consolidate, blknos, and blklocs lazily
@@ -176,7 +176,7 @@ def from_blocks(cls, blocks: List[Block], axes: List[Index]):
176176
"""
177177
Constructor for BlockManager and SingleBlockManager with same signature.
178178
"""
179-
return cls(blocks, axes, do_integrity_check=False)
179+
return cls(blocks, axes, verify_integrity=False)
180180

181181
@property
182182
def blknos(self):
@@ -760,7 +760,7 @@ def get_slice(self, slobj: slice, axis: int = 0) -> BlockManager:
760760
new_axes = list(self.axes)
761761
new_axes[axis] = new_axes[axis][slobj]
762762

763-
bm = type(self)(new_blocks, new_axes, do_integrity_check=False)
763+
bm = type(self)(new_blocks, new_axes, verify_integrity=False)
764764
return bm
765765

766766
@property
@@ -1499,7 +1499,7 @@ def __init__(
14991499
self,
15001500
block: Block,
15011501
axis: Index,
1502-
do_integrity_check: bool = False,
1502+
verify_integrity: bool = False,
15031503
fastpath=lib.no_default,
15041504
):
15051505
assert isinstance(block, Block), type(block)
@@ -1523,7 +1523,7 @@ def from_blocks(cls, blocks: List[Block], axes: List[Index]) -> SingleBlockManag
15231523
"""
15241524
assert len(blocks) == 1
15251525
assert len(axes) == 1
1526-
return cls(blocks[0], axes[0], do_integrity_check=False)
1526+
return cls(blocks[0], axes[0], verify_integrity=False)
15271527

15281528
@classmethod
15291529
def from_array(cls, array: ArrayLike, index: Index) -> SingleBlockManager:

pandas/core/internals/ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def operate_blockwise(
8080
# assert len(slocs) == nlocs, (len(slocs), nlocs)
8181
# assert slocs == set(range(nlocs)), slocs
8282

83-
new_mgr = type(right)(res_blks, axes=right.axes, do_integrity_check=False)
83+
new_mgr = type(right)(res_blks, axes=right.axes, verify_integrity=False)
8484
return new_mgr
8585

8686

0 commit comments

Comments
 (0)