fix: resolve pyright type errors in Python analysis modules
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -112,9 +112,8 @@ def format_currency(amount: float, currency: _RustCurrency | None = None) -> str
|
||||
>>> format_currency(1234567.89, USD)
|
||||
'$1,234,567.89'
|
||||
"""
|
||||
if currency is None:
|
||||
currency = INR
|
||||
return currency.format(amount)
|
||||
effective: _RustCurrency = currency if currency is not None else INR
|
||||
return effective.format(amount)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -599,7 +598,7 @@ def _build_trades_df(
|
||||
)
|
||||
if len(eb) == 0:
|
||||
return pd.DataFrame(
|
||||
columns=[
|
||||
columns=[ # type: ignore[arg-type]
|
||||
"entry_bar",
|
||||
"exit_bar",
|
||||
"direction",
|
||||
|
||||
@@ -90,7 +90,7 @@ def correlation_matrix(returns: Any) -> Any:
|
||||
arr = returns.values.astype(np.float64, copy=False)
|
||||
arr = np.ascontiguousarray(arr)
|
||||
result = _rust_corr(arr)
|
||||
return pd.DataFrame(result, index=cols, columns=cols)
|
||||
return pd.DataFrame(result, index=cols, columns=cols) # type: ignore[arg-type]
|
||||
except ImportError:
|
||||
pass
|
||||
arr = np.ascontiguousarray(returns, dtype=np.float64)
|
||||
|
||||
Reference in New Issue
Block a user