fix(lint): remove unused imports and reformat with black

This commit is contained in:
Bu5hm4nn
2026-03-30 08:42:07 +02:00
parent 98e3208b5e
commit 8e1aa4ad26
7 changed files with 28 additions and 19 deletions

View File

@@ -412,11 +412,14 @@ def strategy_metrics_from_snapshot(
]
scenario_price = spot * _pct_factor(scenario_pct)
scenario_gold_value = _as_money(gold_weight * PricePerWeight(
amount=scenario_price,
currency=BaseCurrency.USD,
per_unit=WeightUnit.OUNCE_TROY,
))
scenario_gold_value = _as_money(
gold_weight
* PricePerWeight(
amount=scenario_price,
currency=BaseCurrency.USD,
per_unit=WeightUnit.OUNCE_TROY,
)
)
current_gold_value = _as_money(gold_weight * current_spot)
unhedged_equity = scenario_gold_value - loan_amount
scenario_payoff_per_unit = _strategy_option_payoff_per_unit(strategy, spot, scenario_price)

View File

@@ -260,16 +260,24 @@ class PricePerWeight:
adjusted_weight = other.to_unit(self._per_unit_typed)
return Money(amount=adjusted_weight.amount * self.amount, currency=self._currency_typed)
if isinstance(other, Decimal):
return PricePerWeight(amount=self.amount * other, currency=self._currency_typed, per_unit=self._per_unit_typed)
return PricePerWeight(
amount=self.amount * other, currency=self._currency_typed, per_unit=self._per_unit_typed
)
if isinstance(other, int):
return PricePerWeight(amount=self.amount * Decimal(other), currency=self._currency_typed, per_unit=self._per_unit_typed)
return PricePerWeight(
amount=self.amount * Decimal(other), currency=self._currency_typed, per_unit=self._per_unit_typed
)
return NotImplemented
def __rmul__(self, other: object) -> PricePerWeight:
if isinstance(other, bool):
return NotImplemented
if isinstance(other, Decimal):
return PricePerWeight(amount=self.amount * other, currency=self._currency_typed, per_unit=self._per_unit_typed)
return PricePerWeight(
amount=self.amount * other, currency=self._currency_typed, per_unit=self._per_unit_typed
)
if isinstance(other, int):
return PricePerWeight(amount=self.amount * Decimal(other), currency=self._currency_typed, per_unit=self._per_unit_typed)
return PricePerWeight(
amount=self.amount * Decimal(other), currency=self._currency_typed, per_unit=self._per_unit_typed
)
return NotImplemented