chemotools 0.1.5__py3-none-any.whl → 0.1.7__py3-none-any.whl
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.
- chemotools/augmentation/__init__.py +10 -0
- chemotools/augmentation/baseline_shift.py +23 -15
- chemotools/augmentation/exponential_noise.py +24 -15
- chemotools/augmentation/index_shift.py +104 -16
- chemotools/augmentation/normal_noise.py +24 -14
- chemotools/augmentation/spectrum_scale.py +24 -15
- chemotools/augmentation/uniform_noise.py +26 -14
- chemotools/baseline/__init__.py +13 -1
- chemotools/baseline/_air_pls.py +16 -14
- chemotools/baseline/_ar_pls.py +17 -17
- chemotools/baseline/_constant_baseline_correction.py +19 -16
- chemotools/baseline/_cubic_spline_correction.py +17 -8
- chemotools/baseline/_linear_correction.py +18 -10
- chemotools/baseline/_non_negative.py +14 -8
- chemotools/baseline/_polynomial_correction.py +19 -11
- chemotools/baseline/_subtract_reference.py +17 -9
- chemotools/datasets/__init__.py +2 -0
- chemotools/datasets/_base.py +3 -3
- chemotools/derivative/__init__.py +3 -1
- chemotools/derivative/_norris_william.py +14 -8
- chemotools/derivative/_savitzky_golay.py +25 -21
- chemotools/feature_selection/__init__.py +2 -0
- chemotools/feature_selection/_index_selector.py +18 -17
- chemotools/feature_selection/_range_cut.py +9 -7
- chemotools/scale/__init__.py +2 -0
- chemotools/scale/_min_max_scaler.py +14 -8
- chemotools/scale/_norm_scaler.py +14 -8
- chemotools/scale/_point_scaler.py +18 -10
- chemotools/scatter/__init__.py +11 -2
- chemotools/scatter/_extended_multiplicative_scatter_correction.py +33 -29
- chemotools/scatter/_multiplicative_scatter_correction.py +33 -18
- chemotools/scatter/_robust_normal_variate.py +14 -8
- chemotools/scatter/_standard_normal_variate.py +14 -8
- chemotools/smooth/__init__.py +3 -1
- chemotools/smooth/_mean_filter.py +14 -8
- chemotools/smooth/_median_filter.py +31 -9
- chemotools/smooth/_savitzky_golay_filter.py +20 -9
- chemotools/smooth/_whittaker_smooth.py +20 -11
- {chemotools-0.1.5.dist-info → chemotools-0.1.7.dist-info}/METADATA +18 -17
- chemotools-0.1.7.dist-info/RECORD +51 -0
- {chemotools-0.1.5.dist-info → chemotools-0.1.7.dist-info}/WHEEL +1 -2
- chemotools/utils/check_inputs.py +0 -14
- chemotools-0.1.5.dist-info/RECORD +0 -58
- chemotools-0.1.5.dist-info/top_level.txt +0 -2
- tests/__init__.py +0 -0
- tests/fixtures.py +0 -89
- tests/test_datasets.py +0 -111
- tests/test_functionality.py +0 -777
- tests/test_sklearn_compliance.py +0 -277
- {chemotools-0.1.5.dist-info → chemotools-0.1.7.dist-info}/LICENSE +0 -0
tests/test_sklearn_compliance.py
DELETED
@@ -1,277 +0,0 @@
|
|
1
|
-
from sklearn.utils.estimator_checks import check_estimator
|
2
|
-
|
3
|
-
from chemotools.augmentation import (
|
4
|
-
BaselineShift,
|
5
|
-
ExponentialNoise,
|
6
|
-
NormalNoise,
|
7
|
-
IndexShift,
|
8
|
-
SpectrumScale,
|
9
|
-
UniformNoise,
|
10
|
-
)
|
11
|
-
|
12
|
-
from chemotools.baseline import (
|
13
|
-
AirPls,
|
14
|
-
ArPls,
|
15
|
-
ConstantBaselineCorrection,
|
16
|
-
CubicSplineCorrection,
|
17
|
-
LinearCorrection,
|
18
|
-
NonNegative,
|
19
|
-
PolynomialCorrection,
|
20
|
-
SubtractReference,
|
21
|
-
)
|
22
|
-
from chemotools.derivative import NorrisWilliams, SavitzkyGolay
|
23
|
-
from chemotools.scale import MinMaxScaler, NormScaler, PointScaler
|
24
|
-
from chemotools.scatter import (
|
25
|
-
ExtendedMultiplicativeScatterCorrection,
|
26
|
-
MultiplicativeScatterCorrection,
|
27
|
-
RobustNormalVariate,
|
28
|
-
StandardNormalVariate,
|
29
|
-
)
|
30
|
-
from chemotools.smooth import (
|
31
|
-
MeanFilter,
|
32
|
-
MedianFilter,
|
33
|
-
SavitzkyGolayFilter,
|
34
|
-
WhittakerSmooth,
|
35
|
-
)
|
36
|
-
from chemotools.feature_selection import RangeCut, IndexSelector
|
37
|
-
|
38
|
-
from tests.fixtures import spectrum
|
39
|
-
|
40
|
-
|
41
|
-
# AirPls
|
42
|
-
def test_compliance_air_pls():
|
43
|
-
# Arrange
|
44
|
-
transformer = AirPls()
|
45
|
-
# Act & Assert
|
46
|
-
check_estimator(transformer)
|
47
|
-
|
48
|
-
|
49
|
-
# ArPls
|
50
|
-
def test_compliance_ar_pls():
|
51
|
-
# Arrange
|
52
|
-
transformer = ArPls()
|
53
|
-
# Act & Assert
|
54
|
-
check_estimator(transformer)
|
55
|
-
|
56
|
-
|
57
|
-
# BaselineShift
|
58
|
-
def test_compliance_baseline_shift():
|
59
|
-
# Arrange
|
60
|
-
transformer = BaselineShift()
|
61
|
-
# Act & Assert
|
62
|
-
check_estimator(transformer)
|
63
|
-
|
64
|
-
|
65
|
-
# ConstantBaselineCorrection
|
66
|
-
def test_compliance_constant_baseline_correction():
|
67
|
-
# Arrange
|
68
|
-
transformer = ConstantBaselineCorrection()
|
69
|
-
# Act & Assert
|
70
|
-
check_estimator(transformer)
|
71
|
-
|
72
|
-
|
73
|
-
# CubicSplineCorrection
|
74
|
-
def test_compliance_cubic_spline_correction():
|
75
|
-
# Arrange
|
76
|
-
transformer = CubicSplineCorrection()
|
77
|
-
# Act & Assert
|
78
|
-
check_estimator(transformer)
|
79
|
-
|
80
|
-
|
81
|
-
# ExponentialNoise
|
82
|
-
def test_compliance_exponential_noise():
|
83
|
-
# Arrange
|
84
|
-
transformer = ExponentialNoise()
|
85
|
-
# Act & Assert
|
86
|
-
check_estimator(transformer)
|
87
|
-
|
88
|
-
|
89
|
-
# ExtendedMultiplicativeScatterCorrection
|
90
|
-
def test_compliance_extended_multiplicative_scatter_correction():
|
91
|
-
# Arrange
|
92
|
-
transformer = ExtendedMultiplicativeScatterCorrection()
|
93
|
-
# Act & Assert
|
94
|
-
check_estimator(transformer)
|
95
|
-
|
96
|
-
|
97
|
-
# IndexSelector
|
98
|
-
def test_compliance_index_selector():
|
99
|
-
# Arrange
|
100
|
-
transformer = IndexSelector()
|
101
|
-
# Act & Assert
|
102
|
-
check_estimator(transformer)
|
103
|
-
|
104
|
-
|
105
|
-
# IndexShift
|
106
|
-
def test_compliance_spectrum_shift():
|
107
|
-
# Arrange
|
108
|
-
transformer = IndexShift()
|
109
|
-
# Act & Assert
|
110
|
-
check_estimator(transformer)
|
111
|
-
|
112
|
-
# LinearCorrection
|
113
|
-
def test_compliance_linear_correction():
|
114
|
-
# Arrange
|
115
|
-
transformer = LinearCorrection()
|
116
|
-
# Act & Assert
|
117
|
-
check_estimator(transformer)
|
118
|
-
|
119
|
-
|
120
|
-
# LNormalize
|
121
|
-
def test_compliance_l_norm():
|
122
|
-
# Arrange
|
123
|
-
transformer = NormScaler()
|
124
|
-
# Act & Assert
|
125
|
-
check_estimator(transformer)
|
126
|
-
|
127
|
-
|
128
|
-
# MeanFilter
|
129
|
-
def test_compliance_mean_filter():
|
130
|
-
# Arrange
|
131
|
-
transformer = MeanFilter()
|
132
|
-
# Act & Assert
|
133
|
-
check_estimator(transformer)
|
134
|
-
|
135
|
-
|
136
|
-
# MedianFilter
|
137
|
-
def test_compliance_median_filter():
|
138
|
-
# Arrange
|
139
|
-
transformer = MedianFilter()
|
140
|
-
# Act & Assert
|
141
|
-
check_estimator(transformer)
|
142
|
-
|
143
|
-
|
144
|
-
# MinMaxNormalize
|
145
|
-
def test_compliance_min_max_norm():
|
146
|
-
# Arrange
|
147
|
-
transformer = MinMaxScaler()
|
148
|
-
# Act & Assert
|
149
|
-
check_estimator(transformer)
|
150
|
-
|
151
|
-
|
152
|
-
# MultiplicativeScatterCorrection
|
153
|
-
def test_compliance_multiplicative_scatter_correction():
|
154
|
-
# Arrange
|
155
|
-
transformer = MultiplicativeScatterCorrection()
|
156
|
-
# Act & Assert
|
157
|
-
check_estimator(transformer)
|
158
|
-
|
159
|
-
|
160
|
-
# NonNegative
|
161
|
-
def test_compliance_non_negative():
|
162
|
-
# Arrange
|
163
|
-
transformer = NonNegative()
|
164
|
-
# Act & Assert
|
165
|
-
check_estimator(transformer)
|
166
|
-
|
167
|
-
|
168
|
-
# NormalNoise
|
169
|
-
def test_compliance_normal_noise():
|
170
|
-
# Arrange
|
171
|
-
transformer = NormalNoise()
|
172
|
-
# Act & Assert
|
173
|
-
check_estimator(transformer)
|
174
|
-
|
175
|
-
|
176
|
-
# NorrisWilliams
|
177
|
-
def test_compliance_norris_williams():
|
178
|
-
# Arrange
|
179
|
-
transformer = NorrisWilliams()
|
180
|
-
# Act & Assert
|
181
|
-
check_estimator(transformer)
|
182
|
-
|
183
|
-
|
184
|
-
# NorrisWilliams
|
185
|
-
def test_compliance_norris_williams_2():
|
186
|
-
# Arrange
|
187
|
-
transformer = NorrisWilliams(derivative_order=2)
|
188
|
-
# Act & Assert
|
189
|
-
check_estimator(transformer)
|
190
|
-
|
191
|
-
|
192
|
-
# PointScaler
|
193
|
-
def test_compliance_point_scaler():
|
194
|
-
# Arrange
|
195
|
-
transformer = PointScaler()
|
196
|
-
# Act & Assert
|
197
|
-
check_estimator(transformer)
|
198
|
-
|
199
|
-
|
200
|
-
# PolynomialCorrection
|
201
|
-
def test_compliance_polynomial_correction():
|
202
|
-
# Arrange
|
203
|
-
transformer = PolynomialCorrection()
|
204
|
-
# Act & Assert
|
205
|
-
check_estimator(transformer)
|
206
|
-
|
207
|
-
|
208
|
-
# RangeCut
|
209
|
-
def test_compliance_range_cut():
|
210
|
-
# Arrange
|
211
|
-
transformer = RangeCut()
|
212
|
-
# Act & Assert
|
213
|
-
check_estimator(transformer)
|
214
|
-
|
215
|
-
|
216
|
-
# RobustNormalVariate
|
217
|
-
def test_compliance_robust_normal_variate():
|
218
|
-
# Arrange
|
219
|
-
transformer = RobustNormalVariate()
|
220
|
-
# Act & Assert
|
221
|
-
check_estimator(transformer)
|
222
|
-
|
223
|
-
|
224
|
-
# SavitzkyGolay
|
225
|
-
def test_compliance_savitzky_golay():
|
226
|
-
# Arrange
|
227
|
-
transformer = SavitzkyGolay()
|
228
|
-
# Act & Assert
|
229
|
-
check_estimator(transformer)
|
230
|
-
|
231
|
-
|
232
|
-
# SavitzkyGolayFilter
|
233
|
-
def test_compliance_savitzky_golay_filter():
|
234
|
-
# Arrange
|
235
|
-
transformer = SavitzkyGolayFilter()
|
236
|
-
# Act & Assert
|
237
|
-
check_estimator(transformer)
|
238
|
-
|
239
|
-
|
240
|
-
# SpectrumScale
|
241
|
-
def test_compliance_spectrum_scale():
|
242
|
-
# Arrange
|
243
|
-
transformer = SpectrumScale()
|
244
|
-
# Act & Assert
|
245
|
-
check_estimator(transformer)
|
246
|
-
|
247
|
-
|
248
|
-
# StandardNormalVariate
|
249
|
-
def test_compliance_standard_normal_variate():
|
250
|
-
# Arrange
|
251
|
-
transformer = StandardNormalVariate()
|
252
|
-
# Act & Assert
|
253
|
-
check_estimator(transformer)
|
254
|
-
|
255
|
-
|
256
|
-
# SubtractReference
|
257
|
-
def test_compliance_subtract_reference():
|
258
|
-
# Arrange
|
259
|
-
transformer = SubtractReference()
|
260
|
-
# Act & Assert
|
261
|
-
check_estimator(transformer)
|
262
|
-
|
263
|
-
|
264
|
-
# UniformNoise
|
265
|
-
def test_compliance_uniform_noise():
|
266
|
-
# Arrange
|
267
|
-
transformer = UniformNoise()
|
268
|
-
# Act & Assert
|
269
|
-
check_estimator(transformer)
|
270
|
-
|
271
|
-
|
272
|
-
# WhittakerSmooth
|
273
|
-
def test_compliance_whittaker_smooth():
|
274
|
-
# Arrange
|
275
|
-
transformer = WhittakerSmooth()
|
276
|
-
# Act & Assert
|
277
|
-
check_estimator(transformer)
|
File without changes
|