Skip to content

Commit 383ccad

Browse files
committed
fix: fix typing bugs
dataclasses are not the same as dictionaries.
1 parent 473a71f commit 383ccad

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

process_improvement/calculations/capability_calculations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def calculate_capability_indices(
1313
LSL: int,
1414
Target: int,
1515
round_value: int = 2,
16-
) -> dict[str, float]:
16+
) -> ProcessCapabilityIndices:
1717
"""
1818
Calculate process capability and performance indices.
1919
@@ -142,4 +142,4 @@ def calculate_capability_indices(
142142
mean=mean,
143143
s=s, # The standard deviation
144144
average_mR=ave_mR,
145-
)
145+
)

process_improvement/calculations/loss_function_calculations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def taguchi_loss_calcs(
1212
USL: float,
1313
LSL: float,
1414
Target: Optional[float] = None
15-
) -> dict[str, float or list]:
15+
) -> TaguchiLossCalcResults:
1616
"""
1717
Compute quadratic loss function (Taguchi loss function) values over a
1818
specification range.
@@ -117,9 +117,9 @@ def expected_loss_calc(
117117
USL: float,
118118
LSL: float,
119119
Target: Optional[float] = None,
120-
cost_of_scrap: Optional[float] = 1,
120+
cost_of_scrap: float = 1,
121121
# round_value: Optional[float] = 1
122-
) -> dict[str, float or list]:
122+
) -> ExpectedLossCalcResults:
123123
"""
124124
Docstring for expected_loss
125125
@@ -157,4 +157,4 @@ def expected_loss_calc(
157157

158158
return ExpectedLossCalcResults(
159159
df=stats_df
160-
)
160+
)

process_improvement/calculations/xmr_calculations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def calculate_xmr_limits(
4343
restrict_LPL: bool,
4444
max_value: float = 100.0,
4545
min_value: float = 0.0
46-
) -> dict[str, float]:
46+
) -> XmRLimits:
4747
"""
4848
Calculate Individuals and Moving Range (XmR) process limits.
4949
@@ -227,4 +227,4 @@ def characterize_mr_variation(
227227
),
228228
index=mr.index,
229229
name="mR chart variation"
230-
)
230+
)

0 commit comments

Comments
 (0)