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

👌 Add legend_format_string argument to plot_doas #150

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

s-weigand
Copy link
Member

@s-weigand s-weigand commented Feb 23, 2023

This change adds a new argument to legend_format_string that allows defining a formatting rule for the legend as a format string and inset values for label, frequency and rate.
The default value is "{label}: v={frequency:.0f}, Γ={rate:.1f}"

Example plot from the ex_doas_beta case study

Before

image

After

image

Plot code
from pyglotaran_extras import plot_doas

plot_doas(
    result,
    damped_oscillation=["osc1", "osc2", "osc3"],
    time_range=(-0.1, 0.8),
);

Change summary

Checklist

  • ✔️ Passing the tests (mandatory for all PR's)

@s-weigand s-weigand requested a review from a team as a code owner February 23, 2023 17:12
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 23, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 5.84 ⭐ 8.80 🙂 2.96 👎
Method Length 253.50 ⛔ 290.50 ⛔ 37.00 👎
Working memory 21.50 ⛔ 23.55 ⛔ 2.05 👎
Quality 33.35% 😞 28.71% 😞 -4.64% 👎
Other metrics Before After Change
Lines 145 168 23
Changed files Quality Before Quality After Quality Change
pyglotaran_extras/plotting/plot_doas.py 33.35% 😞 28.71% 😞 -4.64% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
pyglotaran_extras/plotting/plot_doas.py plot_doas 9 🙂 454 ⛔ 24 ⛔ 27.56% 😞 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-extras/doas-legend

@codecov
Copy link

codecov bot commented Feb 23, 2023

Codecov Report

Base: 45.33% // Head: 44.94% // Decreases project coverage by -0.39% ⚠️

Coverage data is based on head (c91cc69) compared to base (f44c950).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
- Coverage   45.33%   44.94%   -0.39%     
==========================================
  Files          29       29              
  Lines         922      930       +8     
  Branches      129      131       +2     
==========================================
  Hits          418      418              
- Misses        497      505       +8     
  Partials        7        7              
Impacted Files Coverage Δ
pyglotaran_extras/plotting/plot_doas.py 26.92% <0.00%> (-4.90%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@s-weigand s-weigand requested a review from jsnel February 23, 2023 18:38
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.

Looks good!

@s-weigand s-weigand merged commit 08d18d3 into glotaran:main Feb 23, 2023
@s-weigand s-weigand deleted the doas-legend branch February 23, 2023 22:32
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