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 compartment ordering randomization due to use of set #799

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

jsnel
Copy link
Member

@jsnel jsnel commented Aug 29, 2021

Get rid of all things set()

Checklist

  • ✔️ Passing the tests (mandatory for all PR's)
  • 👌 Closes issue (mandatory for ✨ feature and 🩹 bug fix PR's)

Closes issues

closes #787

@github-actions
Copy link
Contributor

Binder 👈 Launch a binder notebook on branch jsnel/pyglotaran/fix/787_compartment_ordering

@sonarcloud
Copy link

sonarcloud bot commented Aug 29, 2021

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 29, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 6.20 ⭐ 7.06 ⭐ 0.86 👎
Method Length 106.00 🙂 106.32 🙂 0.32 👎
Working memory 11.79 😞 11.79 😞 0.00
Quality 58.06% 🙂 57.20% 🙂 -0.86% 👎
Other metrics Before After Change
Lines 518 521 3
Changed files Quality Before Quality After Quality Change
glotaran/analysis/problem_grouped.py 58.06% 🙂 57.20% 🙂 -0.86% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
glotaran/analysis/problem_grouped.py GroupedProblem._append_to_grouped_bag 12 🙂 269 ⛔ 23 ⛔ 29.09% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/analysis/problem_grouped.py GroupedProblem.init_bag 10 🙂 174 😞 16 ⛔ 41.86% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/analysis/problem_grouped.py GroupedProblem._index_independent_residual 8 ⭐ 137 😞 14 😞 49.89% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/analysis/problem_grouped.py GroupedProblem._index_dependent_residual 8 ⭐ 123 😞 15 😞 50.28% 🙂 Try splitting into smaller methods. Extract out complex expressions
glotaran/analysis/problem_grouped.py combine_matrices 12 🙂 141 😞 11 😞 50.50% 🙂 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]       [0ff7b044]
     <v0.4.0>                   
-        42.1±1ms         32.0±2ms     0.76  BenchmarkOptimize.time_optimize(False, False, False)
-         235±7ms         35.6±1ms     0.15  BenchmarkOptimize.time_optimize(False, False, True)
-        61.8±2ms         51.7±1ms     0.84  BenchmarkOptimize.time_optimize(False, True, False)
         63.7±1ms         52.4±2ms    ~0.82  BenchmarkOptimize.time_optimize(False, True, True)
         42.6±2ms         39.6±1ms     0.93  BenchmarkOptimize.time_optimize(True, False, False)
-         236±3ms        81.6±40ms     0.35  BenchmarkOptimize.time_optimize(True, False, True)
       60.6±0.9ms         66.5±4ms     1.10  BenchmarkOptimize.time_optimize(True, True, False)
         62.7±1ms        84.9±20ms    ~1.35  BenchmarkOptimize.time_optimize(True, True, True)
             181M             179M     0.99  IntegrationTwoDatasets.peakmem_create_result
             199M             196M     0.99  IntegrationTwoDatasets.peakmem_optimize
-         206±2ms          163±6ms     0.79  IntegrationTwoDatasets.time_create_result
-      4.21±0.03s       1.20±0.06s     0.29  IntegrationTwoDatasets.time_optimize

@codecov
Copy link

codecov bot commented Aug 29, 2021

Codecov Report

Merging #799 (0ff7b04) into staging (9dc64af) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           staging    #799   +/-   ##
=======================================
  Coverage     84.3%   84.4%           
=======================================
  Files           75      75           
  Lines         4191    4196    +5     
  Branches       756     758    +2     
=======================================
+ Hits          3537    3542    +5     
  Misses         520     520           
  Partials       134     134           
Impacted Files Coverage Δ
glotaran/analysis/problem_grouped.py 96.0% <100.0%> (+<0.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 9dc64af...0ff7b04. Read the comment docs.

@jsnel jsnel merged commit 70a1205 into glotaran:staging Aug 31, 2021
@jsnel jsnel deleted the fix/787_compartment_ordering branch August 31, 2021 18:23
jsnel added a commit that referenced this pull request Sep 16, 2021
Get rid of all things set()

This solves the issue whereby sometimes in examination with multiple datasets the compartment ordering would be randomized.
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