Skip to content

Commit ed954c1

Browse files
authored
[CI] fix spelling mistakes in the codebase by adding codespell (#2550)
* Update .pre-commit-config.yaml * Create .codespellrc * Update .codespellrc * Update daal4py_data_science.ipynb * Update .codespellrc * Update format.py * Update dist_kmeans.h * Update map_reduce_tree.h * Update transceiver.h * Update base.py * Update test_n_jobs_support.py * Update base.py * Update _device_offload.py * Update forest.py * Update data_conversion.cpp * Update _data_conversion.py * Update dtype_conversion.cpp * Update sycl_usm_utils.cpp * Update common.py * Update test_common.py * Update _device_offload.py * Update dbscan.cpp * Update gen_daal4py.py * address spelling issues * last changes * Update dbscan.py * Update dbscan.py * Update decision_forest_classification_default_dense.py * Update decision_forest_classification_hist.py * Update decision_forest_regression_default_dense.py * Update decision_forest_regression_hist.py
1 parent b203abd commit ed954c1

74 files changed

Lines changed: 147 additions & 124 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.codespellrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
;
2+
; Copyright contributors to the oneDAL project
3+
;
4+
; Licensed under the Apache License, Version 2.0 (the "License");
5+
; you may not use this file except in compliance with the License.
6+
; You may obtain a copy of the License at
7+
;
8+
; http://www.apache.org/licenses/LICENSE-2.0
9+
;
10+
; Unless required by applicable law or agreed to in writing, software
11+
; distributed under the License is distributed on an "AS IS" BASIS,
12+
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
; See the License for the specific language governing permissions and
14+
; limitations under the License.
15+
;
16+
[codespell]
17+
skip = *.ipynb,
18+
ignore-words-list = als,coo,inout,nd,ons

.github/scripts/doc_release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ else
114114
rsync -av "$version_dir/" $version/
115115
done
116116

117-
# Git only add verison folders
117+
# Git only add version folders
118118
git add -- [0-9][0-9][0-9][0-9].[0-9]*
119119
git commit -m "Initialize doc archive branch with all versions"
120120
fi

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,8 @@ repos:
4242
scripts/|
4343
tests/
4444
)
45+
- repo: https://github.com/codespell-project/codespell
46+
rev: v2.4.1
47+
hooks:
48+
- id: codespell
49+
args: ["--config", ".github/.codespellrc" ]

daal4py/sklearn/cluster/dbscan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ def _daal_dbscan(X, eps=0.5, min_samples=5, sample_weight=None):
3636
ww = make2d(sample_weight) if sample_weight is not None else None
3737
XX = make2d(X)
3838

39-
fpt = getFPType(XX)
39+
fpt = getFPType(XX) # codespell:ignore fpt
4040
alg = daal4py.dbscan(
4141
method="defaultDense",
42-
fptype=fpt,
42+
fptype=fpt, # codespell:ignore fpt
4343
epsilon=float(eps),
4444
minObservations=int(min_samples),
4545
memorySavingMode=False,

daal4py/sklearn/manifold/_t_sne.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _fit(self, X, skip_num_points=0):
136136

137137
if isinstance(self._init, str) and self._init == "pca" and issparse(X):
138138
raise TypeError(
139-
"PCA initialization is currently not suported "
139+
"PCA initialization is currently not supported "
140140
"with the sparse input matrix. Use "
141141
'init="random" instead.'
142142
)

daal4py/sklearn/svm/svm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _daal4py_kf(kernel, X_fptype, gamma=1.0, is_sparse=False):
158158
kf = daal4py.kernel_function_linear(fptype=X_fptype, method=method)
159159
else:
160160
raise ValueError(
161-
"_daal4py_fit received unexpected kernel specifiction {}.".format(kernel)
161+
"_daal4py_fit received unexpected kernel specification {}.".format(kernel)
162162
)
163163

164164
return kf

daal4py/sklearn/tree/decision_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def fit(self, X, y, sample_weight=None, pruning_set=None):
160160
ignored if they would result in any single class carrying a
161161
negative weight in either child node.
162162
163-
pruning_set: None or a tuple of (X, y) corrsponding to features and
163+
pruning_set: None or a tuple of (X, y) corresponding to features and
164164
associated labels used for tree pruning. See [1] for more details.
165165
166166
Returns

daal4py/sklearn/utils/validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _assert_all_finite(
8989
num_of_types = get_number_of_types(X)
9090

9191
# if X is heterogeneous pandas.DataFrame then
92-
# covert it to a list of arrays
92+
# convert it to a list of arrays
9393
if is_df and num_of_types > 1:
9494
lst = []
9595
for idx in X:
@@ -329,7 +329,7 @@ def is_sparse(dtype):
329329
has_pd_integer_array = False
330330
if hasattr(array, "dtypes") and hasattr(array.dtypes, "__array__"):
331331
# throw warning if columns are sparse. If all columns are sparse, then
332-
# array.sparse exists and sparsity will be perserved (later).
332+
# array.sparse exists and sparsity will be preserved (later).
333333
with suppress(ImportError):
334334
from pandas import SparseDtype
335335

deselected_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ deselected_tests:
104104

105105
# Sklearnex RandomForestClassifier RNG is different from scikit-learn and daal4py
106106
# resulting in different feature importances for small number of trees (10).
107-
# Issue dissappears with bigger number of trees (>=20)
107+
# Issue disappears with bigger number of trees (>=20)
108108
- inspection/tests/test_permutation_importance.py::test_permutation_importance_correlated_feature_regression_pandas[0.5-1]
109109
- inspection/tests/test_permutation_importance.py::test_permutation_importance_correlated_feature_regression_pandas[0.5-2]
110110
- inspection/tests/test_permutation_importance.py::test_permutation_importance_correlated_feature_regression_pandas[1.0-1]

doc/sources/about_daal4py.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ of the |onedal|, while ``sklearnex`` is a module built atop of the "oneAPI" inte
3131
DPC-based features such as :ref:`GPU support <oneapi_gpu>`.
3232

3333
There is a large degree of overlap in the functionalities offered between the two modules
34-
``daal4py`` and ``sklearnex`` - module ``sklearnex`` should be prefered whenever possible,
34+
``daal4py`` and ``sklearnex`` - module ``sklearnex`` should be preferred whenever possible,
3535
either by using it directly or through the :ref:`patching mechanism <patching>` - but ``daal4py``
3636
exposes some additional functionalities from the |onedal| that ``sklearnex`` doesn't:
3737

@@ -57,7 +57,7 @@ Using daal4py
5757
Unlike ``sklearnex``, ``daal4py``, being a lower-level interface, does not follow scikit-learn
5858
idioms - instead, the process for calling procedures from the ``daal4py`` interface is as follows:
5959

60-
- Instantiate an 'algorithm' class by calling its contructor, without any data - for example:
60+
- Instantiate an 'algorithm' class by calling its constructor, without any data - for example:
6161
``qr_algo = daal4py.qr()``.
6262
- Call the 'compute' method of that instantiated algorithm in order to obtain a 'result' object,
6363
passing it the data on which it will operate - for example: ``qr_result = qr_algo.compute(X)``.

0 commit comments

Comments
 (0)