Skip to content

Commit 333dc16

Browse files
committed
wip
1 parent 768a860 commit 333dc16

9 files changed

+16
-15
lines changed

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def getVersion():
4949
install_requires=[
5050
'pyDOE3',
5151
'diversipy',
52+
'pingouin',
5253
],
5354

5455
test_suite='nose.collector',

src/mistat/mqcc/tests/test_statistics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
class Test_mqccStatistics(unittest.TestCase):
18-
array_1 = np.array([[1, 2, 3], [1, 2, np.NaN]])
18+
array_1 = np.array([[1, 2, 3], [1, 2, np.nan]])
1919
array_2 = np.array([[1, 2, 3], [1, 2, 7]])
2020

2121
def setUp(self):

src/mistat/qcc/processCapability.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ def __init__(self, qcc, spec_limits, std_dev=None, target=None, nsigmas=None,
5050
self.confidence_level = confidence_level
5151
self.calcPCIndices()
5252

53-
self.exp_LSL = np.NaN
53+
self.exp_LSL = np.nan
5454
if not np.isnan(lsl):
5555
self.exp_LSL = stats.norm.cdf((lsl - self.center) / self.std_dev) * 100
56-
self.exp_USL = np.NaN
56+
self.exp_USL = np.nan
5757
if not np.isnan(usl):
5858
self.exp_USL = (1 - stats.norm.cdf((usl - self.center) / self.std_dev)) * 100
5959
self.obs_LSL = np.nanmean(data < lsl) * 100

src/mistat/qcc/qualityControlChart.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def plot(self, title=None, ax=None):
102102
ucl = [[], []]
103103
last = None
104104
for xleft, xright, lower, upper in zip(df.x.values - delta[:-1], df.x.values + delta[1:],
105-
self.limits.LCL, self.limits.UCL):
105+
self.limits.LCL, self.limits.UCL):
106106
if last:
107107
lcl[0].extend([xleft, xleft])
108108
lcl[1].extend([last, lower])
@@ -182,7 +182,7 @@ def qcc_groups(data, groups):
182182
max_size = max(grouped.size())
183183

184184
result = np.empty((len(grouped), max_size))
185-
result[:] = np.NaN
185+
result[:] = np.nan
186186
for idx, group in grouped:
187187
result[idx - 1, :len(group.values)] = group.values
188188
return result

src/mistat/qcc/rules.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def beyondLimits(qcc, limits=None, **kwargs):
3535
if len(limits['UCL']) == 1:
3636
return {'beyondLimits': {'UCL': np.nonzero(statistics > limits['UCL'][0])[0],
3737
'LCL': np.nonzero(statistics < limits['LCL'][0])[0]}}
38-
return {'beyondLimits': {'UCL': np.nonzero(statistics.ravel() > limits['UCL'].ravel())[0],
39-
'LCL': np.nonzero(statistics.ravel() < limits['LCL'].ravel())[0]}}
38+
return {'beyondLimits': {'UCL': np.nonzero(statistics > limits['UCL'].to_numpy())[0],
39+
'LCL': np.nonzero(statistics < limits['LCL'].to_numpy())[0]}}
4040

4141

4242
def violatingRuns(qcc, run_length=7, **kwargs):

src/mistat/qcc/statistics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ def get(cls, name, default):
9090
# exp.R.unscaled a vector specifying, for each sample size, the expected value of the relative range
9191
# (i.e. R/σ) for a normal distribution. This appears as d2 on most tables containing factors for
9292
# the construction of control charts.
93-
_exp_R_unscaled = [np.NaN, np.NaN, 1.128, 1.693, 2.059, 2.326, 2.534, 2.704, 2.847, 2.970, 3.078, 3.173,
93+
_exp_R_unscaled = [np.nan, np.nan, 1.128, 1.693, 2.059, 2.326, 2.534, 2.704, 2.847, 2.970, 3.078, 3.173,
9494
3.258, 3.336, 3.407, 3.472, 3.532, 3.588, 3.640, 3.689, 3.735, 3.778, 3.819, 3.858, 3.895, 3.931]
9595
# se.R.unscaled a vector specifying, for each sample size, the standard error of the relative range
9696
# (i.e. R/σ) for a normal distribution. This appears as d3 on most tables containing factors for
9797
# the construction of control charts.
98-
_se_R_unscaled = [np.NaN, np.NaN, 0.8525033, 0.8883697, 0.8798108, 0.8640855, 0.8480442, 0.8332108, 0.8198378,
98+
_se_R_unscaled = [np.nan, np.nan, 0.8525033, 0.8883697, 0.8798108, 0.8640855, 0.8480442, 0.8332108, 0.8198378,
9999
0.8078413, 0.7970584, 0.7873230, 0.7784873, 0.7704257, 0.7630330, 0.7562217, 0.7499188, 0.7440627,
100100
0.7386021, 0.7334929, 0.7286980, 0.7241851, 0.7199267, 0.7158987, 0.7120802, 0.7084528, 0.7050004,
101101
0.7017086, 0.6985648, 0.6955576, 0.6926770, 0.6899137, 0.6872596, 0.6847074, 0.6822502, 0.6798821,

src/mistat/qcc/tests/test_qualityControlChart.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def test_qcc_groups(num_regression):
2727

2828
def test_qcc_groups_missing_values():
2929
result = qcc_groups([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], [1, 2, 2, 3, 3, 3, 4, 4, 4, 4])
30-
expect = np.array([[1.0, np.NaN, np.NaN, np.NaN],
31-
[2.0, 2.0, np.NaN, np.NaN],
32-
[3.0, 3.0, 3.0, np.NaN],
30+
expect = np.array([[1.0, np.nan, np.nan, np.nan],
31+
[2.0, 2.0, np.nan, np.nan],
32+
[3.0, 3.0, 3.0, np.nan],
3333
[4.0, 4.0, 4.0, 4.0]])
3434
np.testing.assert_array_equal(result, expect)
3535

src/mistat/qcc/tests/test_statistics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
class Test_qccStatistics(unittest.TestCase):
19-
array_1 = np.array([[1, 2, 3], [1, 2, np.NaN]])
19+
array_1 = np.array([[1, 2, 3], [1, 2, np.nan]])
2020
array_2 = np.array([[1, 2, 3], [1, 2, 7]])
2121

2222
def setUp(self):

src/mistat/version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
Modern Statistics: A Computer Based Approach with Python
33
Industrial Statistics: A Computer Based Approach with Python
44
5-
(c) 2022 Ron Kenett, Shelemyahu Zacks, Peter Gedeck
5+
(c) 2022-2024 Ron Kenett, Shelemyahu Zacks, Peter Gedeck
66
'''
7-
__version__ = '0.1.14'
7+
__version__ = '0.1.16'

0 commit comments

Comments
 (0)