chemotools 0.1.17__tar.gz → 0.1.18__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.17 → chemotools-0.1.18}/.github/workflows/python-release.yml +1 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/PKG-INFO +1 -9
- {chemotools-0.1.17 → chemotools-0.1.18}/pyproject.toml +4 -4
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/outliers/test_leverage.py +3 -3
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/outliers/test_residuals.py +24 -24
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/outliers/test_studentized_residuals.py +12 -12
- {chemotools-0.1.17 → chemotools-0.1.18}/uv.lock +129 -125
- {chemotools-0.1.17 → chemotools-0.1.18}/.gitattributes +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/.github/dependabot.yml +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/.github/labels.yml +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/.github/release-drafter.yml +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/.github/workflows/ci.yml +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/.github/workflows/release-drafter.yml +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/.gitignore +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/CODE_OF_CONDUCT.md +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/CONTRIBUTING.md +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/LICENSE +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/README.md +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/SECURITY.md +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/Taskfile.yml +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/assets/images/banner_dark.png +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/assets/images/banner_light.png +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/assets/images/logo_pixel.png +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/augmentation/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/augmentation/_add_noise.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/augmentation/_baseline_shift.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/augmentation/_fractional_shift.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/augmentation/_gaussian_broadening.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/augmentation/_index_shift.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/augmentation/_spectrum_scale.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/baseline/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/baseline/_air_pls.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/baseline/_ar_pls.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/baseline/_constant_baseline_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/baseline/_cubic_spline_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/baseline/_linear_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/baseline/_non_negative.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/baseline/_polynomial_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/baseline/_subtract_reference.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/datasets/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/datasets/_base.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/datasets/data/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/datasets/data/coffee_labels.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/datasets/data/coffee_spectra.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/datasets/data/fermentation_hplc.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/datasets/data/fermentation_spectra.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/datasets/data/train_hplc.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/datasets/data/train_spectra.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/derivative/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/derivative/_norris_william.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/derivative/_savitzky_golay.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/feature_selection/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/feature_selection/_base.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/feature_selection/_index_selector.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/feature_selection/_range_cut.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/feature_selection/_sr_selector.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/feature_selection/_vip_selector.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/outliers/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/outliers/_base.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/outliers/dmodx.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/outliers/hotelling_t2.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/outliers/leverage.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/outliers/q_residuals.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/outliers/studentized_residuals.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/outliers/utils.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/scale/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/scale/_min_max_scaler.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/scale/_norm_scaler.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/scale/_point_scaler.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/scatter/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/scatter/_extended_multiplicative_scatter_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/scatter/_multiplicative_scatter_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/scatter/_robust_normal_variate.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/scatter/_standard_normal_variate.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/smooth/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/smooth/_mean_filter.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/smooth/_median_filter.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/smooth/_savitzky_golay_filter.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/smooth/_whittaker_smooth.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/chemotools/utils/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/__init__.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/augmentation/test_add_noise.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/augmentation/test_baseline_shift.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/augmentation/test_fractional_shift.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/augmentation/test_gaussian_broadening.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/augmentation/test_index_shift.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/augmentation/test_spectrum_scale.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/baseline/test_air_pls.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/baseline/test_ar_pls.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/baseline/test_constant_baseline.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/baseline/test_cubic_spline_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/baseline/test_linear_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/baseline/test_non_negative.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/baseline/test_polynomial_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/baseline/test_subtract_reference.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/conftest.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/datasets/test_datasets.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/derivative/test_norris_williams.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/derivative/test_savitzky_golay.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/feature_selection/test_index_selector.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/feature_selection/test_range_cut.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/feature_selection/test_sr_selector.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/feature_selection/test_vip_selector.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/outliers/test_base.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/resources/reference_airpls.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/resources/reference_arpls.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/resources/reference_msc_mean.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/resources/reference_msc_median.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/resources/reference_sg_15_2.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/resources/reference_snv.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/resources/reference_whittaker.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/resources/spectrum.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/resources/spectrum_arpls.csv +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/scale/test_min_max_scaler.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/scale/test_norm_scaler.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/scale/test_point_scaler.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/scatter/test_extended_multiplicative_scatter_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/scatter/test_multiplicative_scatter_correction.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/scatter/test_robust_normal_variate.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/scatter/test_standard_normal_variate.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/smooth/test_mean_filter.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/smooth/test_median_filter.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/smooth/test_savitzky_golay_filter.py +0 -0
- {chemotools-0.1.17 → chemotools-0.1.18}/tests/smooth/test_whittaker_smooth.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: chemotools
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.18
|
4
4
|
Summary: chemotools: A Python Package that Integrates Chemometrics and scikit-learn
|
5
5
|
Author: Pau Cabaneros
|
6
6
|
License-Expression: MIT
|
@@ -11,14 +11,6 @@ Requires-Dist: pandas<3,>=2.0.0
|
|
11
11
|
Requires-Dist: polars<2,>=1.17.0
|
12
12
|
Requires-Dist: pyarrow<21,>=18
|
13
13
|
Requires-Dist: scikit-learn<2,>=1.4.0
|
14
|
-
Provides-Extra: dev
|
15
|
-
Requires-Dist: cyclonedx-bom>=7.1.0; extra == 'dev'
|
16
|
-
Requires-Dist: mypy<2,>=1.13.0; extra == 'dev'
|
17
|
-
Requires-Dist: pandas-stubs<3,>=2.2.3.241126; extra == 'dev'
|
18
|
-
Requires-Dist: pytest-cov>=6.3.0; extra == 'dev'
|
19
|
-
Requires-Dist: pytest<9,>=8.3.0; extra == 'dev'
|
20
|
-
Requires-Dist: ruff<0.9,>=0.8.0; extra == 'dev'
|
21
|
-
Requires-Dist: scipy-stubs<2,>=1.15.1.0; extra == 'dev'
|
22
14
|
Description-Content-Type: text/markdown
|
23
15
|
|
24
16
|

