Skip to content
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 python/rateslib/_spec_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _map_true_false(v: str) -> bool | None:
# TODO (low): clean this up when setting a minimum pandas version at 2.1.0
df[df["dtype"] == "bool"] = df[df["dtype"] == "bool"].map(_map_true_false)
else:
df[df["dtype"] == "bool"] = df[df["dtype"] == "bool"].applymap(_map_true_false) # type: ignore[operator]
df[df["dtype"] == "bool"] = df[df["dtype"] == "bool"].applymap(_map_true_false) # type: ignore[operator, index]
return df

path = "data/__instrument_spec.csv"
Expand Down
2 changes: 1 addition & 1 deletion python/rateslib/data/fixings.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ def __init__(
self._accrual_end = accrual_end
self._fixing_method = _get_float_fixing_method(fixing_method)
self._method_param = method_param
self._populated = Series(index=[], data=[], dtype=float)
self._populated = Series(index=[], data=[], dtype=float) # type: ignore[assignment]

@property
def fixing_method(self) -> FloatFixingMethod:
Expand Down
2 changes: 1 addition & 1 deletion python/rateslib/fx_volatility/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def _validate_weights(
w[s:e] = ( # type: ignore[misc]
w[s:e] * days / w[s:e].sum() # type: ignore[misc]
) # scale the weights to allocate the correct time between nodes.
w[eval_date] = 0.0
w[eval_date] = 0.0 # type: ignore[call-overload]
return w


Expand Down
14 changes: 7 additions & 7 deletions python/rateslib/instruments/bonds/bond_future.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,20 +559,20 @@ def dlv(
],
index=range(len(basket)),
)
df["Price"] = prices
df["YTM"] = [bond.ytm(prices[i], settlement, dirty=dirty) for i, bond in enumerate(basket)]
df["C.Factor"] = self.cfs
df["Gross Basis"] = self.gross_basis(future_price, prices, settlement, dirty=dirty)
df["Implied Repo"] = self.implied_repo(
df["Price"] = prices # type: ignore[assignment]
df["YTM"] = [bond.ytm(prices[i], settlement, dirty=dirty) for i, bond in enumerate(basket)] # type: ignore[assignment]
df["C.Factor"] = self.cfs # type: ignore[assignment]
df["Gross Basis"] = self.gross_basis(future_price, prices, settlement, dirty=dirty) # type: ignore[assignment]
df["Implied Repo"] = self.implied_repo( # type: ignore[assignment]
future_price,
prices,
settlement,
delivery,
convention,
dirty=dirty,
)
df["Actual Repo"] = r_
df["Net Basis"] = self.net_basis(
df["Actual Repo"] = r_ # type: ignore[assignment]
df["Net Basis"] = self.net_basis( # type: ignore[assignment]
future_price,
prices,
r_,
Expand Down
4 changes: 2 additions & 2 deletions python/rateslib/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ def delta(
df.loc[indexes[key[0]], (key[1], key[2])] = array

if not isinstance(base, NoInput):
df.loc[r_idx, ("all", base)] = df.loc[r_idx, (slice(None), base)].sum(axis=1) # type: ignore[index]
df.loc[r_idx, ("all", base)] = df.loc[r_idx, (slice(None), base)].sum(axis=1)

sorted_cols = df.columns.sort_values()
ret: DataFrame = df.loc[:, sorted_cols].astype("float64")
Expand Down Expand Up @@ -2291,7 +2291,7 @@ def exo_delta(
df.loc[indexes[key[0]], (key[1], key[2])] = array

if not isinstance(base, NoInput):
df.loc[r_idx, ("all", base)] = df.loc[r_idx, (slice(None), base)].sum(axis=1) # type: ignore[index]
df.loc[r_idx, ("all", base)] = df.loc[r_idx, (slice(None), base)].sum(axis=1)

sorted_cols = df.columns.sort_values()
_: DataFrame = df.loc[:, sorted_cols].astype("float64")
Expand Down