Skip to content

Commit

Permalink
Merge pull request NHERI-SimCenter#86 from ioannis-vm/2024-12_update_…
Browse files Browse the repository at this point in the history
…warning_v2

Turn warning into an error.
  • Loading branch information
zsarnoczay authored Dec 10, 2024
2 parents 21a0858 + c5dff23 commit caa73c3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pelicun/model/damage_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,9 @@ def _create_dmg_RVs( # noqa: N802, C901
ValueError
Raises an error if the scaling specification is invalid or
if the input DataFrame does not meet the expected format.
ValueError
If a capacity scaling operation is associated with an
unsupported distribution.
TypeError
If there are any issues with the types of the data in the
input DataFrame.
Expand Down Expand Up @@ -1390,18 +1393,18 @@ def map_ds(values: np.ndarray, offset: int) -> np.ndarray:
]

if capacity_adjustment_operation:
if family in {'normal', 'lognormal', 'deterministic'}:
theta[0] = self._handle_operation(
theta[0],
capacity_adjustment_operation[0],
float(capacity_adjustment_operation[1]),
)
else:
self.log.warning(
if family not in {'normal', 'lognormal', 'deterministic'}:
msg = (
f'Capacity adjustment is only supported '
f'for `normal` or `lognormal` distributions. '
f'Ignoring: `{cmp_loc_dir}`, which is `{family}`'
)
raise ValueError(msg)
theta[0] = self._handle_operation(
theta[0],
capacity_adjustment_operation[0],
float(capacity_adjustment_operation[1]),
)

tr_lims = [
frg_params_ls.get(f'Truncate{side}', np.nan)
Expand Down

0 comments on commit caa73c3

Please sign in to comment.