Skip to content

Commit

Permalink
rangecut implements wavenumbers_ when cut
Browse files Browse the repository at this point in the history
  • Loading branch information
paucablop committed Jan 11, 2024
1 parent c5d6059 commit 53f4798
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions chemotools/feature_selection/_range_cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def fit(self, X: np.ndarray, y=None) -> "RangeCut":
else:
self.start_index_ = self._find_index(self.start)
self.end_index_ = self._find_index(self.end)
self.wavenumbers_ = self.wavenumbers[self.start_index_ : self.end_index_]

return self

Expand Down
1 change: 1 addition & 0 deletions tests/test_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ def test_range_cut_by_wavenumber_with_list():

# Assert
assert np.allclose(spectrum_corrected[0], spectrum[0][1:7], atol=1e-8)
assert range_cut.wavenumbers_ == [2, 3, 4, 5, 6, 7]


def test_range_cut_by_wavenumber_with_dataframe():
Expand Down

0 comments on commit 53f4798

Please sign in to comment.