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

Tranquilo cleanup #443

Merged
merged 8 commits into from
Mar 15, 2023
Merged

Tranquilo cleanup #443

merged 8 commits into from
Mar 15, 2023

Conversation

timmens
Copy link
Member

@timmens timmens commented Mar 7, 2023

In this PR, we clean up certain components of tranquilo:

  1. We create a new module bounds.py for the Bounds dataclass.
  2. We create a new module region.py for the Region dataclass
    1. The region class is now aware of its shape, which is a sphere if bounds aren't binding and a cube otherwise
    2. The region class now provides methods map_to_unit and map_from_unit for transitioning between the unit space used in points sampling, fitting, and solving the subproblem, and the regular trustregion space.
  3. The sampling code now adaptively samples from the correct shape using the new shape information of the trustregion.
  4. We replace the class ModelInfo with the string model_type which can only be either linear or quadratic.

@codecov
Copy link

codecov bot commented Mar 7, 2023

Codecov Report

Merging #443 (25cb4eb) into main (75d3747) will increase coverage by 0.12%.
The diff coverage is 97.97%.

@@            Coverage Diff             @@
##             main     #443      +/-   ##
==========================================
+ Coverage   92.86%   92.98%   +0.12%     
==========================================
  Files         244      248       +4     
  Lines       18497    18526      +29     
==========================================
+ Hits        17177    17227      +50     
+ Misses       1320     1299      -21     
Impacted Files Coverage Δ
src/estimagic/optimization/tranquilo/options.py 100.00% <ø> (ø)
src/estimagic/optimization/tranquilo/weighting.py 81.81% <ø> (ø)
src/estimagic/visualization/deviation_plot.py 100.00% <ø> (ø)
src/estimagic/visualization/visualize_tranquilo.py 84.97% <ø> (-0.14%) ⬇️
...s/optimization/tranquilo/test_estimate_variance.py 100.00% <ø> (ø)
src/estimagic/optimization/tranquilo/fit_models.py 86.36% <85.71%> (-0.70%) ⬇️
src/estimagic/optimization/tranquilo/bounds.py 94.11% <94.11%> (ø)
src/estimagic/optimization/tranquilo/region.py 97.14% <97.14%> (ø)
...timagic/optimization/tranquilo/aggregate_models.py 87.27% <100.00%> (-0.45%) ⬇️
...imagic/optimization/tranquilo/estimate_variance.py 100.00% <100.00%> (ø)
... and 17 more

... 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.

@timmens timmens changed the title Cleanup Tranquilo cleanup Mar 15, 2023
@timmens timmens requested a review from janosg March 15, 2023 11:21
Copy link
Member

@janosg janosg left a comment

Choose a reason for hiding this comment

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

A few small comments but I already approve.

src/estimagic/optimization/tranquilo/bounds.py Outdated Show resolved Hide resolved
src/estimagic/optimization/tranquilo/region.py Outdated Show resolved Hide resolved
src/estimagic/optimization/tranquilo/region.py Outdated Show resolved Hide resolved
src/estimagic/optimization/tranquilo/region.py Outdated Show resolved Hide resolved
@timmens timmens merged commit 51fd8b6 into main Mar 15, 2023
@timmens timmens deleted the cleanup branch March 15, 2023 12:40
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.

2 participants