Skip to content

Commit

Permalink
style: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
weibullguy committed Feb 22, 2022
1 parent fe4f8d2 commit eb3fce6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/ramstk/analyses/fha.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ def set_user_defined_functions(
for _idx in [6, 7, 8, 9, 10]:
try:
_key = list(fha.keys())[_idx]
fha[_key] = "0.0" if not str(functions[_idx - 6]) else str(functions[_idx - 6])
fha[_key] = (
"0.0" if not str(functions[_idx - 6]) else str(functions[_idx - 6])
)
except IndexError:
fha[_key] = "0.0"

Expand Down
8 changes: 3 additions & 5 deletions src/ramstk/analyses/milhdbk217f/models/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def calculate_complexity_factor(n_circuit_planes: int) -> float:
:return: _pi_c; the calculated value of the complexity factor.
:rtype: float
"""
return 0.65 * n_circuit_planes ** 0.63 if n_circuit_planes > 2 else 1.0
return 0.65 * n_circuit_planes**0.63 if n_circuit_planes > 2 else 1.0


def calculate_insert_temperature(contact_gauge: int, current_operating: float) -> float:
Expand Down Expand Up @@ -390,7 +390,7 @@ def calculate_insert_temperature(contact_gauge: int, current_operating: float) -
_dic_factors = {12: 0.1, 16: 0.274, 20: 0.64, 22: 0.989, 26: 2.1}

_fo = _dic_factors[contact_gauge]
return _fo * current_operating ** 1.85
return _fo * current_operating**1.85


def calculate_part_count(**attributes: Dict[str, Any]) -> float:
Expand Down Expand Up @@ -634,9 +634,7 @@ def get_part_count_lambda_b(**kwargs: Dict[str, int]) -> float:
_environment_active_id = kwargs.get("environment_active_id", 0)

return (
PART_COUNT_LAMBDA_B[_subcategory_id][_type_id][
_environment_active_id - 1
]
PART_COUNT_LAMBDA_B[_subcategory_id][_type_id][_environment_active_id - 1]
if _subcategory_id in [1, 5]
else PART_COUNT_LAMBDA_B[_subcategory_id][_environment_active_id - 1]
)
8 changes: 4 additions & 4 deletions src/ramstk/analyses/milhdbk217f/models/integratedcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ def calculate_package_factor(package_id: int, n_active_pins: int) -> float:
_f0 = C2[_package][0]
_f1 = C2[_package][1]

return _f0 * (n_active_pins ** _f1)
return _f0 * (n_active_pins**_f1)


def calculate_part_count(**attributes: Dict[str, Any]) -> float:
Expand Down Expand Up @@ -1546,7 +1546,7 @@ def get_part_count_lambda_b(n_elements: int, id_keys: Dict[str, int]) -> float:
id_keys["environment_active_id"] - 1
]
if id_keys["subcategory_id"] == 1
else PART_COUNT_LAMBDA_B[id_keys["subcategory_id"]][
id_keys["technology_id"]
][_index][id_keys["environment_active_id"] - 1]
else PART_COUNT_LAMBDA_B[id_keys["subcategory_id"]][id_keys["technology_id"]][
_index
][id_keys["environment_active_id"] - 1]
)
9 changes: 6 additions & 3 deletions src/ramstk/analyses/statistics/lognormal.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ def get_hazard_rate(
:return: _hazard_rate; the hazard rate.
:rtype: float
"""
return 0.0 if time <= 0.0 else lognorm.pdf(
time, shape, loc=location, scale=scale
) / lognorm.cdf(time, shape, loc=location, scale=scale)
return (
0.0
if time <= 0.0
else lognorm.pdf(time, shape, loc=location, scale=scale)
/ lognorm.cdf(time, shape, loc=location, scale=scale)
)


def get_mtbf(shape: float, location: float = 0.0, scale: float = 1.0) -> float:
Expand Down
9 changes: 6 additions & 3 deletions src/ramstk/analyses/statistics/weibull.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ def get_hazard_rate(
:return: _hazard_rate; the hazard rate.
:rtype: float
"""
return 0.0 if time <= 0.0 else weibull_min.pdf(
time, shape, loc=location, scale=scale
) / weibull_min.cdf(time, shape, loc=location, scale=scale)
return (
0.0
if time <= 0.0
else weibull_min.pdf(time, shape, loc=location, scale=scale)
/ weibull_min.cdf(time, shape, loc=location, scale=scale)
)


def get_mtbf(shape: float, scale: float, location: float = 0.0) -> float:
Expand Down

0 comments on commit eb3fce6

Please sign in to comment.