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

{ontmerge]Scraping result (Sourcery refactored) #824

Closed
wants to merge 33 commits into from

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Sep 17, 2021

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

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

No Coverage information No Coverage information
3.1% 3.1% Duplication

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Sep 17, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 1.44%.

Quality metrics Before After Change
Complexity 6.93 ⭐ 6.71 ⭐ -0.22 👍
Method Length 49.38 ⭐ 47.16 ⭐ -2.22 👍
Working memory 7.51 🙂 7.26 🙂 -0.25 👍
Quality 69.95% 🙂 71.39% 🙂 1.44% 👍
Other metrics Before After Change
Lines 4848 5153 305
Changed files Quality Before Quality After Quality Change
glotaran/analysis/optimize.py 45.91% 😞 45.71% 😞 -0.20% 👎
glotaran/analysis/problem.py 80.36% ⭐ 80.44% ⭐ 0.08% 👍
glotaran/analysis/simulation.py 64.20% 🙂 64.20% 🙂 0.00%
glotaran/builtin/io/folder/folder_plugin.py 71.72% 🙂 61.82% 🙂 -9.90% 👎
glotaran/builtin/io/folder/test/test_folder_plugin.py 86.72% ⭐ 93.57% ⭐ 6.85% 👍
glotaran/builtin/io/netCDF/netCDF.py 79.78% ⭐ 87.18% ⭐ 7.40% 👍
glotaran/builtin/io/yml/yml.py 52.74% 🙂 78.42% ⭐ 25.68% 👍
glotaran/builtin/io/yml/test/test_save_result.py 88.48% ⭐ 95.76% ⭐ 7.28% 👍
glotaran/io/init.py 87.99% ⭐ 87.99% ⭐ 0.00%
glotaran/io/interface.py 97.71% ⭐ 97.52% ⭐ -0.19% 👎
glotaran/model/dataset_model.py 81.03% ⭐ 80.93% ⭐ -0.10% 👎
glotaran/model/item.py 55.63% 🙂 56.94% 🙂 1.31% 👍
glotaran/model/model.py 72.67% 🙂 72.54% 🙂 -0.13% 👎
glotaran/model/property.py 43.98% 😞 48.19% 😞 4.21% 👍
glotaran/model/test/test_model.py 71.05% 🙂 70.88% 🙂 -0.17% 👎
glotaran/parameter/parameter_group.py 69.30% 🙂 69.30% 🙂 0.00%
glotaran/plugin_system/data_io_registration.py 92.67% ⭐ 92.43% ⭐ -0.24% 👎
glotaran/plugin_system/project_io_registration.py 89.03% ⭐ 87.08% ⭐ -1.95% 👎
glotaran/plugin_system/test/test_project_io_registration.py 91.22% ⭐ 91.22% ⭐ 0.00%
glotaran/project/init.py % % %
glotaran/project/result.py 69.15% 🙂 76.32% ⭐ 7.17% 👍
glotaran/project/scheme.py 90.75% ⭐ 90.05% ⭐ -0.70% 👎
glotaran/project/test/test_result.py 80.10% ⭐ 81.09% ⭐ 0.99% 👍
glotaran/project/test/test_scheme.py 76.59% ⭐ 76.97% ⭐ 0.38% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
glotaran/model/item.py _create_mprint_func 45 ⛔ 275 ⛔ 10 😞 25.00% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
glotaran/model/property.py ModelProperty.validate 44 ⛔ 187 😞 13 😞 25.34% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
glotaran/parameter/parameter_group.py ParameterGroup.from_dataframe 28 😞 267 ⛔ 13 😞 26.41% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
glotaran/analysis/optimize.py _create_result 15 🙂 256 ⛔ 23 ⛔ 27.13% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/model/item.py _create_mprint_func.mprint_item 35 ⛔ 270 ⛔ 10 😞 28.28% 😞 Refactor to reduce nesting. 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!

@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

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [dc00e6da]       [2efd7bd2]
     <v0.4.0>                   
-        60.7±1ms       43.2±0.8ms     0.71  BenchmarkOptimize.time_optimize(False, False, False)
-         355±3ms         56.4±4ms     0.16  BenchmarkOptimize.time_optimize(False, False, True)
-        91.2±1ms         76.4±2ms     0.84  BenchmarkOptimize.time_optimize(False, True, False)
         91.4±1ms        94.9±20ms     1.04  BenchmarkOptimize.time_optimize(False, True, True)
         62.2±1ms         60.6±1ms     0.98  BenchmarkOptimize.time_optimize(True, False, False)
-         355±5ms        70.3±40ms     0.20  BenchmarkOptimize.time_optimize(True, False, True)
         90.8±2ms         96.7±3ms     1.07  BenchmarkOptimize.time_optimize(True, True, False)
         91.2±1ms         156±40ms    ~1.71  BenchmarkOptimize.time_optimize(True, True, True)
             180M             180M     1.00  IntegrationTwoDatasets.peakmem_create_result
             198M             197M     0.99  IntegrationTwoDatasets.peakmem_optimize
-         271±6ms          224±3ms     0.83  IntegrationTwoDatasets.time_create_result
        5.64±0.1s       1.99±0.03s    ~0.35  IntegrationTwoDatasets.time_optimize

@jsnel
Copy link
Member

jsnel commented Sep 17, 2021

No Sourcery services needed for this draft "dontmerge" PR.

@jsnel jsnel closed this Sep 17, 2021
@jsnel jsnel deleted the sourcery/pull-823 branch September 17, 2021 23:54
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