AutoStatLib 0.2.18__tar.gz → 0.2.20__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.

Files changed (21) hide show
  1. {autostatlib-0.2.18/src/AutoStatLib.egg-info → autostatlib-0.2.20}/PKG-INFO +23 -23
  2. {autostatlib-0.2.18 → autostatlib-0.2.20}/README.md +22 -22
  3. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib/AutoStatLib.py +28 -7
  4. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib/StatPlots.py +7 -7
  5. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib/_version.py +1 -1
  6. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib/helpers.py +1 -0
  7. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib/text_formatting.py +1 -1
  8. {autostatlib-0.2.18 → autostatlib-0.2.20/src/AutoStatLib.egg-info}/PKG-INFO +23 -23
  9. {autostatlib-0.2.18 → autostatlib-0.2.20}/LICENSE +0 -0
  10. {autostatlib-0.2.18 → autostatlib-0.2.20}/MANIFEST.in +0 -0
  11. {autostatlib-0.2.18 → autostatlib-0.2.20}/pyproject.toml +0 -0
  12. {autostatlib-0.2.18 → autostatlib-0.2.20}/requirements.txt +0 -0
  13. {autostatlib-0.2.18 → autostatlib-0.2.20}/setup.cfg +0 -0
  14. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib/__init__.py +0 -0
  15. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib/__main__.py +0 -0
  16. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib/normality_tests.py +0 -0
  17. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib/statistical_tests.py +0 -0
  18. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib.egg-info/SOURCES.txt +0 -0
  19. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib.egg-info/dependency_links.txt +0 -0
  20. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib.egg-info/requires.txt +0 -0
  21. {autostatlib-0.2.18 → autostatlib-0.2.20}/src/AutoStatLib.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AutoStatLib
3
- Version: 0.2.18
3
+ Version: 0.2.20
4
4
  Summary: AutoStatLib - a simple statistical analysis tool
5
5
  Author: Stemonitis, SciWare LLC
6
6
  Author-email: konung-yaropolk <yaropolk1995@gmail.com>
@@ -659,39 +659,39 @@ If errors occured, *GetResult()* returns an empty dictionary
659
659
 
660
660
  ---
661
661
 
662
- ## Pre-Alpha dev status.
662
+ ## Alpha dev status.
663
663
 
664
664
  ### TODO:
665
665
 
666
- -- Anova: posthocs
667
- -- Anova: add 2-way anova and 3-way anova
668
- -- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
669
- -- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
670
- -- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
671
- -- add Welch test (for norm data unequal variances)
672
- -- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
673
- -- add independent t-test with Welch correction (do not assume equal SDs in groups)
674
- -- add correlation test, correlation diagram
675
- -- add linear regression, regression diagram
666
+ -- Anova: posthocs
667
+ -- Anova: add 2-way anova and 3-way anova
668
+ -- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
669
+ -- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
670
+ -- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
671
+ -- add Welch test (for norm data unequal variances)
672
+ -- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
673
+ -- add independent t-test with Welch correction (do not assume equal SDs in groups)
674
+ -- add correlation test, correlation diagram
675
+ -- add linear regression, regression diagram
676
676
  -- add QQ plot
677
677
  -- n-sample tests: add onetail option
678
678
 
679
679
  ✅ done -- detailed normality test results
680
680
  ✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
681
681
 
682
- tests check:
683
- 1-sample:
682
+ tests check:
683
+ 1-sample:
684
684
  ✅ok --Wilcoxon 2,1 tails
685
- ✅ok --t-tests 2,1 tails
685
+ ✅ok --t-tests 2,1 tails
686
686
 
687
- 2-sample:
687
+ 2-sample:
688
688
  ✅ok --Wilcoxon 2,1 tails
689
- ✅ok --Mann-whitney 2,1 tails
690
- ✅ok --t-tests 2,1 tails
689
+ ✅ok --Mann-whitney 2,1 tails
690
+ ✅ok --t-tests 2,1 tails
691
691
 
692
- n-sample:
692
+ n-sample:
693
693
  ✅ok --Kruskal-Wallis 2 tail
694
- ✅ok --Dunn's multiple comparisons
695
- ✅ok --Friedman 2 tail
696
- ✅ok --one-way ANOWA 2 tail
697
- ✅ok --Tukey`s multiple comparisons
694
+ ✅ok --Dunn's multiple comparisons
695
+ ✅ok --Friedman 2 tail
696
+ ✅ok --one-way ANOVA 2-tailed
697
+ ✅ok --Tukey`s multiple comparisons
@@ -119,39 +119,39 @@ If errors occured, *GetResult()* returns an empty dictionary
119
119
 
