chemotools 0.1.3__py3-none-any.whl → 0.1.4__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.
@@ -11,10 +11,10 @@ class UniformNoise(OneToOneFeatureMixin, BaseEstimator, TransformerMixin):
11
11
 
12
12
  Parameters
13
13
  ----------
14
- low : float, default=0.0
14
+ min : float, default=0.0
15
15
  The lower bound of the uniform distribution.
16
16
 
17
- high : float, default=0.0
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, low: float = 0.0, high: float = 0.0, random_state: int = None):
42
- self.low = low
43
- self.high = high
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.low, self.high, size=x.shape)
112
+ return x + self._rng.uniform(self.min, self.max, size=x.shape)
@@ -78,6 +78,7 @@ class RangeCut(BaseEstimator, SelectorMixin):
78
78
  else:
79
79
  self.start_index_ = self._find_index(self.start)
80
80
  self.end_index_ = self._find_index(self.end)
81
+ self.wavenumbers_ = self.wavenumbers[self.start_index_ : self.end_index_]
81
82
 
82
83
  return self
83
84
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chemotools
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Package to integrate chemometrics in scikit-learn pipelines
5
5
  Home-page: https://github.com/paucablop/chemotools
6
6
  Author: Pau Cabaneros Lopez
@@ -5,7 +5,7 @@ chemotools/augmentation/exponential_noise.py,sha256=X2HTpL9zoiu0cFq3VsTxS3x_IO_t
5
5
  chemotools/augmentation/index_shift.py,sha256=7ujZ_sz4mWEUJMDCHyaLxhTZ5-_K3nQPwtk6y6SLR9Q,3198
6
6
  chemotools/augmentation/normal_noise.py,sha256=NmzTuIJKyk6tfDJgmeX9iAzsKlJJk3984tS8nLLG9dg,3051
7
7
  chemotools/augmentation/spectrum_scale.py,sha256=WgMw_bCxWbyAYgYBO3q4PbbzcTDyBvVD73kxPfj3cdY,3174
8
- chemotools/augmentation/uniform_noise.py,sha256=gc0WdREItRiPHjNiZg79n0yK6bfntXkcImrEjkoRdus,3180
8
+ chemotools/augmentation/uniform_noise.py,sha256=szGhk9T7SDe_6v5N8n8ztf7lxHVMiqqzrgL0JGHystw,3175
9
9
  chemotools/baseline/__init__.py,sha256=LFhsmzqv9RYxDS5-vK9jIf3ArNUSZ6yOF4SeUyVF6iA,381
10
10
  chemotools/baseline/_air_pls.py,sha256=bYAjemEWZr7oiYJegO0r5gtO16zr0BdJYjmEikA1yBc,5116
11
11
  chemotools/baseline/_ar_pls.py,sha256=tZi-89GMIStZUufz9AXVHU6TC1J6fAX4M1rAaIqgSvE,4431
@@ -29,7 +29,7 @@ chemotools/derivative/_norris_william.py,sha256=NKmuo95vNWHQOdcww7APU9Z4s1wWExIR
29
29
  chemotools/derivative/_savitzky_golay.py,sha256=5At4sexJH0RvjkrvVfJvhIfaxXD3vE4Ozq1VClb3qlU,3417
30
30
  chemotools/feature_selection/__init__.py,sha256=p47SuyI7jMpV7kiaAsv2hA20smKf5Yo6447LfrNdDhY,76
31
31
  chemotools/feature_selection/_index_selector.py,sha256=2z2aAyMUOuP7x1n19RV5JGf6ZcM3mtJZby8tEgBOix4,3379
32
- chemotools/feature_selection/_range_cut.py,sha256=HI2OoeQYNph9uBICSA1cF2C_u-0UjTf0FDv5093tTnU,3223
32
+ chemotools/feature_selection/_range_cut.py,sha256=gcKjmCGn0SwKRHck3QIrqWN3q-S9qRgGlSbqzaOxG7Y,3309
33
33
  chemotools/scale/__init__.py,sha256=CQPUPx-8pUeHHbN9p5smFro3xtl_UEE0YeXHLVd7Lfk,118
34
34
  chemotools/scale/_min_max_scaler.py,sha256=-Wnr7zW-zmW6nR5J5yPdBm1KNuQDa9w27Un7rAr-s8E,2806
35
35
  chemotools/scale/_norm_scaler.py,sha256=bjMg1-x2I1xZmmbIgl4vXZZweJV-w3Euta0KGff_2Gk,2363
@@ -49,10 +49,10 @@ chemotools/utils/check_inputs.py,sha256=fRAV4HIaGamdj_PNXSNnl7LurXytACNTGO51rhPp
49
49
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  tests/fixtures.py,sha256=Xa-Vd62Kd1fyWg3PLUSP6iIkOK8etrbyOkMJTn3dvX8,1933
51
51
  tests/test_datasets.py,sha256=_3mMDYC-vUnb5BenMqvuhmkHI2PPIdsyq_nNu2ggH20,1055
52
- tests/test_functionality.py,sha256=UhOYEShJZJOwROjNMf3UtXl5MrQBeQQbEMEt0ph7yQ0,21182
52
+ tests/test_functionality.py,sha256=cWFWSVTaEkMoZD1tB6-wfEXX59bEDzE8EVo0NcmEABw,21237
53
53
  tests/test_sklearn_compliance.py,sha256=CRB_0X9HRGj0pOpUCmiSHwJkCsVB-yK_apsyUONmfmw,5856
54
- chemotools-0.1.3.dist-info/LICENSE,sha256=qtyOy2wDQVX9hxp58h3T-6Lmfv-mSCHoSRkcLUdM9bg,1070
55
- chemotools-0.1.3.dist-info/METADATA,sha256=K_8Kuy1_hHBEK3p1WSMLfR0NfHuptAzCa5uijUT6RLc,5018
56
- chemotools-0.1.3.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
57
- chemotools-0.1.3.dist-info/top_level.txt,sha256=eNcNcKSdo-1H_2gwSDrS__dr7BM3R73Cnn-pBiW5FEw,17
58
- chemotools-0.1.3.dist-info/RECORD,,
54
+ chemotools-0.1.4.dist-info/LICENSE,sha256=qtyOy2wDQVX9hxp58h3T-6Lmfv-mSCHoSRkcLUdM9bg,1070
55
+ chemotools-0.1.4.dist-info/METADATA,sha256=TawdLG6hGhatxlxsWZ4ZoQO3FZIBhJdcgBfi6_P4CxA,5018
56
+ chemotools-0.1.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
57
+ chemotools-0.1.4.dist-info/top_level.txt,sha256=eNcNcKSdo-1H_2gwSDrS__dr7BM3R73Cnn-pBiW5FEw,17
58
+ chemotools-0.1.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.3)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -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(low=-1, high=1, random_state=42)
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)