-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add functionality to Region class #444
Conversation
Codecov Report
@@ Coverage Diff @@
## cleanup #444 +/- ##
===========================================
+ Coverage 92.95% 92.97% +0.02%
===========================================
Files 244 248 +4
Lines 18373 18508 +135
===========================================
+ Hits 17078 17208 +130
- Misses 1295 1300 +5
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
deviations.groupby(["algorithm", "n_evaluations"]) | ||
.mean(numeric_only=True)[outcome] | ||
.reset_index() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response to deprecation warning.
In this PR, I extend the functionality of the Region class. I create modules region.py and bounds.py and add tests for their private functions and classes.
The biggest change happened to the
Region
class. Which is now adataclass
object with attributes (center, radius, bounds); properties (shape, cube_bounds, cube_center) and methods (map_to_unit, map_from_unit). The properties are dynamically updated based on the center, radius and the user-provided bounds. If any of the bounds is binding we switch from a spherical trustregion shape to a cube one. The methodsmap_to_unit
andmap_from_unit
map points from the trustregion to the unit space and back. They are attached to this class because they are used in multiple modules and only depend on the information stored in the trustregion.