chemotools 0.1.16__tar.gz → 0.1.17rc0__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.
Files changed (125) hide show
  1. {chemotools-0.1.16 → chemotools-0.1.17rc0}/.github/workflows/python-release.yml +14 -1
  2. {chemotools-0.1.16 → chemotools-0.1.17rc0}/PKG-INFO +1 -8
  3. {chemotools-0.1.16 → chemotools-0.1.17rc0}/pyproject.toml +7 -4
  4. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/outliers/test_leverage.py +3 -3
  5. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/outliers/test_residuals.py +24 -24
  6. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/outliers/test_studentized_residuals.py +12 -12
  7. {chemotools-0.1.16 → chemotools-0.1.17rc0}/uv.lock +682 -124
  8. {chemotools-0.1.16 → chemotools-0.1.17rc0}/.gitattributes +0 -0
  9. {chemotools-0.1.16 → chemotools-0.1.17rc0}/.github/dependabot.yml +0 -0
  10. {chemotools-0.1.16 → chemotools-0.1.17rc0}/.github/labels.yml +0 -0
  11. {chemotools-0.1.16 → chemotools-0.1.17rc0}/.github/release-drafter.yml +0 -0
  12. {chemotools-0.1.16 → chemotools-0.1.17rc0}/.github/workflows/ci.yml +0 -0
  13. {chemotools-0.1.16 → chemotools-0.1.17rc0}/.github/workflows/release-drafter.yml +0 -0
  14. {chemotools-0.1.16 → chemotools-0.1.17rc0}/.gitignore +0 -0
  15. {chemotools-0.1.16 → chemotools-0.1.17rc0}/CODE_OF_CONDUCT.md +0 -0
  16. {chemotools-0.1.16 → chemotools-0.1.17rc0}/CONTRIBUTING.md +0 -0
  17. {chemotools-0.1.16 → chemotools-0.1.17rc0}/LICENSE +0 -0
  18. {chemotools-0.1.16 → chemotools-0.1.17rc0}/README.md +0 -0
  19. {chemotools-0.1.16 → chemotools-0.1.17rc0}/SECURITY.md +0 -0
  20. {chemotools-0.1.16 → chemotools-0.1.17rc0}/Taskfile.yml +0 -0
  21. {chemotools-0.1.16 → chemotools-0.1.17rc0}/assets/images/banner_dark.png +0 -0
  22. {chemotools-0.1.16 → chemotools-0.1.17rc0}/assets/images/banner_light.png +0 -0
  23. {chemotools-0.1.16 → chemotools-0.1.17rc0}/assets/images/logo_pixel.png +0 -0
  24. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/__init__.py +0 -0
  25. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/augmentation/__init__.py +0 -0
  26. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/augmentation/_add_noise.py +0 -0
  27. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/augmentation/_baseline_shift.py +0 -0
  28. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/augmentation/_fractional_shift.py +0 -0
  29. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/augmentation/_gaussian_broadening.py +0 -0
  30. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/augmentation/_index_shift.py +0 -0
  31. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/augmentation/_spectrum_scale.py +0 -0
  32. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/baseline/__init__.py +0 -0
  33. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/baseline/_air_pls.py +0 -0
  34. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/baseline/_ar_pls.py +0 -0
  35. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/baseline/_constant_baseline_correction.py +0 -0
  36. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/baseline/_cubic_spline_correction.py +0 -0
  37. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/baseline/_linear_correction.py +0 -0
  38. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/baseline/_non_negative.py +0 -0
  39. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/baseline/_polynomial_correction.py +0 -0
  40. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/baseline/_subtract_reference.py +0 -0
  41. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/datasets/__init__.py +0 -0
  42. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/datasets/_base.py +0 -0
  43. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/datasets/data/__init__.py +0 -0
  44. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/datasets/data/coffee_labels.csv +0 -0
  45. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/datasets/data/coffee_spectra.csv +0 -0
  46. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/datasets/data/fermentation_hplc.csv +0 -0
  47. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/datasets/data/fermentation_spectra.csv +0 -0
  48. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/datasets/data/train_hplc.csv +0 -0
  49. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/datasets/data/train_spectra.csv +0 -0
  50. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/derivative/__init__.py +0 -0
  51. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/derivative/_norris_william.py +0 -0
  52. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/derivative/_savitzky_golay.py +0 -0
  53. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/feature_selection/__init__.py +0 -0
  54. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/feature_selection/_base.py +0 -0
  55. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/feature_selection/_index_selector.py +0 -0
  56. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/feature_selection/_range_cut.py +0 -0
  57. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/feature_selection/_sr_selector.py +0 -0
  58. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/feature_selection/_vip_selector.py +0 -0
  59. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/outliers/__init__.py +0 -0
  60. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/outliers/_base.py +0 -0
  61. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/outliers/dmodx.py +0 -0
  62. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/outliers/hotelling_t2.py +0 -0
  63. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/outliers/leverage.py +0 -0
  64. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/outliers/q_residuals.py +0 -0
  65. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/outliers/studentized_residuals.py +0 -0
  66. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/outliers/utils.py +0 -0
  67. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/scale/__init__.py +0 -0
  68. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/scale/_min_max_scaler.py +0 -0
  69. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/scale/_norm_scaler.py +0 -0
  70. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/scale/_point_scaler.py +0 -0
  71. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/scatter/__init__.py +0 -0
  72. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/scatter/_extended_multiplicative_scatter_correction.py +0 -0
  73. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/scatter/_multiplicative_scatter_correction.py +0 -0
  74. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/scatter/_robust_normal_variate.py +0 -0
  75. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/scatter/_standard_normal_variate.py +0 -0
  76. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/smooth/__init__.py +0 -0
  77. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/smooth/_mean_filter.py +0 -0
  78. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/smooth/_median_filter.py +0 -0
  79. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/smooth/_savitzky_golay_filter.py +0 -0
  80. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/smooth/_whittaker_smooth.py +0 -0
  81. {chemotools-0.1.16 → chemotools-0.1.17rc0}/chemotools/utils/__init__.py +0 -0
  82. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/__init__.py +0 -0
  83. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/augmentation/test_add_noise.py +0 -0
  84. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/augmentation/test_baseline_shift.py +0 -0
  85. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/augmentation/test_fractional_shift.py +0 -0
  86. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/augmentation/test_gaussian_broadening.py +0 -0
  87. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/augmentation/test_index_shift.py +0 -0
  88. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/augmentation/test_spectrum_scale.py +0 -0
  89. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/baseline/test_air_pls.py +0 -0
  90. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/baseline/test_ar_pls.py +0 -0
  91. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/baseline/test_constant_baseline.py +0 -0
  92. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/baseline/test_cubic_spline_correction.py +0 -0
  93. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/baseline/test_linear_correction.py +0 -0
  94. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/baseline/test_non_negative.py +0 -0
  95. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/baseline/test_polynomial_correction.py +0 -0
  96. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/baseline/test_subtract_reference.py +0 -0
  97. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/conftest.py +0 -0
  98. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/datasets/test_datasets.py +0 -0
  99. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/derivative/test_norris_williams.py +0 -0
  100. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/derivative/test_savitzky_golay.py +0 -0
  101. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/feature_selection/test_index_selector.py +0 -0
  102. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/feature_selection/test_range_cut.py +0 -0
  103. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/feature_selection/test_sr_selector.py +0 -0
  104. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/feature_selection/test_vip_selector.py +0 -0
  105. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/outliers/test_base.py +0 -0
  106. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/resources/reference_airpls.csv +0 -0
  107. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/resources/reference_arpls.csv +0 -0
  108. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/resources/reference_msc_mean.csv +0 -0
  109. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/resources/reference_msc_median.csv +0 -0
  110. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/resources/reference_sg_15_2.csv +0 -0
  111. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/resources/reference_snv.csv +0 -0
  112. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/resources/reference_whittaker.csv +0 -0
  113. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/resources/spectrum.csv +0 -0
  114. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/resources/spectrum_arpls.csv +0 -0
  115. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/scale/test_min_max_scaler.py +0 -0
  116. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/scale/test_norm_scaler.py +0 -0
  117. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/scale/test_point_scaler.py +0 -0
  118. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/scatter/test_extended_multiplicative_scatter_correction.py +0 -0
  119. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/scatter/test_multiplicative_scatter_correction.py +0 -0
  120. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/scatter/test_robust_normal_variate.py +0 -0
  121. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/scatter/test_standard_normal_variate.py +0 -0
  122. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/smooth/test_mean_filter.py +0 -0
  123. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/smooth/test_median_filter.py +0 -0
  124. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/smooth/test_savitzky_golay_filter.py +0 -0
  125. {chemotools-0.1.16 → chemotools-0.1.17rc0}/tests/smooth/test_whittaker_smooth.py +0 -0