120
120
  ---
121
121
 
122
- ## Pre-Alpha dev status.
122
+ ## Alpha dev status.
123
123
 
124
124
  ### TODO:
125
125
 
126
- -- Anova: posthocs
127
- -- Anova: add 2-way anova and 3-way anova
128
- -- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
129
- -- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
130
- -- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
131
- -- add Welch test (for norm data unequal variances)
132
- -- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
133
- -- add independent t-test with Welch correction (do not assume equal SDs in groups)
134
- -- add correlation test, correlation diagram
135
- -- add linear regression, regression diagram
126
+ -- Anova: posthocs
127
+ -- Anova: add 2-way anova and 3-way anova
128
+ -- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
129
+ -- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
130
+ -- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
131
+ -- add Welch test (for norm data unequal variances)
132
+ -- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
133
+ -- add independent t-test with Welch correction (do not assume equal SDs in groups)
134
+ -- add correlation test, correlation diagram
135
+ -- add linear regression, regression diagram
136
136
  -- add QQ plot
137
137
  -- n-sample tests: add onetail option
138
138
 
139
139
  ✅ done -- detailed normality test results
140
140
  ✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
141
141
 
142
- tests check:
143
- 1-sample:
142
+ tests check:
143
+ 1-sample:
144
144
  ✅ok --Wilcoxon 2,1 tails
145
- ✅ok --t-tests 2,1 tails
145
+ ✅ok --t-tests 2,1 tails
146
146
 
147
- 2-sample:
147
+ 2-sample:
148
148
  ✅ok --Wilcoxon 2,1 tails
149
- ✅ok --Mann-whitney 2,1 tails
150
- ✅ok --t-tests 2,1 tails
149
+ ✅ok --Mann-whitney 2,1 tails
150
+ ✅ok --t-tests 2,1 tails
151
151
 
152
- n-sample:
152
+ n-sample:
153
153
  ✅ok --Kruskal-Wallis 2 tail
154
- ✅ok --Dunn's multiple comparisons
155
- ✅ok --Friedman 2 tail
156
- ✅ok --one-way ANOWA 2 tail
157
- ✅ok --Tukey`s multiple comparisons
154
+ ✅ok --Dunn's multiple comparisons
155
+ ✅ok --Friedman 2 tail
156
+ ✅ok --one-way ANOVA 2-tailed
157
+ ✅ok --Tukey`s multiple comparisons
@@ -18,7 +18,8 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
18
18
  tails=2,
19
19
  popmean=None,
20
20
  posthoc=False,
21
- verbose=True):
21
+ verbose=True,
22
+ groups_name=[]):
22
23
  self.results = None
23
24
  self.error = False
24
25
  self.groups_list = groups_list
@@ -28,9 +29,28 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
28
29
  self.posthoc = posthoc
29
30
  self.verbose = verbose
30
31
  self.n_groups = len(self.groups_list)
32
+ self.groups_name = [groups_name[i % len(groups_name)]
33
+ for i in range(self.n_groups)] if groups_name else [f'Group {i+1}'
34
+ for i in range(self.n_groups)]
35
+
31
36
  self.warning_flag_non_numeric_data = False
32
37
  self.summary = 'AutoStatLib v{}'.format(__version__)
33
38
 
39
+ # empties
40
+ self.results = None
41
+ self.error = False
42
+ self.warnings = []
43
+ self.normals = []
44
+ self.test_name = ''
45
+ self.test_id = None
46
+ self.test_stat = None
47
+ self.p_value = None
48
+ self.posthoc_matrix_df = None
49
+ self.posthoc_matrix = []
50
+ self.posthoc_name = ''
51
+ self.data = []
52
+ self.parametric = None
53
+
34
54
  # test IDs classification:
35
55
  self.test_ids_all = [ # in aplhabetical order
36
56
  'anova_1w_ordinary',
@@ -80,6 +100,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
80
100
  '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',
81
101
  }
82
102
 
103
+
83
104
  def run_test(self, test='auto'):
84
105
 
85
106
  # reset values from previous tests
@@ -108,7 +129,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
108
129
  # delete the empty cols from input
109
130
  self.data = [col for col in self.data if any(
110
131
  x is not None for x in col)]
111
-
132
+
112
133
  # User input assertion block
113
134
  try:
