Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuhel committed Apr 23, 2024
1 parent f0e5177 commit 0aabd63
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions boario/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ def _instantiate(
occurrence: int = 1,
duration: int = 1,
name: Optional[str] = None,
**_,
**_,
):
return cls(
impact=impact,
Expand Down Expand Up @@ -1241,7 +1241,7 @@ def _instantiate(
rebuild_tau: int,
rebuilding_sectors: dict[str, float] | pd.Series,
rebuilding_factor: float = 1.0,
**_,
**_,
):
return cls(
impact=impact,
Expand All @@ -1263,7 +1263,9 @@ def rebuild_tau(self) -> int:
@rebuild_tau.setter
def rebuild_tau(self, value: int):
if not isinstance(value, int) or value < 1:
raise ValueError(f"``rebuild_tau`` should be a strictly positive integer. Value given is {value}.")
raise ValueError(
f"``rebuild_tau`` should be a strictly positive integer. Value given is {value}."
)
else:
self._rebuild_tau = value

Expand All @@ -1289,7 +1291,9 @@ def rebuilding_sectors(self, value: dict[str, float] | pd.Series):
else:
reb_sectors = value
if not is_numeric_dtype(reb_sectors):
raise TypeError("Rebuilding sectors should be given as ``dict[str, float] | pd.Series``.")
raise TypeError(
"Rebuilding sectors should be given as ``dict[str, float] | pd.Series``."
)
if not np.isclose(reb_sectors.sum(), 1.0):
raise ValueError(f"Reconstruction shares among sectors do not sum up to 1.")
impossible_sectors = np.setdiff1d(reb_sectors.index, self.possible_sectors)
Expand Down Expand Up @@ -1439,7 +1443,7 @@ def _instantiate(
event_monetary_factor: Optional[int] = None,
recovery_time: int,
recovery_function: str = "linear",
**_,
**_,
):
return cls(
impact=impact,
Expand Down

0 comments on commit 0aabd63

Please sign in to comment.