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 plot function for guidance spectra #92

Merged
merged 5 commits into from
Jun 18, 2022

Conversation

s-weigand
Copy link
Member

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

This PR adds a new plot function for guidance spectra and prevents plot_overview from raising an exception when provided with guidance spectra data, by checking the dimensionality of the time coordinate and using plot_guidance if only a single time point is present.

Change summary

Checklist

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

I also tested that it works with the PE2022 teaching material

@s-weigand s-weigand requested a review from a team as a code owner June 18, 2022 16:30
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 18, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.19 ⭐ 5.00 ⭐ 0.81 👎
Method Length 115.88 🙂 121.25 😞 5.37 👎
Working memory 16.79 ⛔ 17.21 ⛔ 0.42 👎
Quality 50.46% 🙂 48.45% 😞 -2.01% 👎
Other metrics Before After Change
Lines 422 431 9
Changed files Quality Before Quality After Quality Change
pyglotaran_extras/init.py 96.84% ⭐ 96.35% ⭐ -0.49% 👎
pyglotaran_extras/plotting/plot_overview.py 50.53% 🙂 48.48% 😞 -2.05% 👎
pyglotaran_extras/plotting/plot_traces.py 47.62% 😞 45.74% 😞 -1.88% 👎

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_overview.py plot_overview 5 ⭐ 202 😞 24 ⛔ 39.13% 😞 Try splitting into smaller methods. Extract out complex expressions
pyglotaran_extras/plotting/plot_traces.py plot_data_and_fits 8 ⭐ 173 😞 19 ⛔ 41.19% 😞 Try splitting into smaller methods. Extract out complex expressions
pyglotaran_extras/plotting/plot_overview.py plot_simple_overview 5 ⭐ 252 ⛔ 14 😞 43.60% 😞 Try splitting into smaller methods. Extract out complex expressions
pyglotaran_extras/plotting/plot_traces.py plot_fitted_traces 3 ⭐ 153 😞 24 ⛔ 45.45% 😞 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!

@s-weigand s-weigand requested a review from jsnel June 18, 2022 16:30
@github-actions
Copy link
Contributor

Binder 👈 Launch a binder notebook on branch s-weigand/pyglotaran-extras/guard-crash-on-guide

@codecov
Copy link

codecov bot commented Jun 18, 2022

Codecov Report

Merging #92 (ac00a5d) into main (80f3549) will decrease coverage by 0.54%.
The diff coverage is 26.47%.

@@            Coverage Diff             @@
##             main      #92      +/-   ##
==========================================
- Coverage   40.72%   40.18%   -0.55%     
==========================================
  Files          22       23       +1     
  Lines         631      662      +31     
  Branches       91       96       +5     
==========================================
+ Hits          257      266       +9     
- Misses        374      396      +22     
Impacted Files Coverage Δ
pyglotaran_extras/plotting/plot_traces.py 31.91% <0.00%> (-1.42%) ⬇️
pyglotaran_extras/plotting/plot_overview.py 27.41% <11.11%> (-1.16%) ⬇️
pyglotaran_extras/plotting/plot_guidance.py 31.81% <31.81%> (ø)
pyglotaran_extras/__init__.py 100.00% <100.00%> (ø)

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 80f3549...ac00a5d. Read the comment docs.

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 to me. Codecov is complaining that lines not under unit test are increasing, but that makes sense in absence of tests. :)

@jsnel jsnel merged commit f05554b into glotaran:main Jun 18, 2022
@s-weigand s-weigand deleted the guard-crash-on-guide branch June 18, 2022 20:10
@s-weigand
Copy link
Member Author

Yeah at some point we need to figure out how to properly test plot functions .... 😅🙈

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