Skip to content

Commit

Permalink
add - alpha validation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
RektPunk committed Aug 27, 2024
1 parent 933f4d0 commit 5d4069b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ repos:
- id: check-yaml
- id: check-json
- repo: https://github.com/psf/black
rev: stable
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
3 changes: 3 additions & 0 deletions mqboost/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def alpha_validate(
if isinstance(alphas, float):
alphas = [alphas]

if 0.0 in alphas or 1.0 in alphas:
raise ValidationException("Alpha cannot be 0 or 1")

_len_alphas = len(alphas)
if _len_alphas == 0:
raise ValidationException("Input alpha is not valid")
Expand Down

0 comments on commit 5d4069b

Please sign in to comment.