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

👌🎨 Wrap model section in result markdown in details tag for notebooks #1098

Merged
merged 4 commits into from Jun 17, 2022

Conversation

s-weigand
Copy link
Member

@s-weigand s-weigand commented Jun 17, 2022

This change makes the markdown rendering of the result in notebooks/ipython less overwhelming by hiding the model in a details tag which can be expanded.

Requested by @ism200

Before

image

After

Hidden

image

Expanded

image

Change summary

Checklist

  • ✔️ Passing the tests (mandatory for all PR's)
  • 🚧 Added changes to changelog (mandatory for all PR's)
  • 🧪 Adds new tests for the feature (mandatory for ✨ feature and 🩹 bug fix PR's)

@s-weigand s-weigand requested a review from jsnel as a code owner June 17, 2022 15:07
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 17, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.90 ⭐ 3.34 ⭐ 0.44 👎
Method Length 41.40 ⭐ 43.65 ⭐ 2.25 👎
Working memory 6.06 ⭐ 6.41 🙂 0.35 👎
Quality 80.35% 78.51% -1.84% 👎
Other metrics Before After Change
Lines 343 358 15
Changed files Quality Before Quality After Quality Change
glotaran/project/result.py 76.96% ⭐ 73.98% 🙂 -2.98% 👎
glotaran/project/test/test_result.py 83.60% ⭐ 82.78% ⭐ -0.82% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
glotaran/project/result.py Result.markdown 10 🙂 201 😞 14 😞 42.01% 😞 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

Binder 👈 Launch a binder notebook on branch s-weigand/pyglotaran/shorter-result-markdown

@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 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]       [ff66d8ae]
     <v0.6.0>                   
         69.1±1ms       71.8±0.9ms     1.04  BenchmarkOptimize.time_optimize(False, False, False)
         117±40ms         75.8±5ms    ~0.65  BenchmarkOptimize.time_optimize(False, False, True)
         70.0±2ms         70.2±2ms     1.00  BenchmarkOptimize.time_optimize(False, True, False)
         117±40ms        93.9±40ms    ~0.80  BenchmarkOptimize.time_optimize(False, True, True)
         89.1±1ms         85.3±3ms     0.96  BenchmarkOptimize.time_optimize(True, False, False)
         95.8±2ms         91.5±2ms     0.96  BenchmarkOptimize.time_optimize(True, False, True)
         87.9±5ms         85.8±2ms     0.98  BenchmarkOptimize.time_optimize(True, True, False)
        96.2±30ms        94.1±30ms     0.98  BenchmarkOptimize.time_optimize(True, True, True)
             207M             205M     0.99  IntegrationTwoDatasets.peakmem_optimize
       2.20±0.03s       2.14±0.07s     0.97  IntegrationTwoDatasets.time_optimize

Benchmark diff main vs. PR

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [ff66d8ae]       [fd99c000]
       71.8±0.9ms         72.3±2ms     1.01  BenchmarkOptimize.time_optimize(False, False, False)
         75.8±5ms         161±50ms    ~2.13  BenchmarkOptimize.time_optimize(False, False, True)
         70.2±2ms         69.2±1ms     0.99  BenchmarkOptimize.time_optimize(False, True, False)
        93.9±40ms         142±40ms    ~1.51  BenchmarkOptimize.time_optimize(False, True, True)
         85.3±3ms         85.0±1ms     1.00  BenchmarkOptimize.time_optimize(True, False, False)
         91.5±2ms         94.4±6ms     1.03  BenchmarkOptimize.time_optimize(True, False, True)
         85.8±2ms         91.1±2ms     1.06  BenchmarkOptimize.time_optimize(True, True, False)
        94.1±30ms        96.4±10ms     1.02  BenchmarkOptimize.time_optimize(True, True, True)
             205M             209M     1.02  IntegrationTwoDatasets.peakmem_optimize
       2.14±0.07s       2.17±0.03s     1.01  IntegrationTwoDatasets.time_optimize

@s-weigand s-weigand added the Type: Enhancement Feature requests label Jun 17, 2022
Copy link
Member

@jsnel jsnel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting a different name for the model_is_detail option. Either model_in_detail' or something like compact_view` or something.

glotaran/project/result.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 17, 2022

Codecov Report

Merging #1098 (fd99c00) into main (ff66d8a) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@          Coverage Diff          @@
##            main   #1098   +/-   ##
=====================================
  Coverage   87.1%   87.1%           
=====================================
  Files        101     101           
  Lines       5339    5341    +2     
  Branches     995     996    +1     
=====================================
+ Hits        4654    4656    +2     
  Misses       530     530           
  Partials     155     155           
Impacted Files Coverage Δ
glotaran/project/result.py 90.8% <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 ff66d8a...fd99c00. Read the comment docs.

@sonarcloud
Copy link

sonarcloud bot commented Jun 17, 2022

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.7% 0.7% Duplication

@jsnel jsnel merged commit 35467ed into glotaran:main Jun 17, 2022
@jsnel jsnel deleted the shorter-result-markdown branch June 17, 2022 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants