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 SVD vector labels always starting from zero #133

Merged
merged 1 commit into from
Jan 28, 2023

Conversation

s-weigand
Copy link
Member

@s-weigand s-weigand commented Jan 28, 2023

Since we mostly plot the first SVD vectors starting from zero we didn't see this bug yet.
But when you use different indices (e.g. to plot a specific vector) the legend still uses a range starting at zero.

import matplotlib.pyplot as plt

from pyglotaran_extras.plotting.plot_svd import plot_lsv_residual

fig, axes = plt.subplots(1, 2, figsize=(20, 5))

plot_lsv_residual(result.data["dataset1"],axes[0], indices=[0])
plot_lsv_residual(result.data["dataset1"],axes[1], indices=[1])

Before

image

After

image

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 January 28, 2023 14:49
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 28, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.88 ⭐ 1.88 ⭐ 0.00
Method Length 86.11 🙂 86.22 🙂 0.11 👎
Working memory 12.72 😞 13.06 😞 0.34 👎
Quality 64.83% 🙂 64.19% 🙂 -0.64% 👎
Other metrics Before After Change
Lines 328 328 0
Changed files Quality Before Quality After Quality Change
pyglotaran_extras/plotting/plot_svd.py 64.83% 🙂 64.19% 🙂 -0.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_svd.py plot_svd 2 ⭐ 190 😞 19 ⛔ 45.58% 😞 Try splitting into smaller methods. Extract out complex expressions
pyglotaran_extras/plotting/plot_svd.py plot_lsv_residual 3 ⭐ 83 🙂 16 ⛔ 59.42% 🙂 Extract out complex expressions
pyglotaran_extras/plotting/plot_svd.py _plot_svd_vectors 3 ⭐ 109 🙂 12 😞 61.17% 🙂 Extract out complex expressions
pyglotaran_extras/plotting/plot_svd.py plot_lsv_data 1 ⭐ 74 🙂 16 ⛔ 62.75% 🙂 Extract out complex expressions
pyglotaran_extras/plotting/plot_svd.py plot_rsv_residual 2 ⭐ 57 ⭐ 10 😞 73.38% 🙂 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/fix-bad-svd-label

@codecov
Copy link

codecov bot commented Jan 28, 2023

Codecov Report

Base: 44.85% // Head: 44.32% // Decreases project coverage by -0.53% ⚠️

Coverage data is based on head (2937cec) compared to base (21a2f89).
Patch coverage: 5.55% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #133      +/-   ##
==========================================
- Coverage   44.85%   44.32%   -0.53%     
==========================================
  Files          28       28              
  Lines         845      855      +10     
  Branches      125      130       +5     
==========================================
  Hits          379      379              
- Misses        460      470      +10     
  Partials        6        6              
Impacted Files Coverage Δ
pyglotaran_extras/plotting/plot_overview.py 37.50% <0.00%> (ø)
pyglotaran_extras/plotting/plot_svd.py 20.00% <0.00%> (ø)
pyglotaran_extras/plotting/plot_traces.py 30.61% <0.00%> (-1.31%) ⬇️
pyglotaran_extras/plotting/plot_spectra.py 20.00% <7.69%> (-3.81%) ⬇️

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 merged commit 6c6a7a4 into glotaran:main Jan 28, 2023
@s-weigand s-weigand deleted the fix-bad-svd-label branch January 28, 2023 15:18
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