Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hazard rate calculations not recursively calculated (Sourcery refactored) #983

Merged
merged 1 commit into from
Feb 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/ramstk/analyses/milhdbk217f/models/inductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,7 @@ def calculate_part_stress_lambda_b(
_ref_temp = REF_TEMPS[subcategory_id][insulation_id]
_f0 = _dic_factors[subcategory_id][insulation_id][0]
_f1 = _dic_factors[subcategory_id][insulation_id][1]
_lambda_b = _f0 * exp(((temperature_hot_spot + 273.0) / _ref_temp) ** _f1)

return _lambda_b
return _f0 * exp(((temperature_hot_spot + 273.0) / _ref_temp) ** _f1)
weibullguy marked this conversation as resolved.
Show resolved Hide resolved


def calculate_temperature_rise_input_power_weight(
Expand Down Expand Up @@ -383,12 +381,11 @@ def get_part_stress_quality_factor(
:raise: IndexError if passed an unknown quality ID.
:raise: KeyError if passed an unknown subcategory ID or family ID.
"""
if subcategory_id == 1:
_pi_q = PART_STRESS_PI_Q[subcategory_id][family_id][quality_id - 1]
else:
_pi_q = PART_STRESS_PI_Q[subcategory_id][quality_id - 1]

return _pi_q
return (
PART_STRESS_PI_Q[subcategory_id][family_id][quality_id - 1]
if subcategory_id == 1
else PART_STRESS_PI_Q[subcategory_id][quality_id - 1]
)
weibullguy marked this conversation as resolved.
Show resolved Hide resolved


def get_temperature_rise_spec_sheet(page_number: int) -> float:
Expand Down