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

✨ Add clp guidance megacomplex (Sourcery refactored) #1031

Closed
wants to merge 8 commits into from

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Mar 26, 2022

Pull Request #1029 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/glotaran/pyglotaran pull/1029/head
    git merge --ff-only FETCH_HEAD
    git push

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Help us improve this pull request!

@github-actions
Copy link
Contributor

Binder 👈 Launch a binder notebook on branch glotaran/pyglotaran/sourcery/pull-1029

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Mar 26, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.78%.

Quality metrics Before After Change
Complexity 3.80 ⭐ 4.01 ⭐ 0.21 👎
Method Length 50.68 ⭐ 51.19 ⭐ 0.51 👎
Working memory 6.85 🙂 7.16 🙂 0.31 👎
Quality 73.12% 🙂 72.34% 🙂 -0.78% 👎
Other metrics Before After Change
Lines 2008 2147 139
Changed files Quality Before Quality After Quality Change
glotaran/analysis/optimization_group.py 73.02% 🙂 72.70% 🙂 -0.32% 👎
glotaran/builtin/megacomplexes/decay/test/test_decay_megacomplex.py 54.89% 🙂 54.89% 🙂 0.00%
glotaran/model/dataset_model.py 80.93% ⭐ 73.28% 🙂 -7.65% 👎
glotaran/model/megacomplex.py 74.48% 🙂 73.97% 🙂 -0.51% 👎
glotaran/model/model.py 70.83% 🙂 70.74% 🙂 -0.09% 👎
glotaran/model/test/test_model.py 72.68% 🙂 72.44% 🙂 -0.24% 👎
glotaran/project/result.py 76.82% ⭐ 76.91% ⭐ 0.09% 👍
glotaran/project/test/test_result.py 82.73% ⭐ 83.23% ⭐ 0.50% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
glotaran/model/dataset_model.py DatasetModel.ensure_unique_megacomplexes 14 🙂 104 🙂 15 😞 47.35% 😞 Extract out complex expressions
glotaran/project/result.py Result.markdown 7 ⭐ 186 😞 13 😞 47.42% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/analysis/optimization_group.py OptimizationGroup._add_weight 15 🙂 134 😞 11 😞 48.74% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/model/model.py Model.markdown 13 🙂 168 😞 10 😞 48.74% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/model/model.py Model.from_dict 12 🙂 162 😞 10 😞 50.19% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@sonarqubecloud
Copy link

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 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

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]       [628d8b20]
     <v0.5.1>                   
       53.7±0.3ms       52.7±0.4ms     0.98  BenchmarkOptimize.time_optimize(False, False, False)
        58.7±30ms       57.0±0.3ms     0.97  BenchmarkOptimize.time_optimize(False, False, True)
       53.5±0.1ms       53.1±0.2ms     0.99  BenchmarkOptimize.time_optimize(False, True, False)
       57.8±0.5ms         57.3±1ms     0.99  BenchmarkOptimize.time_optimize(False, True, True)
       65.4±0.2ms       64.6±0.5ms     0.99  BenchmarkOptimize.time_optimize(True, False, False)
         101±40ms        69.2±30ms    ~0.68  BenchmarkOptimize.time_optimize(True, False, True)
       65.3±0.4ms       65.0±0.4ms     1.00  BenchmarkOptimize.time_optimize(True, True, False)
        71.8±30ms        68.5±30ms     0.95  BenchmarkOptimize.time_optimize(True, True, True)
             203M             205M     1.01  IntegrationTwoDatasets.peakmem_optimize
       1.82±0.03s       1.67±0.03s     0.92  IntegrationTwoDatasets.time_optimize

Benchmark diff main vs. PR

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [d15d9bd3]       [628d8b20]
       53.1±0.3ms       52.7±0.4ms     0.99  BenchmarkOptimize.time_optimize(False, False, False)
        65.4±30ms       57.0±0.3ms    ~0.87  BenchmarkOptimize.time_optimize(False, False, True)
       53.0±0.3ms       53.1±0.2ms     1.00  BenchmarkOptimize.time_optimize(False, True, False)
      56.8±0.08ms         57.3±1ms     1.01  BenchmarkOptimize.time_optimize(False, True, True)
       65.1±0.7ms       64.6±0.5ms     0.99  BenchmarkOptimize.time_optimize(True, False, False)
       68.5±0.5ms        69.2±30ms     1.01  BenchmarkOptimize.time_optimize(True, False, True)
       64.9±0.4ms       65.0±0.4ms     1.00  BenchmarkOptimize.time_optimize(True, True, False)
         110±30ms        68.5±30ms    ~0.62  BenchmarkOptimize.time_optimize(True, True, True)
             204M             205M     1.00  IntegrationTwoDatasets.peakmem_optimize
       1.67±0.03s       1.67±0.03s     1.00  IntegrationTwoDatasets.time_optimize

@codecov
Copy link

codecov bot commented Mar 26, 2022

Codecov Report

Attention: Patch coverage is 89.39394% with 7 lines in your changes missing coverage. Please review.

Project coverage is 85.9%. Comparing base (d15d9bd) to head (628d8b2).
Report is 245 commits behind head on main.

Files Patch % Lines
glotaran/project/result.py 42.8% 2 Missing and 2 partials ⚠️
glotaran/model/dataset_model.py 93.7% 0 Missing and 2 partials ⚠️
glotaran/model/model.py 75.0% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1031   +/-   ##
=====================================
  Coverage   85.9%   85.9%           
=====================================
  Files         92      94    +2     
  Lines       4972    5023   +51     
  Branches     937     946    +9     
=====================================
+ Hits        4272    4318   +46     
- Misses       552     554    +2     
- Partials     148     151    +3     

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

@s-weigand s-weigand changed the title Feature: Add clp guidance megacomplex (Sourcery refactored) ✨ Add clp guidance megacomplex (Sourcery refactored) Mar 28, 2022
@s-weigand
Copy link
Member

Hmmm, guess changing the title of the original PR dislinked this PR from it.

@s-weigand s-weigand closed this Mar 31, 2022
@s-weigand s-weigand deleted the sourcery/pull-1029 branch March 31, 2022 22:32
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