feat: new error class OutOfBoundsError#438
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
OutOfBoundsError
Codecov Report
@@ Coverage Diff @@
## main #438 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 48 49 +1
Lines 2514 2594 +80
=========================================
+ Hits 2514 2594 +80
|
…r bound in `OutOfBoundsError`
…/github.com/Safe-DS/Stdlib into 262-custom-error-if-number-is-out-of-bounds
…/github.com/Safe-DS/Stdlib into 262-custom-error-if-number-is-out-of-bounds
Also added docstrings accordingly.
|
To make the error messages somewhat more user-friendly, I have prefixed the Edit: All done. |
Also made public and added docstrings.
if self._number_of_neighbors > training_set.number_of_rows:
raise ValueError(
(
f"The parameter 'number_of_neighbors' ({self._number_of_neighbors}) has to be less than or equal to"
f" the sample size ({training_set.number_of_rows})."
),
)(Same in the We can replace this with the new We could make the |
…com:Safe-DS/Stdlib into 262-custom-error-if-number-is-out-of-bounds
Also fixed type hints for float hyperparameters in tests.
Changed all ML models (and the discretizer) to use the new error. |
Let's keep this one as is. |
lars-reimann
left a comment
There was a problem hiding this comment.
Thanks a lot, very nice work.
## [0.15.0](v0.14.0...v0.15.0) (2023-07-13) ### Features * Add copy method for tables ([#405](#405)) ([72e87f0](72e87f0)), closes [#275](#275) * add gaussian noise to image ([#430](#430)) ([925a505](925a505)), closes [#381](#381) * add schema conversions when adding new rows to a table and schema conversion when creating a new table ([#432](#432)) ([6e9ff69](6e9ff69)), closes [#404](#404) [#322](#322) [#127](#127) [#322](#322) [#127](#127) * add test for empty tables for the method `Table.sort_rows` ([#431](#431)) ([f94b768](f94b768)), closes [#402](#402) * added color adjustment feature ([#409](#409)) ([2cbee36](2cbee36)), closes [#380](#380) * added test_repr table tests ([#410](#410)) ([cb77790](cb77790)), closes [#349](#349) * discretize table ([#327](#327)) ([5e3da8d](5e3da8d)), closes [#143](#143) * Improve error handling of TaggedTable ([#450](#450)) ([c5da544](c5da544)), closes [#150](#150) * Maintain tagging in methods inherited from `Table` class ([#332](#332)) ([bc73a6c](bc73a6c)), closes [#58](#58) * new error class `OutOfBoundsError` ([#438](#438)) ([1f37e4a](1f37e4a)), closes [#262](#262) * rename several `Table` methods for consistency ([#445](#445)) ([9954986](9954986)), closes [#439](#439) * suggest similar columns if column gets accessed that doesnt exist ([#385](#385)) ([6a097a4](6a097a4)), closes [#203](#203) ### Bug Fixes * added the missing ids in parameterized tests ([#412](#412)) ([dab6419](dab6419)), closes [#362](#362) * don't warn if `Imputer` transforms column without missing values ([#448](#448)) ([f0cb6a5](f0cb6a5)) * Warnings raised by underlying seaborn and numpy libraries ([#425](#425)) ([c4143af](c4143af)), closes [#357](#357)
|
🎉 This PR is included in version 0.15.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Closes #262.
Summary of Changes
OutOfBoundsErrorthat can be used to signal that a value is outside its expected range.