Skip to content

Commit ceaf3f3

Browse files
committed
fix(ci): resolve institutional mypy fractures and unused overrides
1 parent be7a32b commit ceaf3f3

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,3 @@ strict = true
4646
python_version = "3.12"
4747
warn_return_any = true
4848
warn_unused_configs = true
49-
50-
[[tool.mypy.overrides]]
51-
module = "tests.*"
52-
ignore_errors = true

src/nrc/math/qrt.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,20 @@ def qrt_damping(
4949
return (term1 * term2) + term3
5050

5151
# PyTorch Path (Supports Grad Tensors)
52-
import torch
52+
if torch is not None:
53+
# Ensure x is a tensor for calling methods
54+
x_t = torch.as_tensor(x)
5355

54-
# Ensure x is a tensor for calling methods
55-
x_t = torch.as_tensor(x)
56+
term1_t = (x_t * freq_sin).sin()
57+
term2_t = (-(x_t**2) / PHI_FLOAT).exp()
58+
term3_t = (x_t * freq_cos).cos()
59+
return (term1_t * term2_t) + term3_t
5660

57-
term1_t = (x_t * freq_sin).sin()
58-
term2_t = (-(x_t**2) / PHI_FLOAT).exp()
59-
term3_t = (x_t * freq_cos).cos()
60-
return (term1_t * term2_t) + term3_t
61+
raise ImportError("torch is required for tensor operations but not installed.")
6162

6263

6364
def execute_qrt_damping_tensor(
6465
x: Union[np.ndarray, "torch.Tensor"],
6566
) -> Union[np.ndarray, "torch.Tensor"]:
6667
"""Institutional entry-point for QRT manifold damping (Torch/NumPy)."""
67-
return qrt_damping(x)
68+
return qrt_damping(x) # type: ignore[return-value]

0 commit comments

Comments
 (0)