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

🩹Fix for ufunc with more than 32 operands (Sourcery refactored) #1185

Closed
wants to merge 3 commits into from

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Nov 21, 2022

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

jsnel and others added 2 commits November 21, 2022 01:36
Fixes issue where when using more than 32 datasets the xarray operation .str.join across the dataset dimension would crash.
@sourcery-ai sourcery-ai bot requested a review from jsnel November 21, 2022 00:48
@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Nov 21, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 5.11 ⭐ 5.10 ⭐ -0.01 👍
Method Length 52.61 ⭐ 53.07 ⭐ 0.46 👎
Working memory 8.89 🙂 8.89 🙂 0.00
Quality 68.17% 🙂 68.08% 🙂 -0.09% 👎
Other metrics Before After Change
Lines 616 633 17
Changed files Quality Before Quality After Quality Change
glotaran/optimization/data_provider.py 68.17% 🙂 68.08% 🙂 -0.09% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
glotaran/optimization/data_provider.py DataProvider.__init__ 8 ⭐ 229 ⛔ 16 ⛔ 39.60% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/optimization/data_provider.py DataProviderLinked.align_weights 16 🙂 142 😞 10 😞 48.91% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/optimization/data_provider.py DataProvider.add_model_weight 7 ⭐ 149 😞 12 😞 52.50% 🙂 Try splitting into smaller methods. Extract out complex expressions
glotaran/optimization/data_provider.py DataProviderLinked.align_groups 3 ⭐ 120 😞 8 🙂 67.66% 🙂 Try splitting into smaller methods
glotaran/optimization/data_provider.py DataProvider.get_axis_slice_from_interval 3 ⭐ 82 🙂 10 😞 68.57% 🙂 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

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

@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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2022

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

Benchmark diff v0.6.0 vs. main

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [6c3c390e]       [86e01909]
     <v0.6.0>                   
!      66.2±0.3ms           failed      n/a  BenchmarkOptimize.time_optimize(False, False, False)
!       73.6±30ms           failed      n/a  BenchmarkOptimize.time_optimize(False, False, True)
!        68.3±1ms           failed      n/a  BenchmarkOptimize.time_optimize(False, True, False)
!       80.1±40ms           failed      n/a  BenchmarkOptimize.time_optimize(False, True, True)
!        83.0±1ms           failed      n/a  BenchmarkOptimize.time_optimize(True, False, False)
!       91.0±30ms           failed      n/a  BenchmarkOptimize.time_optimize(True, False, True)
!        93.2±9ms           failed      n/a  BenchmarkOptimize.time_optimize(True, True, False)
!        115±40ms           failed      n/a  BenchmarkOptimize.time_optimize(True, True, True)
             206M             206M     1.00  IntegrationTwoDatasets.peakmem_optimize
-      2.24±0.04s       1.47±0.02s     0.66  IntegrationTwoDatasets.time_optimize

Benchmark diff main vs. PR

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [86e01909]       [6f5bc385]
           failed           failed      n/a  BenchmarkOptimize.time_optimize(False, False, False)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(False, False, True)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(False, True, False)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(False, True, True)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(True, False, False)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(True, False, True)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(True, True, False)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(True, True, True)
             206M             208M     1.01  IntegrationTwoDatasets.peakmem_optimize
       1.47±0.02s       1.48±0.01s     1.01  IntegrationTwoDatasets.time_optimize

@sourcery-ai sourcery-ai bot closed this Nov 21, 2022
@sourcery-ai sourcery-ai bot deleted the sourcery/pull-1184 branch November 21, 2022 00:52
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