@@ -9,6 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  environment: release
11
11
  permissions:
12
+ contents: read
12
13
  id-token: write
13
14
 
14
15
  steps:
@@ -44,4 +45,16 @@ jobs:
44
45
 
45
46
  # 3. Publish to PyPI
46
47
  - name: Publish package distributions to PyPI
47
- uses: pypa/gh-action-pypi-publish@release/v1
48
+ uses: pypa/gh-action-pypi-publish@release/v1
49
+
50
+ # 4. Create SBOM
51
+ - name: Create SBOM and attach to the release
52
+ run: uv run cyclonedx-py 'environment' --output-format=json --output-file=chemotools-${{ github.event.release.tag_name }}-sbom.json
53
+
54
+ # 5. Upload SBOM as a release asset
55
+ - name: Upload SBOM to release
56
+ uses: softprops/action-gh-release@v1
57
+ with:
58
+ files: chemotools-${{ github.event.release.tag_name }}-sbom.json
59
+ env:
60
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chemotools
3
- Version: 0.1.16
3
+ Version: 0.1.17rc0
4
4
  Summary: chemotools: A Python Package that Integrates Chemometrics and scikit-learn
5
5
  Author: Pau Cabaneros
6
6
  License-Expression: MIT
@@ -11,13 +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: mypy<2,>=1.13.0; extra == 'dev'
16
- Requires-Dist: pandas-stubs<3,>=2.2.3.241126; extra == 'dev'
17
- Requires-Dist: pytest-cov>=6.3.0; extra == 'dev'
18
- Requires-Dist: pytest<9,>=8.3.0; extra == 'dev'
19
- Requires-Dist: ruff<0.9,>=0.8.0; extra == 'dev'
20
- Requires-Dist: scipy-stubs<2,>=1.15.1.0; extra == 'dev'
21
14
  Description-Content-Type: text/markdown
