Skip to content

CLN: rename do_integrity_check to verify_integrity in internals #39989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pandas/core/internals/array_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ArrayManager(DataManager):
----------
arrays : Sequence of arrays
axes : Sequence of Index
do_integrity_check : bool, default True
verify_integrity : bool, default True

"""

Expand All @@ -95,14 +95,14 @@ def __init__(
self,
arrays: List[Union[np.ndarray, ExtensionArray]],
axes: List[Index],
do_integrity_check: bool = True,
verify_integrity: bool = True,
):
# Note: we are storing the axes in "_axes" in the (row, columns) order
# which contrasts the order how it is stored in BlockManager
self._axes = axes
self.arrays = arrays

if do_integrity_check:
if verify_integrity:
self._axes = [ensure_index(ax) for ax in axes]
self._verify_integrity()

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

return type(self)(arrays, new_axes, do_integrity_check=False)
return type(self)(arrays, new_axes, verify_integrity=False)

def fast_xs(self, loc: int) -> ArrayLike:
"""
Expand Down Expand Up @@ -831,7 +831,7 @@ def _reindex_indexer(
new_axes = list(self._axes)
new_axes[axis] = new_axis

return type(self)(new_arrays, new_axes, do_integrity_check=False)
return type(self)(new_arrays, new_axes, verify_integrity=False)

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

return type(self)(new_arrays, new_axes, do_integrity_check=False)
return type(self)(new_arrays, new_axes, verify_integrity=False)

# TODO
# equals
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/internals/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ def concatenate_array_managers(
concat_compat([mgrs[i].arrays[j] for i in range(len(mgrs))])
for j in range(len(mgrs[0].arrays))
]
return ArrayManager(arrays, [axes[1], axes[0]], do_integrity_check=False)
return ArrayManager(arrays, [axes[1], axes[0]], verify_integrity=False)
else:
# concatting along the columns -> combine reindexed arrays in a single manager
assert concat_axis == 0
arrays = list(itertools.chain.from_iterable([mgr.arrays for mgr in mgrs]))
return ArrayManager(arrays, [axes[1], axes[0]], do_integrity_check=False)
return ArrayManager(arrays, [axes[1], axes[0]], verify_integrity=False)


def concatenate_managers(
Expand Down
14 changes: 7 additions & 7 deletions pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class BlockManager(DataManager):
----------
blocks: Sequence of Block
axes: Sequence of Index
do_integrity_check: bool, default True
verify_integrity: bool, default True

Notes
-----
Expand All @@ -151,7 +151,7 @@ def __init__(
self,
blocks: Sequence[Block],
axes: Sequence[Index],
do_integrity_check: bool = True,
verify_integrity: bool = True,
):
self.axes = [ensure_index(ax) for ax in axes]
self.blocks: Tuple[Block, ...] = tuple(blocks)
Expand All @@ -163,7 +163,7 @@ def __init__(
f"number of axes ({self.ndim})"
)

if do_integrity_check:
if verify_integrity:
self._verify_integrity()

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

@property
def blknos(self):
Expand Down Expand Up @@ -760,7 +760,7 @@ def get_slice(self, slobj: slice, axis: int = 0) -> BlockManager:
new_axes = list(self.axes)
new_axes[axis] = new_axes[axis][slobj]

bm = type(self)(new_blocks, new_axes, do_integrity_check=False)
bm = type(self)(new_blocks, new_axes, verify_integrity=False)
return bm

@property
Expand Down Expand Up @@ -1499,7 +1499,7 @@ def __init__(
self,
block: Block,
axis: Index,
do_integrity_check: bool = False,
verify_integrity: bool = False,
fastpath=lib.no_default,
):
assert isinstance(block, Block), type(block)
Expand All @@ -1523,7 +1523,7 @@ def from_blocks(cls, blocks: List[Block], axes: List[Index]) -> SingleBlockManag
"""
assert len(blocks) == 1
assert len(axes) == 1
return cls(blocks[0], axes[0], do_integrity_check=False)
return cls(blocks[0], axes[0], verify_integrity=False)

@classmethod
def from_array(cls, array: ArrayLike, index: Index) -> SingleBlockManager:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def operate_blockwise(
# assert len(slocs) == nlocs, (len(slocs), nlocs)
# assert slocs == set(range(nlocs)), slocs

new_mgr = type(right)(res_blks, axes=right.axes, do_integrity_check=False)
new_mgr = type(right)(res_blks, axes=right.axes, verify_integrity=False)
return new_mgr


Expand Down