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)
|
>>> format_currency(1234567.89, USD)
|
||||||
'$1,234,567.89'
|
'$1,234,567.89'
|
||||||
"""
|
"""
|
||||||
if currency is None:
|
effective: _RustCurrency = currency if currency is not None else INR
|
||||||
currency = INR
|
return effective.format(amount)
|
||||||
return currency.format(amount)
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -599,7 +598,7 @@ def _build_trades_df(
|
|||||||
)
|
)
|
||||||
if len(eb) == 0:
|
if len(eb) == 0:
|
||||||
return pd.DataFrame(
|
return pd.DataFrame(
|
||||||
columns=[
|
columns=[ # type: ignore[arg-type]
|
||||||
"entry_bar",
|
"entry_bar",
|
||||||
"exit_bar",
|
"exit_bar",
|
||||||
"direction",
|
"direction",
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ def correlation_matrix(returns: Any) -> Any:
|
|||||||
arr = returns.values.astype(np.float64, copy=False)
|
arr = returns.values.astype(np.float64, copy=False)
|
||||||
arr = np.ascontiguousarray(arr)
|
arr = np.ascontiguousarray(arr)
|
||||||
result = _rust_corr(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:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
arr = np.ascontiguousarray(returns, dtype=np.float64)
|
arr = np.ascontiguousarray(returns, dtype=np.float64)
|
||||||
|
|||||||
Reference in New Issue
Block a user