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 simulation to own module #1041

Merged
merged 7 commits into from
Apr 2, 2022

Conversation

joernweissenborn
Copy link
Member

@joernweissenborn joernweissenborn commented Apr 2, 2022

This PR moves all simulation code into a new simulation module.

Change summary

  • created glotaran.simulation
  • deprecated glotaran.analysis.simulation
  • fix doc strings in sumaltion
  • added mypy checks for simulation

Checklist

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

@joernweissenborn joernweissenborn requested review from s-weigand, jsnel and a team as code owners April 2, 2022 11:09
@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2022

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

@joernweissenborn
Copy link
Member Author

@s-weigand I tried to create a deprecation test like analysis.Scheme, but it does not work. Can you please have look?

@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 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]       [1eecdb03]
     <v0.5.1>                   
         78.6±2ms         81.9±1ms     1.04  BenchmarkOptimize.time_optimize(False, False, False)
         166±40ms         171±20ms     1.03  BenchmarkOptimize.time_optimize(False, False, True)
       80.5±0.8ms         80.4±3ms     1.00  BenchmarkOptimize.time_optimize(False, True, False)
         165±40ms         162±30ms     0.99  BenchmarkOptimize.time_optimize(False, True, True)
         99.1±2ms         98.7±4ms     1.00  BenchmarkOptimize.time_optimize(True, False, False)
         106±30ms         106±20ms     1.01  BenchmarkOptimize.time_optimize(True, False, True)
          102±5ms         98.2±1ms     0.96  BenchmarkOptimize.time_optimize(True, True, False)
         108±30ms         106±20ms     0.98  BenchmarkOptimize.time_optimize(True, True, True)
             206M             207M     1.00  IntegrationTwoDatasets.peakmem_optimize
       2.58±0.07s       2.44±0.07s     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
     [d1a96374]       [1eecdb03]
         80.4±3ms         81.9±1ms     1.02  BenchmarkOptimize.time_optimize(False, False, False)
          181±9ms         171±20ms     0.95  BenchmarkOptimize.time_optimize(False, False, True)
         81.2±2ms         80.4±3ms     0.99  BenchmarkOptimize.time_optimize(False, True, False)
         162±30ms         162±30ms     1.00  BenchmarkOptimize.time_optimize(False, True, True)
         98.7±2ms         98.7±4ms     1.00  BenchmarkOptimize.time_optimize(True, False, False)
          106±2ms         106±20ms     1.00  BenchmarkOptimize.time_optimize(True, False, True)
         99.8±2ms         98.2±1ms     0.98  BenchmarkOptimize.time_optimize(True, True, False)
         109±30ms         106±20ms     0.98  BenchmarkOptimize.time_optimize(True, True, True)
             209M             207M     0.99  IntegrationTwoDatasets.peakmem_optimize
       2.33±0.07s       2.44±0.07s     1.05  IntegrationTwoDatasets.time_optimize

@s-weigand s-weigand changed the title Refactor: Move simulation to own module ♻️ Move simulation to own module Apr 2, 2022
@s-weigand s-weigand force-pushed the refactor/simulation branch from a6a182a to 124ef50 Compare April 2, 2022 13:41
@codecov
Copy link

codecov bot commented Apr 2, 2022

Codecov Report

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

Project coverage is 87.1%. Comparing base (d1a9637) to head (1eecdb0).
Report is 238 commits behind head on main.

Files Patch % Lines
glotaran/simulation/simulation.py 85.7% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1041   +/-   ##
=====================================
  Coverage   87.1%   87.1%           
=====================================
  Files        101     102    +1     
  Lines       5379    5381    +2     
  Branches     995     995           
=====================================
+ Hits        4689    4691    +2     
  Misses       536     536           
  Partials     154     154           

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

@s-weigand
Copy link
Member

@joernweissenborn the problem with the test was that we don't warn when you import the module (this would be to spammy) but when you use something of it (see a9919c2)

@s-weigand s-weigand force-pushed the refactor/simulation branch from 124ef50 to 4eabd23 Compare April 2, 2022 20:10
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 2, 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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% 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.

LGTM 👍

@jsnel jsnel merged commit 712170f into glotaran:main Apr 2, 2022
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