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

✨Make guidance spectra a first class citizen (Sourcery refactored) #984

Closed
wants to merge 6 commits into from

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Jan 30, 2022

Pull Request #983 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/983/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!

@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

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 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]       [a7c1cd9d]
     <v0.5.1>                   
         79.6±4ms         75.9±2ms     0.95  BenchmarkOptimize.time_optimize(False, False, False)
         136±40ms         143±40ms     1.05  BenchmarkOptimize.time_optimize(False, False, True)
       77.2±0.6ms         75.4±2ms     0.98  BenchmarkOptimize.time_optimize(False, True, False)
         165±10ms         112±30ms    ~0.68  BenchmarkOptimize.time_optimize(False, True, True)
         98.5±2ms         97.1±3ms     0.99  BenchmarkOptimize.time_optimize(True, False, False)
         108±30ms          104±4ms     0.96  BenchmarkOptimize.time_optimize(True, False, True)
         99.6±3ms         93.4±1ms     0.94  BenchmarkOptimize.time_optimize(True, True, False)
          107±7ms         132±40ms    ~1.23  BenchmarkOptimize.time_optimize(True, True, True)
             203M             207M     1.02  IntegrationTwoDatasets.peakmem_optimize
       2.36±0.08s       2.24±0.09s     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
     [279b24c4]       [a7c1cd9d]
         75.7±2ms         75.9±2ms     1.00  BenchmarkOptimize.time_optimize(False, False, False)
        87.5±40ms         143±40ms    ~1.63  BenchmarkOptimize.time_optimize(False, False, True)
         75.8±2ms         75.4±2ms     0.99  BenchmarkOptimize.time_optimize(False, True, False)
         156±50ms         112±30ms    ~0.72  BenchmarkOptimize.time_optimize(False, True, True)
         96.2±4ms         97.1±3ms     1.01  BenchmarkOptimize.time_optimize(True, False, False)
          102±6ms          104±4ms     1.02  BenchmarkOptimize.time_optimize(True, False, True)
       98.2±0.9ms         93.4±1ms     0.95  BenchmarkOptimize.time_optimize(True, True, False)
         108±40ms         132±40ms    ~1.22  BenchmarkOptimize.time_optimize(True, True, True)
             204M             207M     1.02  IntegrationTwoDatasets.peakmem_optimize
       2.35±0.06s       2.24±0.09s     0.95  IntegrationTwoDatasets.time_optimize

@sourcery-ai sourcery-ai bot changed the title ✨Make guidance spectra a first class thing (Sourcery refactored) ✨Make guidance spectra a first class citizen (Sourcery refactored) Mar 10, 2022
@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-983 branch from f3bf175 to 67ffc5a Compare March 10, 2022 17:01
@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

Merging #984 (a7c1cd9) into main (279b24c) will decrease coverage by 0.2%.
The diff coverage is 58.3%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #984     +/-   ##
=======================================
- Coverage   85.9%   85.7%   -0.3%     
=======================================
  Files         92      93      +1     
  Lines       4972    5002     +30     
  Branches     937     942      +5     
=======================================
+ Hits        4272    4287     +15     
- Misses       552     564     +12     
- Partials     148     151      +3     
Impacted Files Coverage Δ
glotaran/model/model.py 85.5% <0.0%> (-0.1%) ⬇️
glotaran/model/dataset_model.py 76.9% <58.6%> (-5.1%) ⬇️
glotaran/model/clp_guidance_megacomplex.py 61.1% <61.1%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 279b24c...a7c1cd9. Read the comment docs.

s-weigand and others added 6 commits March 12, 2022 16:42
Co-authored-by: Jörn Weißenborn <[email protected]>
Co-authored-by: Joris Snellenburg <[email protected]>
…}_dimension

So they won't conflict with the method which has the same name
overwrite_{model|global}_dimension
♻️ Renamed methods overwrite_{model|global}_dimension to replace_{model|global}_dimension
@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-983 branch from 67ffc5a to a7c1cd9 Compare March 12, 2022 15:56
@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Mar 12, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 5.38 ⭐ 5.52 ⭐ 0.14 👎
Method Length 53.32 ⭐ 53.16 ⭐ -0.16 👍
Working memory 7.88 🙂 7.91 🙂 0.03 👎
Quality 68.77% 🙂 68.59% 🙂 -0.18% 👎
Other metrics Before After Change
Lines 876 897 21
Changed files Quality Before Quality After Quality Change
glotaran/builtin/megacomplexes/baseline/test/test_baseline_megacomplex.py 65.48% 🙂 65.48% 🙂 0.00%
glotaran/builtin/megacomplexes/coherent_artifact/test/test_coherent_artifact.py 42.64% 😞 42.64% 😞 0.00%
glotaran/builtin/megacomplexes/spectral/test/test_spectral_model.py 61.32% 🙂 61.32% 🙂 0.00%
glotaran/model/dataset_model.py 80.93% ⭐ 79.35% ⭐ -1.58% 👎
glotaran/model/model.py 70.83% 🙂 70.55% 🙂 -0.28% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
glotaran/builtin/megacomplexes/coherent_artifact/test/test_coherent_artifact.py test_coherent_artifact 6 ⭐ 459 ⛔ 11 😞 42.64% 😞 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
glotaran/model/dataset_model.py DatasetModel.get_global_dimension 15 🙂 128 😞 10 😞 51.34% 🙂 Try splitting into smaller methods. Extract out complex expressions
glotaran/builtin/megacomplexes/spectral/test/test_spectral_model.py test_spectral_model 1 ⭐ 237 ⛔ 9 🙂 57.03% 🙂 Try splitting into smaller methods

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sourcery-ai sourcery-ai bot closed this Mar 12, 2022
@sourcery-ai sourcery-ai bot deleted the sourcery/pull-983 branch March 12, 2022 16:24
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.

1 participant