Skip to content

Commit

Permalink
ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyan1214 committed Nov 22, 2024
1 parent 9df3401 commit 9e2ecbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 4 additions & 4 deletions pelicun/model/damage_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,9 @@ def _handle_operation( # noqa: PLR6301
msg = f'Invalid operation: `{operation}`'
raise ValueError(msg)

def _handle_operation_list(self, initial_value: float, operations: list[tuple[str, float]]) -> np.ndarray:
def _handle_operation_list(
self, initial_value: float, operations: list[tuple[str, float]]
) -> np.ndarray:
if len(operations) == 1:
return np.array(
[
Expand Down Expand Up @@ -1337,9 +1339,7 @@ def map_ds(values: np.ndarray, offset: int) -> np.ndarray:
f'Invalid entry in scaling_specification: '
f'{value}. It should only have one entry for `ALL`.'
)
raise ValueError(
msg
)
raise ValueError(msg)
value = value['ALL'] # noqa: PLW2901
for LS, specifics in value.items(): # noqa: N806
css = 'capacity adjustment specification'
Expand Down
8 changes: 2 additions & 6 deletions pelicun/resources/auto/Hazus_Earthquake_IM.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,7 @@ def getHAZUSBridgeSlightDamageModifier(hazus_class, aim):
'The demand file does not contain the required EDP type SA_0.3'
' or contains multiple instances of it.'
)
raise ValueError(
msg
)
raise ValueError(msg)
sa_0p3 = demands.loc[ # noqa: PD011
:, demands.columns.get_level_values(1) == 'SA_0.3'
].values.flatten()
Expand All @@ -428,9 +426,7 @@ def getHAZUSBridgeSlightDamageModifier(hazus_class, aim):
'The demand file does not contain the required EDP type SA_1.0'
' or contains multiple instances of it.'
)
raise ValueError(
msg
)
raise ValueError(msg)
sa_1p0 = demands.loc[ # noqa: PD011
:, demands.columns.get_level_values(1) == 'SA_1.0'
].values.flatten()
Expand Down

0 comments on commit 9e2ecbb

Please sign in to comment.