22
15
 
23
16
  ![chemotools](assets/images/banner_dark.png)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "chemotools"
3
- version = "0.1.16"
3
+ version = "0.1.17c"
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,11 +14,12 @@ dependencies = [
14
14
  "scikit-learn>=1.4.0,<2",
15
15
  ]
16
16
 
17
- [project.optional-dependencies]
17
+ [dependency-groups]
18
18
  dev = [
19
- "pytest>=8.3.0,<9",
19
+ "cyclonedx-bom>=7.1.0",
20
+ "pytest>=8.3.0",
20
21
  "pytest-cov>=6.3.0",
21
- "ruff>=0.8.0,<0.9",
22
+ "ruff>=0.10.0",
22
23
  "mypy>=1.13.0,<2",
23
24
  "pandas-stubs>=2.2.3.241126,<3",
24
25
  "scipy-stubs>=1.15.1.0,<2",
@@ -38,3 +39,5 @@ filterwarnings = "always"
38
39
  module = ["sklearn", "sklearn.*", "setuptools", "setuptools.*"]
39
40
  ignore_missing_imports = true
40
41
 
42
+
43
+
@@ -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
- np.mean(leverages), 1 / len(X)
21
- ), "Mean of leverage values should be 1/n_samples"
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
- model.confidence == kwargs["confidence"]
95
- ), "Confidence value should match input"
96
- assert np.isclose(
97
- model.critical_value_, expected_critical_value
98
- ), f"Critical value mismatch for {model_class.__name__} with {n_components} components"
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.n_components_ == n_components
102
- ), f"Number of model components should be {n_components}"
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
- prediction_inlier < model.critical_value_
108
- ), "Test point should not be an outlier"
109
- assert prediction_inlier < np.max(
110
- residuals
111
- ), "Prediction should be within residual range"
112
- assert np.isclose(
113
- prediction_inlier, expected_prediction_inlier
114
- ), "Prediction value mismatch"
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
- residuals
118
- ), "Prediction should be outside residual range"
119
- assert np.isclose(
120
- prediction_outlier, expected_prediction_outlier
121
- ), "Prediction value mismatch"
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
- np.mean(studentized_residuals), 0, atol=0.001
20
- ), "Mean of studentized residuals should be 0"
21
- assert np.isclose(
22
- np.std(studentized_residuals), 1, atol=0.001
23
- ), "Standard deviation of studentized residuals should be 1"
24
- assert np.isclose(
25
- studentized_residuals[0], -1.16998195, atol=0.001
26
- ), "Studentized residual value mismatch"
27
- assert np.isclose(
28
- studentized_residuals[-1], 1.17827456, atol=0.001
29
- ), "Studentized residual value mismatch"
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"