114
135
  assert self.data, 'There is no input data'
@@ -116,7 +137,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
116
137
  assert test in self.test_ids_all or test == 'auto', 'Wrong test id choosen, ensure you called correct function'
117
138
  assert all(len(
118
139
  group) >= 4 for group in self.data), 'Each group must contain at least four values'
119
- assert not (self.paired == True
140
+ assert not (self.paired is True
120
141
  and not all(len(lst) == len(self.data[0]) for lst in self.data)), 'Paired groups must have the same length'
121
142
  assert not (test in self.test_ids_dependent
122
143
  and not all(len(lst) == len(self.data[0]) for lst in self.data)), 'Groups must have the same length for dependent groups test'
@@ -153,7 +174,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
153
174
  '+' if x is True else '-' if x is False else ' ' if x is None else 'e' for x in poll)
154
175
  self.normals.append(isnormal)
155
176
  self.log(
156
- f' Group {i+1}: {poll_print[0]} {poll_print[1]} {poll_print[2]} {poll_print[3]} so disrtibution seems {"normal" if isnormal else "not normal"}')
177
+ f' {self.groups_name[i].ljust(7, ' ')[:7]}: {poll_print[0]} {poll_print[1]} {poll_print[2]} {poll_print[3]} so disrtibution seems {"normal" if isnormal else "not normal"}')
157
178
  self.parametric = all(self.normals)
158
179
 
159
180
  # print test choosen
@@ -164,9 +185,9 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
164
185
  self.log('Test chosen by user: ', test)
165
186
 
166
187
  # Wrong test Warnings
167
- if not test == 'auto' and not self.parametric and test in self.test_ids_parametric:
188
+ if test != 'auto' and not self.parametric and test in self.test_ids_parametric:
168
189
  self.AddWarning('param_test_with_non-normal_data')
169
- if not test == 'auto' and self.parametric and not test in self.test_ids_parametric:
190
+ if test != 'auto' and self.parametric and test not in self.test_ids_parametric:
170
191
  self.AddWarning('non-param_test_with_normal_data')
171
192
 
172
193
  # run the test
@@ -184,7 +205,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
184
205
  self.log('-'*67 + '\n')
185
206
 
186
207
  # print the results to console:
187
- if self.verbose == True:
208
+ if self.verbose is True:
188
209
  print(self.summary)
189
210
 
190
211
  # public methods:
@@ -82,7 +82,7 @@ class BaseStatPlot(Helpers):
82
82
  x_label='',
83
83
  y_label='',
84
84
  print_x_labels=True,
85
- x_manual_tick_labels=None,
85
+ Groups_Name=None,
86
86
  Posthoc_Matrix=[],
87
87
  Posthoc_Tests_Name='',
88
88
  colormap=None,
@@ -125,7 +125,7 @@ class BaseStatPlot(Helpers):
125
125
  self.p_printed = self.make_p_value_printed(self.p)
126
126
  self.stars_printed = self.make_stars_printed(self.make_stars(self.p))
127
127
 
128
- self.x_manual_tick_labels = x_manual_tick_labels if x_manual_tick_labels is not None else [
128
+ self.groups_name = Groups_Name if Groups_Name is not None else [
129
129
  '']
130
130
 
131
131
  if colormap is not None and colormap != ['']:
@@ -361,7 +361,7 @@ class BaseStatPlot(Helpers):
361
361
  zorder=zorder-1)
362
362
 
