Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add custom OutOfBoundsError and replace existing ValueErrors #303

Closed
wants to merge 3 commits into from

Conversation

alex-senger
Copy link
Contributor

Closes #262.

Summary of Changes

Add custom OutOfBoundsError and replace existing ValueErrors that need to be more specific.

@alex-senger alex-senger requested a review from a team as a code owner May 12, 2023 12:07
@alex-senger alex-senger linked an issue May 12, 2023 that may be closed by this pull request
@lars-reimann
Copy link
Member

lars-reimann commented May 12, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 4 0 0 0.75s
✅ PYTHON mypy 4 0 1.67s
✅ PYTHON ruff 4 0 0 0.05s
✅ REPOSITORY git_diff yes no 0.03s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Merging #303 (f62e803) into main (8db5914) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #303   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           43        43           
  Lines         1761      1794   +33     
=========================================
+ Hits          1761      1794   +33     
Impacted Files Coverage Δ
src/safeds/exceptions/__init__.py 100.00% <ø> (ø)
src/safeds/data/tabular/containers/_table.py 100.00% <100.00%> (ø)
...ds/data/tabular/transformation/_one_hot_encoder.py 100.00% <100.00%> (ø)
src/safeds/exceptions/_data.py 100.00% <100.00%> (ø)

@PhilipGutberlet PhilipGutberlet self-requested a review May 12, 2023 12:31
@alex-senger alex-senger marked this pull request as draft May 12, 2023 12:33
"""Exception raised when a value is not in the range [lower, upper]."""

def __init__(self, value: float, lower: float, upper: float) -> None:
super().__init__(f"Value {value} is not in the range [{lower}, {upper}].")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjust the message for the boundaries of _table line 978-981.

@alex-senger alex-senger reopened this Jun 23, 2023
@zzril zzril deleted the 262-custom-error-if-number-is-out-of-bounds branch July 7, 2023 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom error if number is out of bounds
4 participants