Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
CLN: Remove typings/ directory
  • Loading branch information
mroeschke committed Jul 28, 2026
commit f4a98cb8e5a3f2ecd4ba927e9631f16ef8d3ddc8
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ MANIFEST.in export-ignore
pixi.lock export-ignore
pixi.toml export-ignore
scripts/** export-ignore
typings export-ignore
web export-ignore
CITATION.cff export-ignore
codecov.yml export-ignore
Expand Down
15 changes: 5 additions & 10 deletions pandas/core/_numba/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def nb_looper(values: np.ndarray, axis: int, *args: Any) -> np.ndarray:

if axis == 1:
buff[0] = res0
for i in numba.prange(1, values.shape[0]):
for i in numba.prange(1, values.shape[0]): # type: ignore[no-untyped-call,attr-defined]
buff[i] = nb_compat_func(values[i], *args)
else:
buff[:, 0] = res0
for j in numba.prange(1, values.shape[1]):
for j in numba.prange(1, values.shape[1]): # type: ignore[no-untyped-call,attr-defined]
buff[:, j] = nb_compat_func(values[:, j], *args)
return buff

Expand Down Expand Up @@ -85,7 +85,7 @@ def column_looper( # pyright: ignore[reportRedeclaration]
) -> tuple[np.ndarray, dict[int, np.ndarray]]:
result = np.empty((values.shape[0], ngroups), dtype=result_dtype)
na_positions = {}
for i in numba.prange(values.shape[0]):
for i in numba.prange(values.shape[0]): # type: ignore[no-untyped-call,attr-defined]
output, na_pos = func(
values[i], result_dtype, labels, ngroups, min_periods, *args
)
Expand All @@ -97,12 +97,7 @@ def column_looper( # pyright: ignore[reportRedeclaration]
else:

@numba.jit(nogil=nogil, parallel=parallel)
# error: Incompatible redefinition (redefinition with type
# "Callable[[ndarray[Any, Any], ndarray[Any, Any], ndarray[Any, Any],
# int, VarArg(Any)], tuple[ndarray[Any, Any], dict[int, ndarray[Any, Any]]]]",
# original type "Callable[[ndarray[Any, Any], ndarray[Any, Any], int, int,
# VarArg(Any)], tuple[ndarray[Any, Any], dict[int, ndarray[Any, Any]]]]")
def column_looper( # type: ignore[misc]
def column_looper(
values: np.ndarray,
start: np.ndarray,
end: np.ndarray,
Expand All @@ -111,7 +106,7 @@ def column_looper( # type: ignore[misc]
) -> tuple[np.ndarray, dict[int, np.ndarray]]:
result = np.empty((values.shape[0], len(start)), dtype=result_dtype)
na_positions = {}
for i in numba.prange(values.shape[0]):
for i in numba.prange(values.shape[0]): # type: ignore[no-untyped-call,attr-defined]
output, na_pos = func(
values[i], result_dtype, start, end, min_periods, *args
)
Expand Down
3 changes: 1 addition & 2 deletions pandas/core/_numba/kernels/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@


@numba.jit(
# error: Any? not callable
numba.boolean(numba.int64[:]), # type: ignore[misc]
numba.boolean(numba.int64[:]),
nogil=True,
parallel=False,
)
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/groupby/numba_.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def group_agg(
num_groups = len(begin)

result = np.empty((num_groups, num_columns))
for i in numba.prange(num_groups):
for i in numba.prange(num_groups): # type: ignore[no-untyped-call,attr-defined]
group_index = index[begin[i] : end[i]]
for j in numba.prange(num_columns):
for j in numba.prange(num_columns): # type: ignore[no-untyped-call,attr-defined]
group = values[begin[i] : end[i], j]
result[i, j] = numba_func(group, group_index, *args)
return result
Expand Down Expand Up @@ -167,9 +167,9 @@ def group_transform(
num_groups = len(begin)

result = np.empty((len(values), num_columns))
for i in numba.prange(num_groups):
for i in numba.prange(num_groups): # type: ignore[no-untyped-call,attr-defined]
group_index = index[begin[i] : end[i]]
for j in numba.prange(num_columns):
for j in numba.prange(num_columns): # type: ignore[no-untyped-call,attr-defined]
group = values[begin[i] : end[i], j]
result[begin[i] : end[i], j] = numba_func(group, group_index, *args)
return result
Expand Down
10 changes: 5 additions & 5 deletions pandas/core/window/numba_.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def roll_apply(
*args: Any,
) -> np.ndarray:
result = np.empty(len(begin))
for i in numba.prange(len(result)):
for i in numba.prange(len(result)): # type: ignore[attr-defined]
start = begin[i]
stop = end[i]
window = values[start:stop]
Expand Down Expand Up @@ -122,7 +122,7 @@ def ewm(
old_wt_factor = 1.0 - alpha
new_wt = 1.0 if adjust else alpha

for i in numba.prange(len(begin)):
for i in numba.prange(len(begin)): # type: ignore[attr-defined]
start = begin[i]
stop = end[i]
window = values[start:stop]
Expand Down Expand Up @@ -217,7 +217,7 @@ def roll_table(
):
result = np.empty((len(begin), values.shape[1]))
min_periods_mask = np.empty(result.shape)
for i in numba.prange(len(result)):
for i in numba.prange(len(result)): # type: ignore[attr-defined]
start = begin[i]
stop = end[i]
window = values[start:stop]
Expand Down Expand Up @@ -249,7 +249,7 @@ def generate_manual_numpy_nan_agg_with_axis(nan_func):
# on platforms without tbb/openmp (GH#40454).
def nan_agg_with_axis(table):
result = np.empty(table.shape[1])
for i in numba.prange(table.shape[1]):
for i in numba.prange(table.shape[1]): # type: ignore[attr-defined]
partition = table[:, i]
result[i] = nan_func(partition)
return result
Expand Down Expand Up @@ -312,7 +312,7 @@ def ewm_table(
cur = values[i]
is_observations = ~np.isnan(cur)
nobs += is_observations.astype(np.int64)
for j in numba.prange(len(cur)):
for j in numba.prange(len(cur)): # type: ignore[attr-defined]
if not np.isnan(weighted[j]):
if is_observations[j] or not ignore_na:
if normalize:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/window/online.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def online_ewma(
cur = values[i]
is_observations = ~np.isnan(cur)
nobs += is_observations.astype(np.int64)
for j in numba.prange(len(cur)):
for j in numba.prange(len(cur)): # type: ignore[attr-defined, no-untyped-call]
if not np.isnan(weighted_avg[j]):
if is_observations[j] or not ignore_na:
# note that len(deltas) = len(vals) - 1 and deltas[i] is to be
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,7 @@ junit_family = "xunit2"

[tool.mypy]
# Import discovery
mypy_path = "typings"
files = ["pandas", "typings"]
files = ["pandas"]
namespace_packages = false
explicit_package_bases = false
ignore_missing_imports = true
Expand Down Expand Up @@ -668,7 +667,7 @@ skip = "pandas/__init__.py"
pythonVersion = "3.11"
typeCheckingMode = "basic"
useLibraryCodeForTypes = false
include = ["pandas", "typings"]
include = ["pandas"]
exclude = ["pandas/tests", "pandas/io/clipboard", "pandas/util/version", "pandas/core/_numba/extensions.py"]
# enable subset of "strict"
reportDuplicateImport = true
Expand Down
1 change: 0 additions & 1 deletion pyright_reportGeneralTypeIssues.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"include":
[
"pandas",
"typings"
],
"exclude":
[
Expand Down
5 changes: 2 additions & 3 deletions scripts/tests/data/deps_minimum.toml
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ markers = [

[tool.mypy]
# Import discovery
mypy_path = "typings"
files = ["pandas", "typings"]
files = ["pandas"]
namespace_packages = false
explicit_package_bases = false
ignore_missing_imports = true
Expand Down Expand Up @@ -352,7 +351,7 @@ skip = "pandas/__init__.py"
[tool.pyright]
pythonVersion = "3.8"
typeCheckingMode = "basic"
include = ["pandas", "typings"]
include = ["pandas"]
exclude = ["pandas/tests", "pandas/io/clipboard", "pandas/util/version"]
# enable subset of "strict"
reportDuplicateImport = true
Expand Down