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

♻️ Move optimization to new module glotaran.optimization #1047

Merged
merged 4 commits into from
Apr 3, 2022

Conversation

joernweissenborn
Copy link
Member

@joernweissenborn joernweissenborn commented Apr 3, 2022

Change summary

  • created new module optimization
  • deprecated glotaran.analysis.optimize
  • adapted all imports

Checklist

  • ✔️ Passing the tests (mandatory for all PR's)
  • 🚧 Added changes to changelog (mandatory for all PR's)

Closes issues

None.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2022

Binder 👈 Launch a binder notebook on branch joernweissenborn/pyglotaran/refactor/optimization

@codecov
Copy link

codecov bot commented Apr 3, 2022

Codecov Report

Attention: Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.1%. Comparing base (96e6861) to head (2d9a6df).
Report is 236 commits behind head on main.

Files Patch % Lines
glotaran/optimization/optimization_group.py 85.7% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1047   +/-   ##
=====================================
  Coverage   87.1%   87.1%           
=====================================
  Files        102     102           
  Lines       5381    5382    +1     
  Branches     995     995           
=====================================
+ Hits        4691    4692    +1     
  Misses       536     536           
  Partials     154     154           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@s-weigand s-weigand changed the title Refactor: Moved optimization to new module glotaran.optimization. ♻️ Move optimization to new module glotaran.optimization Apr 3, 2022
This will also make the benchmarks future proof, for when the deprecations are dropped
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 16 Code Smells

No Coverage information No Coverage information
1.4% 1.4% Duplication

Copy link
Member

@s-weigand s-weigand left a comment

Choose a reason for hiding this comment

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

In theory, we would need to deprecate all the moved modules not just optimize.
But since optimize contains the only user facing API and the rest is internal API only I think it would be overkill to deprecate them all.

LGTM 👍

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2022

Benchmark is done. Checkout the benchmark result page.
Benchmark differences below 5% might be due to CI noise.

Benchmark diff v0.5.1 vs. main

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [96b42630]       [2d9a6df1]
     <v0.5.1>                   
         76.1±2ms         77.7±2ms     1.02  BenchmarkOptimize.time_optimize(False, False, False)
        84.6±40ms         110±30ms    ~1.30  BenchmarkOptimize.time_optimize(False, False, True)
         74.2±1ms         81.9±3ms    ~1.10  BenchmarkOptimize.time_optimize(False, True, False)
         150±40ms         157±40ms     1.05  BenchmarkOptimize.time_optimize(False, True, True)
         95.3±2ms       94.3±0.8ms     0.99  BenchmarkOptimize.time_optimize(True, False, False)
          102±2ms          104±3ms     1.02  BenchmarkOptimize.time_optimize(True, False, True)
         94.0±2ms       93.7±0.7ms     1.00  BenchmarkOptimize.time_optimize(True, True, False)
         102±20ms         105±40ms     1.02  BenchmarkOptimize.time_optimize(True, True, True)
             203M             205M     1.01  IntegrationTwoDatasets.peakmem_optimize
       2.49±0.09s       2.36±0.04s     0.95  IntegrationTwoDatasets.time_optimize

Benchmark diff main vs. PR

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [96e6861f]       [2d9a6df1]
         81.3±2ms         77.7±2ms     0.96  BenchmarkOptimize.time_optimize(False, False, False)
         135±30ms         110±30ms    ~0.82  BenchmarkOptimize.time_optimize(False, False, True)
         76.9±2ms         81.9±3ms     1.07  BenchmarkOptimize.time_optimize(False, True, False)
         109±30ms         157±40ms    ~1.45  BenchmarkOptimize.time_optimize(False, True, True)
         97.9±2ms       94.3±0.8ms     0.96  BenchmarkOptimize.time_optimize(True, False, False)
          102±4ms          104±3ms     1.02  BenchmarkOptimize.time_optimize(True, False, True)
       92.9±0.7ms       93.7±0.7ms     1.01  BenchmarkOptimize.time_optimize(True, True, False)
         106±40ms         105±40ms     0.98  BenchmarkOptimize.time_optimize(True, True, True)
             208M             205M     0.98  IntegrationTwoDatasets.peakmem_optimize
       2.26±0.05s       2.36±0.04s     1.05  IntegrationTwoDatasets.time_optimize

@jsnel jsnel merged commit 2164172 into glotaran:main Apr 3, 2022
@joernweissenborn joernweissenborn deleted the refactor/optimization branch April 8, 2022 09:46
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.

3 participants