Skip to content

Commit

Permalink
Updated build action flake8 linting to use max line length of 88. Als…
Browse files Browse the repository at this point in the history
…o did a bunch of formatting related to linting.
  • Loading branch information
Sm00thix committed Jun 20, 2024
1 parent 762ec3a commit 33b0327
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
# stop the build if there are Python syntax errors or undefined names
flake8 ikpls/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ikpls/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 ikpls/ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
shell: bash

- name: Install IKPLS dependencies
Expand Down
3 changes: 2 additions & 1 deletion examples/fast_cross_val_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def mse_for_each_target(Y_true, Y_pred):
best_num_components = np.asarray(
[
[
np_pls_alg_1_fast_cv_results[split][f'num_components_lowest_mse_target_{i}']
np_pls_alg_1_fast_cv_results[split]
[f'num_components_lowest_mse_target_{i}']
for split in unique_splits
]
for i in range(M)
Expand Down
10 changes: 5 additions & 5 deletions ikpls/fast_cross_validation/numpy_ikpls.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ class PLS:
Whether to center `X` before fitting by subtracting its row of
column-wise means from each row. The row of column-wise means is computed on
the training set for each fold to avoid data leakage.
center_Y : bool, optional default=True
Whether to center `Y` before fitting by subtracting its row of
column-wise means from each row. The row of column-wise means is computed on
the training set for each fold to avoid data leakage.
scale_X : bool, optional default=True
Whether to scale `X` before fitting by dividing each row with the row of `X`'s
column-wise standard deviations. Bessel's correction for the unbiased estimate
of the sample standard deviation is used. The row of column-wise standard
deviations is computed on the training set for each fold to avoid data leakage.
scale_Y : bool, optional default=True
Whether to scale `Y` before fitting by dividing each row with the row of `X`'s
column-wise standard deviations. Bessel's correction for the unbiased estimate
Expand All @@ -64,7 +64,7 @@ class PLS:
------
ValueError
If `algorithm` is not 1 or 2.
Notes
-----
Any centering and scaling is undone before returning predictions to ensure that
Expand Down Expand Up @@ -482,7 +482,7 @@ def _stateless_predict(
predictions for that specific number of components is used. If
`n_components` is None, returns a prediction for each number of components
up to `A`.
Notes
-----
"""
Expand Down
8 changes: 4 additions & 4 deletions ikpls/jax_ikpls_alg_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class PLS(PLSBase):
center_X : bool, default=True
Whether to center `X` before fitting by subtracting its row of
column-wise means from each row.
center_Y : bool, default=True
Whether to center `Y` before fitting by subtracting its row of
column-wise means from each row.
scale_X : bool, default=True
Whether to scale `X` before fitting by dividing each row with the row of `X`'s
column-wise standard deviations. Bessel's correction for the unbiased estimate
Expand Down Expand Up @@ -413,11 +413,11 @@ def stateless_fit(
center_X : bool, default=True
Whether to center `X` before fitting by subtracting its row of
column-wise means from each row.
center_Y : bool, default=True
Whether to center `Y` before fitting by subtracting its row of
column-wise means from each row.
scale_X : bool, default=True
Whether to scale `X` before fitting by dividing each row with the row of
`X`'s column-wise standard deviations. Bessel's correction for the unbiased
Expand Down
8 changes: 4 additions & 4 deletions ikpls/jax_ikpls_alg_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class PLS(PLSBase):
center_X : bool, default=True
Whether to center `X` before fitting by subtracting its row of
column-wise means from each row.
center_Y : bool, default=True
Whether to center `Y` before fitting by subtracting its row of
column-wise means from each row.
scale_X : bool, default=True
Whether to scale `X` before fitting by dividing each row with the row of `X`'s
column-wise standard deviations. Bessel's correction for the unbiased estimate
Expand Down Expand Up @@ -389,11 +389,11 @@ def stateless_fit(
center_X : bool, default=True
Whether to center `X` before fitting by subtracting its row of
column-wise means from each row.
center_Y : bool, default=True
Whether to center `Y` before fitting by subtracting its row of
column-wise means from each row.
scale_X : bool, default=True
Whether to scale `X` before fitting by dividing each row with the row of
`X`'s column-wise standard deviations. Bessel's correction for the unbiased
Expand Down
14 changes: 7 additions & 7 deletions ikpls/jax_ikpls_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Implementations of concrete classes exist for both Improved Kernel PLS Algorithm #1
and Improved Kernel PLS Algorithm #2.
For more details, refer to the paper:
For more details, refer to the paper:
"Improved Kernel Partial Least Squares Regression" by Dayal and MacGregor.
Author: Ole-Christian Galbo Engstrøm
Expand Down Expand Up @@ -669,11 +669,11 @@ def stateless_fit(
center_X : bool, default=True
Whether to center `X` before fitting by subtracting its row of
column-wise means from each row.
center_Y : bool, default=True
Whether to center `Y` before fitting by subtracting its row of
column-wise means from each row.
scale_X : bool, default=True
Whether to scale `X` before fitting by dividing each row with the row of
`X`'s column-wise standard deviations. Bessel's correction for the unbiased
Expand Down Expand Up @@ -949,11 +949,11 @@ def stateless_fit_predict_eval(
center_X : bool, default=True
Whether to center `X` before fitting by subtracting its row of
column-wise means from each row.
center_Y : bool, default=True
Whether to center `Y` before fitting by subtracting its row of
column-wise means from each row.
scale_X : bool, default=True
Whether to scale `X` before fitting by dividing each row with the row of
`X`'s column-wise standard deviations. Bessel's correction for the unbiased
Expand Down Expand Up @@ -1167,11 +1167,11 @@ def _inner_cross_validate(
center_X : bool, default=True
Whether to center `X` before fitting by subtracting its row of
column-wise means from each row.
center_Y : bool, default=True
Whether to center `Y` before fitting by subtracting its row of
column-wise means from each row.
scale_X : bool, default=True
Whether to scale `X` before fitting by dividing each row with the row of
`X`'s column-wise standard deviations. Bessel's correction for the unbiased
Expand Down
6 changes: 3 additions & 3 deletions ikpls/numpy_ikpls.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ class PLS(BaseEstimator):
----------
algorithm : int, default=1
Whether to use Improved Kernel PLS Algorithm #1 or #2.
center_X : bool, default=True
Whether to center `X` before fitting by subtracting its row of
column-wise means from each row.
center_Y : bool, default=True
Whether to center `Y` before fitting by subtracting its row of
column-wise means from each row.
scale_X : bool, default=True
Whether to scale `X` before fitting by dividing each row with the row of `X`'s
column-wise standard deviations. Bessel's correction for the unbiased estimate
Expand Down
Loading

0 comments on commit 33b0327

Please sign in to comment.