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

❌ [TEST] Refactor/refactor project after 807 #825

Closed
wants to merge 29 commits into from

Conversation

jsnel
Copy link
Member

@jsnel jsnel commented Sep 17, 2021

For comparison with PR #823

@github-actions
Copy link
Contributor

Binder 👈 Launch a binder notebook on branch jsnel/pyglotaran/refactor/refactor_project_after_807

@github-actions
Copy link
Contributor

github-actions bot commented Sep 17, 2021

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]       [15dd7347]
     <v0.4.0>                   
-      42.1±0.1ms       30.8±0.2ms     0.73  BenchmarkOptimize.time_optimize(False, False, False)
-       239±0.6ms       35.5±0.6ms     0.15  BenchmarkOptimize.time_optimize(False, False, True)
-      62.5±0.3ms       51.4±0.2ms     0.82  BenchmarkOptimize.time_optimize(False, True, False)
-      64.3±0.2ms       54.8±0.5ms     0.85  BenchmarkOptimize.time_optimize(False, True, True)
       42.4±0.2ms       40.2±0.2ms     0.95  BenchmarkOptimize.time_optimize(True, False, False)
-       239±0.9ms        46.9±50ms     0.20  BenchmarkOptimize.time_optimize(True, False, True)
       62.2±0.3ms       62.6±0.3ms     1.01  BenchmarkOptimize.time_optimize(True, True, False)
       64.6±0.3ms        66.1±40ms     1.02  BenchmarkOptimize.time_optimize(True, True, True)
             179M             179M     1.00  IntegrationTwoDatasets.peakmem_create_result
             197M             200M     1.01  IntegrationTwoDatasets.peakmem_optimize
-         200±2ms          160±2ms     0.80  IntegrationTwoDatasets.time_create_result
-      4.30±0.03s       1.49±0.06s     0.35  IntegrationTwoDatasets.time_optimize

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 17, 2021

This pull request introduces 1 alert when merging 6655fe3 into 2f1afe7 - view on LGTM.com

new alerts:

  • 1 for Variable defined multiple times

Includes cherry pick of 9d61605

Satisfy pre-commit
All tests are running, most are PASS. Error mostly in project io registration due to changes in save functions
@jsnel jsnel force-pushed the refactor/refactor_project_after_807 branch from 6655fe3 to 15dd734 Compare September 17, 2021 23:47
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 17, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 6.90 ⭐ 6.69 ⭐ -0.21 👍
Method Length 50.43 ⭐ 48.57 ⭐ -1.86 👍
Working memory 7.53 🙂 7.30 🙂 -0.23 👍
Quality 69.86% 🙂 71.11% 🙂 1.25% 👍
Other metrics Before After Change
Lines 4998 5392 394
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/examples/sequential.py 46.88% 😞 43.68% 😞 -3.20% 👎
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% 🙂 73.25% 🙂 0.58% 👍
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% 🙂 68.30% 🙂 -0.85% 👎
glotaran/project/scheme.py 90.75% ⭐ 90.05% ⭐ -0.70% 👎
glotaran/project/test/test_result.py 80.10% ⭐ 82.44% ⭐ 2.34% 👍
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!

@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 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Sep 17, 2021

Codecov Report

Merging #825 (2f1afe7) into main (2f1afe7) will not change coverage.
The diff coverage is n/a.

❗ Current head 2f1afe7 differs from pull request most recent head 15dd734. Consider uploading reports for the commit 15dd734 to get more accurate results
Impacted file tree graph

@@          Coverage Diff          @@
##            main    #825   +/-   ##
=====================================
  Coverage   84.7%   84.7%           
=====================================
  Files         77      77           
  Lines       4343    4343           
  Branches     785     785           
=====================================
  Hits        3682    3682           
  Misses       521     521           
  Partials     140     140           

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 2f1afe7...15dd734. Read the comment docs.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 17, 2021

This pull request introduces 1 alert when merging 15dd734 into 2f1afe7 - view on LGTM.com

new alerts:

  • 1 for Variable defined multiple times

@jsnel jsnel changed the title Refactor/refactor project after 807 🗑️ [TEST] Refactor/refactor project after 807 Sep 18, 2021
@jsnel jsnel changed the title 🗑️ [TEST] Refactor/refactor project after 807 ❌ [TEST] Refactor/refactor project after 807 Sep 19, 2021
@jsnel
Copy link
Member Author

jsnel commented Oct 24, 2021

This was an experimental PR which has been superseded by a number of other smaller PRs:

@jsnel jsnel closed this Oct 24, 2021
@jsnel jsnel deleted the refactor/refactor_project_after_807 branch November 6, 2022 23:15
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