363
363
  def add_swarm(self, ax,
364
- color='grey',
364
+ color='dimgrey',
365
365
  alpha=1,
366
366
  marker='o',
367
367
  markersize=8,
@@ -408,7 +408,7 @@ class BaseStatPlot(Helpers):
408
408
  for i, data in enumerate(self.transpose(self.data_groups)):
409
409
  ax.plot(range(len(data)), data,
410
410
  color=color,
411
- alpha=alpha * 0.7,
411
+ alpha=alpha * 0.25,
412
412
  linewidth=linewidth * self.figure_scale_factor,
413
413
  zorder=zorder - 1)
414
414
 
@@ -569,10 +569,10 @@ class BaseStatPlot(Helpers):
569
569
  # Set x ticks and labels
570
570
  if self.print_x_labels:
571
571
  plt.subplots_adjust(bottom=0.11)
572
- if self.x_manual_tick_labels != ['']:
572
+ if self.groups_name != ['']:
573
573
  ax.set_xticks(range(self.n_groups))
574
- ax.set_xticklabels([self.x_manual_tick_labels[i % len(self.x_manual_tick_labels)]
575
- for i in range(self.n_groups)])
574
+ ax.set_xticklabels([self.groups_name[i % len(self.groups_name)]
575
+ for i in range(self.n_groups)], fontweight='regular', fontsize=8*self.figure_scale_factor)
576
576
  else:
577
577
  ax.set_xticks(range(self.n_groups))
578
578
  ax.set_xticklabels(['Group {}'.format(i + 1)
@@ -1,2 +1,2 @@
1
1
  # AutoStatLib package version:
2
- __version__ = "0.2.18"
2
+ __version__ = "0.2.20"
@@ -65,6 +65,7 @@ class Helpers():
65
65
  'Stars': self.stars_int,
66
66
  # 'Stat_Value': self.test_stat.item(),
67
67
  'Warnings': self.warnings,
68
+ 'Groups_Name': self.groups_name,
68
69
  'Groups_N': [len(self.data[i]) for i in range(len(self.data))],
69
70
  'Groups_Median': [np.median(self.data[i]).item() for i in range(len(self.data))],
70
71
  'Groups_Mean': [np.mean(self.data[i]).item() for i in range(len(self.data))],
@@ -22,7 +22,7 @@ class TextFormatting():
22
22
  group_longest = max(len(row) for row in data)
23
23
 
24
24
  # Print the header
25
- header = [f'Group {i+1}' for i in range(num_groups)]
25
+ header = self.groups_name
26
26
  line = [''*7]
27
27
  self.log(self.autospace(header, space))
28
28
  self.log(self.autospace(line, space))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AutoStatLib
3
- Version: 0.2.18
3
+ Version: 0.2.20
4
4
  Summary: AutoStatLib - a simple statistical analysis tool
5
5
  Author: Stemonitis, SciWare LLC
6
6
  Author-email: konung-yaropolk <yaropolk1995@gmail.com>
@@ -659,39 +659,39 @@ If errors occured, *GetResult()* returns an empty dictionary
659
659
 
660
660
  ---
661
661
 
662
- ## Pre-Alpha dev status.
662
+ ## Alpha dev status.
663
663
 
664
664
  ### TODO:
665
665
 
666
- -- Anova: posthocs
667
- -- Anova: add 2-way anova and 3-way anova
668
- -- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
669
- -- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
670
- -- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
671
- -- add Welch test (for norm data unequal variances)
672
- -- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
673
- -- add independent t-test with Welch correction (do not assume equal SDs in groups)
674
- -- add correlation test, correlation diagram
675
- -- add linear regression, regression diagram
666
+ -- Anova: posthocs
667
+ -- Anova: add 2-way anova and 3-way anova
668
+ -- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
669
+ -- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
670
+ -- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
671
+ -- add Welch test (for norm data unequal variances)
672
+ -- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
673
+ -- add independent t-test with Welch correction (do not assume equal SDs in groups)
674
+ -- add correlation test, correlation diagram
675
+ -- add linear regression, regression diagram
676
676
  -- add QQ plot
677
677
  -- n-sample tests: add onetail option
678
678
 
679
679
  ✅ done -- detailed normality test results
680
680
  ✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
681
681
 
682
- tests check:
683
- 1-sample:
682
+ tests check:
683
+ 1-sample:
684
684
  ✅ok --Wilcoxon 2,1 tails
685
- ✅ok --t-tests 2,1 tails
685
+ ✅ok --t-tests 2,1 tails
686
686
 
687
- 2-sample:
687
+ 2-sample:
688
688
  ✅ok --Wilcoxon 2,1 tails
689
- ✅ok --Mann-whitney 2,1 tails
690
- ✅ok --t-tests 2,1 tails
689
+ ✅ok --Mann-whitney 2,1 tails
690
+ ✅ok --t-tests 2,1 tails
691
691
 
692
- n-sample:
692
+ n-sample:
693
693
  ✅ok --Kruskal-Wallis 2 tail
694
- ✅ok --Dunn's multiple comparisons
695
- ✅ok --Friedman 2 tail
696
- ✅ok --one-way ANOWA 2 tail
697
- ✅ok --Tukey`s multiple comparisons
694
+ ✅ok --Dunn's multiple comparisons
695
+ ✅ok --Friedman 2 tail
696
+ ✅ok --one-way ANOVA 2-tailed
697
+ ✅ok --Tukey`s multiple comparisons
File without changes
File without changes
File without changes