chemotools 0.1.3__tar.gz → 0.1.4__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.
- {chemotools-0.1.3 → chemotools-0.1.4}/PKG-INFO +1 -1
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/augmentation/uniform_noise.py +6 -6
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/feature_selection/_range_cut.py +1 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools.egg-info/PKG-INFO +1 -1
- {chemotools-0.1.3 → chemotools-0.1.4}/tests/test_functionality.py +2 -1
- {chemotools-0.1.3 → chemotools-0.1.4}/LICENSE +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/README.md +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/augmentation/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/augmentation/baseline_shift.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/augmentation/exponential_noise.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/augmentation/index_shift.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/augmentation/normal_noise.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/augmentation/spectrum_scale.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/baseline/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/baseline/_air_pls.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/baseline/_ar_pls.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/baseline/_constant_baseline_correction.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/baseline/_cubic_spline_correction.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/baseline/_linear_correction.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/baseline/_non_negative.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/baseline/_polynomial_correction.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/baseline/_subtract_reference.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/datasets/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/datasets/_base.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/datasets/data/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/datasets/data/coffee_labels.csv +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/datasets/data/coffee_spectra.csv +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/datasets/data/fermentation_hplc.csv +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/datasets/data/fermentation_spectra.csv +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/datasets/data/train_hplc.csv +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/datasets/data/train_spectra.csv +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/derivative/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/derivative/_norris_william.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/derivative/_savitzky_golay.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/feature_selection/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/feature_selection/_index_selector.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scale/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scale/_min_max_scaler.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scale/_norm_scaler.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scale/_point_scaler.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scatter/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scatter/_extended_multiplicative_scatter_correction.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scatter/_multiplicative_scatter_correction.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scatter/_robust_normal_variate.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scatter/_standard_normal_variate.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/smooth/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/smooth/_mean_filter.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/smooth/_median_filter.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/smooth/_savitzky_golay_filter.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/smooth/_whittaker_smooth.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/utils/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools/utils/check_inputs.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools.egg-info/SOURCES.txt +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools.egg-info/dependency_links.txt +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools.egg-info/requires.txt +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/chemotools.egg-info/top_level.txt +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/pyproject.toml +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/setup.cfg +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/setup.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/tests/__init__.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/tests/fixtures.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/tests/test_datasets.py +0 -0
- {chemotools-0.1.3 → chemotools-0.1.4}/tests/test_sklearn_compliance.py +0 -0
@@ -11,10 +11,10 @@ class UniformNoise(OneToOneFeatureMixin, BaseEstimator, TransformerMixin):
|
|
11
11
|
|
12
12
|
Parameters
|
13
13
|
----------
|
14
|
-
|
14
|
+
min : float, default=0.0
|
15
15
|
The lower bound of the uniform distribution.
|
16
16
|
|
17
|
-
|
17
|
+
max : float, default=0.0
|
18
18
|
The upper bound of the uniform distribution.
|
19
19
|
|
20
20
|
random_state : int, default=None
|
@@ -38,9 +38,9 @@ class UniformNoise(OneToOneFeatureMixin, BaseEstimator, TransformerMixin):
|
|
38
38
|
"""
|
39
39
|
|
40
40
|
|
41
|
-
def __init__(self,
|
42
|
-
self.
|
43
|
-
self.
|
41
|
+
def __init__(self, min: float = 0.0, max: float = 0.0, random_state: int = None):
|
42
|
+
self.min = min
|
43
|
+
self.max = max
|
44
44
|
self.random_state = random_state
|
45
45
|
|
46
46
|
def fit(self, X: np.ndarray, y=None) -> "UniformNoise":
|
@@ -109,4 +109,4 @@ class UniformNoise(OneToOneFeatureMixin, BaseEstimator, TransformerMixin):
|
|
109
109
|
return X_.reshape(-1, 1) if X_.ndim == 1 else X_
|
110
110
|
|
111
111
|
def _add_random_noise(self, x) -> np.ndarray:
|
112
|
-
return x + self._rng.uniform(self.
|
112
|
+
return x + self._rng.uniform(self.min, self.max, size=x.shape)
|
@@ -622,6 +622,7 @@ def test_range_cut_by_wavenumber_with_list():
|
|
622
622
|
|
623
623
|
# Assert
|
624
624
|
assert np.allclose(spectrum_corrected[0], spectrum[0][1:7], atol=1e-8)
|
625
|
+
assert range_cut.wavenumbers_ == [2, 3, 4, 5, 6, 7]
|
625
626
|
|
626
627
|
|
627
628
|
def test_range_cut_by_wavenumber_with_dataframe():
|
@@ -740,7 +741,7 @@ def test_subtract_reference_without_reference(spectrum):
|
|
740
741
|
def test_uniform_noise():
|
741
742
|
# Arrange
|
742
743
|
spectrum = np.ones(10000).reshape(1, -1)
|
743
|
-
uniform_noise = UniformNoise(
|
744
|
+
uniform_noise = UniformNoise(min=-1, max=1, random_state=42)
|
744
745
|
|
745
746
|
# Act
|
746
747
|
spectrum_corrected = uniform_noise.fit_transform(spectrum)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{chemotools-0.1.3 → chemotools-0.1.4}/chemotools/scatter/_multiplicative_scatter_correction.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|