Skip to content

feat: Add ratio plot support through .plot_ratio API (Sourcery refactored)#164

Closed
sourcery-ai[bot] wants to merge 1 commit into
feat/add-plot-ratio-apifrom
sourcery/feat/add-plot-ratio-api
Closed

feat: Add ratio plot support through .plot_ratio API (Sourcery refactored)#164
sourcery-ai[bot] wants to merge 1 commit into
feat/add-plot-ratio-apifrom
sourcery/feat/add-plot-ratio-api

Conversation

@sourcery-ai
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot commented Mar 23, 2021

Pull Request #161 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the feat/add-plot-ratio-api branch, then run:

git fetch origin sourcery/feat/add-plot-ratio-api
git merge --ff-only FETCH_HEAD
git reset HEAD^

@sourcery-ai sourcery-ai Bot requested a review from matthewfeickert March 23, 2021 05:29
@sourcery-ai sourcery-ai Bot force-pushed the sourcery/feat/add-plot-ratio-api branch 5 times, most recently from 2fda6d5 to c2268bc Compare March 23, 2021 19:04
@matthewfeickert matthewfeickert force-pushed the feat/add-plot-ratio-api branch from 1190f81 to 2286550 Compare March 23, 2021 19:06
@sourcery-ai sourcery-ai Bot force-pushed the sourcery/feat/add-plot-ratio-api branch 2 times, most recently from 795f158 to f1f7e02 Compare March 23, 2021 20:52
@matthewfeickert matthewfeickert force-pushed the feat/add-plot-ratio-api branch from 3539424 to 897a582 Compare March 23, 2021 20:54
@sourcery-ai sourcery-ai Bot force-pushed the sourcery/feat/add-plot-ratio-api branch from f1f7e02 to 9a4c30b Compare March 23, 2021 20:54
Comment thread src/hist/plot.py
raise RuntimeWarning(
"All values are zero! Cannot compute meaningful error bars",
)
return np.vstack([values, values])
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Function poisson_interval refactored with the following changes:

@sourcery-ai
Copy link
Copy Markdown
Contributor Author

sourcery-ai Bot commented Mar 23, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 11.18 🙂 11.20 🙂 0.02 👎
Method Length 139.00 😞 138.59 😞 -0.41 👍
Working memory 17.11 ⛔ 17.12 ⛔ 0.01 👎
Quality 41.91% 😞 41.93% 😞 0.02% 👍
Other metrics Before After Change
Lines 661 660 -1
Changed files Quality Before Quality After Quality Change
src/hist/plot.py 41.91% 😞 41.93% 😞 0.02% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
src/hist/plot.py _plot_ratiolike 30 😞 570 ⛔ 27 ⛔ 11.11% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/hist/plot.py plot_ratio 3 ⭐ 306 ⛔ 21 ⛔ 37.17% 😞 Try splitting into smaller methods. Extract out complex expressions
src/hist/plot.py plot2d_full 9 🙂 278 ⛔ 14 😞 38.61% 😞 Try splitting into smaller methods. Extract out complex expressions
src/hist/plot.py poisson_interval 4 ⭐ 197 😞 15 😞 46.78% 😞 Try splitting into smaller methods. Extract out complex expressions
src/hist/plot.py plot_pull 4 ⭐ 200 😞 13 😞 49.23% 😞 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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@sourcery-ai sourcery-ai Bot closed this Mar 23, 2021
@sourcery-ai sourcery-ai Bot deleted the sourcery/feat/add-plot-ratio-api branch March 23, 2021 20:58
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.

1 participant