|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "chemotools"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.18"
|
4
4
|
description = "chemotools: A Python Package that Integrates Chemometrics and scikit-learn"
|
5
5
|
authors = [{ name = "Pau Cabaneros" }]
|
6
6
|
requires-python = ">=3.10"
|
@@ -14,12 +14,12 @@ dependencies = [
|
|
14
14
|
"scikit-learn>=1.4.0,<2",
|
15
15
|
]
|
16
16
|
|
17
|
-
[
|
17
|
+
[dependency-groups]
|
18
18
|
dev = [
|
19
19
|
"cyclonedx-bom>=7.1.0",
|
20
|
-
"pytest>=8.3.0
|
20
|
+
"pytest>=8.3.0",
|
21
21
|
"pytest-cov>=6.3.0",
|
22
|
-
"ruff>=0.
|
22
|
+
"ruff>=0.10.0",
|
23
23
|
"mypy>=1.13.0,<2",
|
24
24
|
"pandas-stubs>=2.2.3.241126,<3",
|
25
25
|
"scipy-stubs>=1.15.1.0,<2",
|
@@ -16,8 +16,8 @@ def test_leverage_calculation(dummy_data_loader):
|
|
16
16
|
# Assert
|
17
17
|
assert np.all(leverages >= 0), "Leverage values should be positive"
|
18
18
|
assert np.sum(leverages) == 1, "Sum of leverage values should be 1"
|
19
|
-
assert np.isclose(
|
20
|
-
|
21
|
-
)
|
19
|
+
assert np.isclose(np.mean(leverages), 1 / len(X)), (
|
20
|
+
"Mean of leverage values should be 1/n_samples"
|
21
|
+
)
|
22
22
|
assert np.isclose(leverages[0], 0.02940591986082612), "Leverage value mismatch"
|
23
23
|
assert np.isclose(leverages[-1], 0.02936313351948305), "Leverage value mismatch"
|
@@ -90,32 +90,32 @@ def test_outlier_detection_models(
|
|
90
90
|
prediction_outlier = model.predict_residuals(test_point_outlier)[0]
|
91
91
|
|
92
92
|
# Assert model attributes
|
93
|
-
assert (
|
94
|
-
|
95
|
-
)
|
96
|
-
assert np.isclose(
|
97
|
-
|
98
|
-
)
|
93
|
+
assert model.confidence == kwargs["confidence"], (
|
94
|
+
"Confidence value should match input"
|
95
|
+
)
|
96
|
+
assert np.isclose(model.critical_value_, expected_critical_value), (
|
97
|
+
f"Critical value mismatch for {model_class.__name__} with {n_components} components"
|
98
|
+
)
|
99
99
|
assert model.n_features_in_ == 3, "Number of input features should be 3"
|
100
|
-
assert (
|
101
|
-
model
|
102
|
-
)
|
100
|
+
assert model.n_components_ == n_components, (
|
101
|
+
f"Number of model components should be {n_components}"
|
102
|
+
)
|
103
103
|
assert model.n_samples_ == 100, "Number of samples should be 100"
|
104
104
|
|
105
105
|
# Assert predictions
|
106
|
-
assert (
|
107
|
-
|
108
|
-
)
|
109
|
-
assert prediction_inlier < np.max(
|
110
|
-
|
111
|
-
)
|
112
|
-
assert np.isclose(
|
113
|
-
|
114
|
-
)
|
106
|
+
assert prediction_inlier < model.critical_value_, (
|
107
|
+
"Test point should not be an outlier"
|
108
|
+
)
|
109
|
+
assert prediction_inlier < np.max(residuals), (
|
110
|
+
"Prediction should be within residual range"
|
111
|
+
)
|
112
|
+
assert np.isclose(prediction_inlier, expected_prediction_inlier), (
|
113
|
+
"Prediction value mismatch"
|
114
|
+
)
|
115
115
|
assert prediction_outlier > model.critical_value_, "Test point should be an outlier"
|
116
|
-
assert prediction_outlier > np.max(
|
117
|
-
|
118
|
-
)
|
119
|
-
assert np.isclose(
|
120
|
-
|
121
|
-
)
|
116
|
+
assert prediction_outlier > np.max(residuals), (
|
117
|
+
"Prediction should be outside residual range"
|
118
|
+
)
|
119
|
+
assert np.isclose(prediction_outlier, expected_prediction_outlier), (
|
120
|
+
"Prediction value mismatch"
|
121
|
+
)
|
@@ -15,16 +15,16 @@ def test_studentized_residuals(dummy_data_loader):
|
|
15
15
|
studentized_residuals = stu_residuals.predict_residuals(X, y)
|
16
16
|
|
17
17
|
# Assert
|
18
|
-
assert np.isclose(
|
19
|
-
|
20
|
-
)
|
21
|
-
assert np.isclose(
|
22
|
-
|
23
|
-
)
|
24
|
-
assert np.isclose(
|
25
|
-
|
26
|
-
)
|
27
|
-
assert np.isclose(
|
28
|
-
|
29
|
-
)
|
18
|
+
assert np.isclose(np.mean(studentized_residuals), 0, atol=0.001), (
|
19
|
+
"Mean of studentized residuals should be 0"
|
20
|
+
)
|
21
|
+
assert np.isclose(np.std(studentized_residuals), 1, atol=0.001), (
|
22
|
+
"Standard deviation of studentized residuals should be 1"
|
23
|
+
)
|
24
|
+
assert np.isclose(studentized_residuals[0], -1.16998195, atol=0.001), (
|
25
|
+
"Studentized residual value mismatch"
|
26
|
+
)
|
27
|
+
assert np.isclose(studentized_residuals[-1], 1.17827456, atol=0.001), (
|
28
|
+
"Studentized residual value mismatch"
|
29
|
+
)
|
30
30
|
assert studentized_residuals.shape == (100,), "Studentized residuals shape mismatch"
|