AutoStatLib 0.1.7__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of AutoStatLib might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: AutoStatLib
3
- Version: 0.1.7
3
+ Version: 0.2.0
4
4
  Summary: AutoStatLib - a simple statistical analysis tool
5
5
  Author: Stemonitis, SciWare LLC
6
6
  Author-email: konung-yaropolk <yaropolk1995@gmail.com>
@@ -96,14 +96,14 @@ class __StatisticalTests():
96
96
  self.popmean = 0
97
97
  self.AddWarning('no_pop_mean_set')
98
98
  data = [i - self.popmean for i in self.data[0]]
99
- w_stat, w_p_value = wilcoxon(data)
99
+ w_stat, p_value = wilcoxon(data)
100
100
  if self.tails == 1:
101
101
  p_value /= 2
102
102
  self.test_name = 'Wilcoxon signed-rank test for single sample'
103
103
  self.test_id = 'wilcoxon_single_sample'
104
104
  self.paired = False
105
105
  self.test_stat = w_stat
106
- self.p_value = w_p_value
106
+ self.p_value = p_value
107
107
 
108
108
  def wilcoxon(self):
109
109
  stat, p_value = wilcoxon(self.data[0], self.data[1])
@@ -148,20 +148,22 @@ class __NormalityTests():
148
148
  lf = False
149
149
 
150
150
  # Anderson-Darling test
151
- ad_stat, ad_p_value = self.anderson_get_p(
152
- data, dist='norm')
153
- if ad_p_value > 0.05 and n >= 20:
154
- ad = True
155
- elif ad_p_value <= 0.05 and n >= 20:
156
- ad = False
151
+ if n >= 20:
152
+ ad_stat, ad_p_value = self.anderson_get_p(
153
+ data, dist='norm')
154
+ if ad_p_value > 0.05:
155
+ ad = True
156
+ else:
157
+ ad = False
157
158
 
158
159
  # D'Agostino-Pearson test
159
- ap_stat, ap_p_value = normaltest(data)
160
160
  # test result is skewed if n<20
161
- if ap_p_value > 0.05 and n >= 20:
162
- ap = True
163
- elif ap_p_value <= 0.05 and n >= 20:
164
- ap = False
161
+ if n >= 20:
162
+ ap_stat, ap_p_value = normaltest(data)
163
+ if ap_p_value > 0.05:
164
+ ap = True
165
+ else:
166
+ ap = False
165
167
 
166
168
  # print(ap_p_value, ad_p_value, sw_p_value, lf_p_value)
167
169
 
@@ -386,7 +388,7 @@ class StatisticalAnalysis(__StatisticalTests, __NormalityTests, __TextFormatting
386
388
  'wilcoxon_single_sample',
387
389
  ]
388
390
  self.warning_ids_all = {
389
- 'not-numeric': '\nWarning: Non-numeric data was found in input and ignored.\n Make sure the input data is correct to get the correct results\n',
391
+ # 'not-numeric': '\nWarning: Non-numeric data was found in input and ignored.\n Make sure the input data is correct to get the correct results\n',
390
392
  'param_test_with_non-normal_data': '\nWarning: Parametric test was manualy chosen for Not-Normaly distributed data.\n The results might be skewed. \n Please, run non-parametric test or preform automatic test selection.\n',
391
393
  'non-param_test_with_normal_data': '\nWarning: Non-Parametric test was manualy chosen for Normaly distributed data.\n The results might be skewed. \n Please, run parametric test or preform automatic test selection.\n',
392
394
  'no_pop_mean_set': '\nWarning: No Population Mean was set up for single-sample test, used default 0 value.\n The results might be skewed. \n Please, set the Population Mean and run the test again.\n',
@@ -411,7 +413,8 @@ class StatisticalAnalysis(__StatisticalTests, __NormalityTests, __TextFormatting
411
413
  # adjusting input data type
412
414
  self.data = self.floatify_recursive(self.groups_list)
413
415
  if self.warning_flag_non_numeric_data:
414
- self.AddWarning('not-numeric')
416
+ self.log(
417
+ 'Text or other non-numeric data in the input was ignored:')
415
418
 
416
419
  # delete the empty cols from input
417
420
  self.data = [col for col in self.data if any(
@@ -419,13 +422,14 @@ class StatisticalAnalysis(__StatisticalTests, __NormalityTests, __TextFormatting
419
422
 
420
423
  # User input assertion block
421
424
  try:
425
+ assert self.data, 'There is no input data'
422
426
  assert self.tails in [1, 2], 'Tails parameter can be 1 or 2 only'
423
427
  assert test in self.test_ids_all or test == 'auto', 'Wrong test id choosen, ensure you called correct function'
424
428
  assert not (self.n_groups > 1
425
429
  and (test == 't_test_single_sample'
426
430
  or test == 'wilcoxon_single_sample')), 'Only one group of data must be given for single-group tests'
427
431
  assert all(len(
428
- group) > 2 for group in self.data), 'Each group must contain at least three values'
432
+ group) >= 4 for group in self.data), 'Each group must contain at least four values'
429
433
  assert not (self.paired == True and not all(len(lst) == len(
430
434
  self.data[0]) for lst in self.data)), 'Paired groups must be the same length'
431
435
  assert not (test == 'friedman' and not all(len(lst) == len(
@@ -604,4 +608,4 @@ class StatisticalAnalysis(__StatisticalTests, __NormalityTests, __TextFormatting
604
608
 
605
609
 
606
610
  if __name__ == '__main__':
607
- print('\nThis package works as an imported module only\n')
611
+ print('This package works as an imported module only.\nUse "import autostatlib" statement')
@@ -0,0 +1,2 @@
1
+ from AutoStatLib.AutoStatLib import StatisticalAnalysis
2
+ from AutoStatLib._version import __version__
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env python
2
+ from AutoStatLib.AutoStatLib import StatisticalAnalysis
3
+ from AutoStatLib._version import __version__
4
+
5
+ if __name__ == '__main__':
6
+ print('This package works as an imported module only.\nUse "import autostatlib" statement')
@@ -1,2 +1,2 @@
1
1
  # AutoStatLib package version:
2
- __version__ = "0.1.7"
2
+ __version__ = "0.2.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: AutoStatLib
3
- Version: 0.1.7
3
+ Version: 0.2.0
4
4
  Summary: AutoStatLib - a simple statistical analysis tool
5
5
  Author: Stemonitis, SciWare LLC
6
6
  Author-email: konung-yaropolk <yaropolk1995@gmail.com>
@@ -1,2 +0,0 @@
1
- from .AutoStatLib import StatisticalAnalysis
2
- from ._version import __version__
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env python
2
- from .AutoStatLib import StatisticalAnalysis
3
- from ._version import __version__
4
-
5
- if __name__ == '__main__':
6
- print('\nThis package works as an imported module only\n')
File without changes
File without changes
File without changes
File without changes
File without changes