Skip to content
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

Disallow type error without code #1456

Merged
merged 1 commit into from
Oct 31, 2024
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
2 changes: 1 addition & 1 deletion pyproj/crs/coordinate_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def __new__(
f"+k_0={scale_factor_natural_origin}"
)
return cls.from_json(
CRS(proj_string).coordinate_operation.to_json() # type: ignore
CRS(proj_string).coordinate_operation.to_json() # type: ignore[union-attr]
)


Expand Down
2 changes: 1 addition & 1 deletion pyproj/crs/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def __init__(self, projparams: Any | None = None, **kwargs) -> None:
elif isinstance(projparams, (list, tuple)) and len(projparams) == 2:
projstring = _prepare_from_authority(*projparams)
elif hasattr(projparams, "to_wkt"):
projstring = projparams.to_wkt() # type: ignore
projstring = projparams.to_wkt()
else:
raise CRSError(f"Invalid CRS input: {projparams!r}")

Expand Down
4 changes: 2 additions & 2 deletions pyproj/geod.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ def geometry_length(self, geometry, radians: bool = False) -> float:
The total geodesic length of the geometry (meters).
"""
try:
return self.line_length(*geometry.xy, radians=radians) # type: ignore
return self.line_length(*geometry.xy, radians=radians) # type: ignore[misc]
except (AttributeError, NotImplementedError):
pass
if hasattr(geometry, "exterior"):
Expand Down Expand Up @@ -1074,7 +1074,7 @@ def geometry_area_perimeter(
The geodesic area (meters^2) and perimeter (meters) of the polygon.
"""
try:
return self.polygon_area_perimeter( # type: ignore
return self.polygon_area_perimeter( # type: ignore[misc]
*geometry.xy, radians=radians
)
except (AttributeError, NotImplementedError):
Expand Down
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ select = [
"RUF",
# flake8-bandit: exec-builtin
"S102",
# numpy-legacy-random
"NPY002",
# NumPy-specific rules
"NPY",
# Perflint
"PERF",
# flynt
Expand All @@ -123,7 +123,7 @@ select = [
# flake8-slots
"SLOT",
# flake8-raise
"RSE"
"RSE",
]

ignore = [
Expand All @@ -146,10 +146,6 @@ ignore = [
### TODO: Enable gradually
# Rename unused
"B007",
# Use specific rule codes when ignoring type issues
"PGH003",
# unconventional-import-alias
"ICN001",
# Move standard library import into a type-checking block
"TCH003",
# Consider f-string instead of string join
Expand All @@ -158,3 +154,9 @@ ignore = [
"PERF401"

]

[tool.mypy]
files = ["pyproj"]
python_version = "3.10"
ignore_errors = false
enable_error_code = "ignore-without-code"