Skip to content

Conversation

@henryiii
Copy link
Member

@henryiii henryiii commented Apr 25, 2021

Closes #555. Added two more small changes to this PR.

@github-actions github-actions bot added the needs changelog Might need a changelog entry label Apr 25, 2021
@henryiii henryiii changed the title fix: logging and correction for internal repr fix: scaling, add logging, fix internal repr Apr 25, 2021
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Apr 25, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 9.76 🙂 9.79 🙂 0.03 👎
Method Length 55.87 ⭐ 56.01 ⭐ 0.14 👎
Working memory 11.85 😞 11.83 😞 -0.02 👍
Quality 58.74% 🙂 58.64% 🙂 -0.10% 👎
Other metrics Before After Change
Lines 1330 1334 4
Changed files Quality Before Quality After Quality Change
src/boost_histogram/_internal/hist.py 55.76% 🙂 55.59% 🙂 -0.17% 👎
src/boost_histogram/_internal/view.py 58.38% 🙂 58.54% 🙂 0.16% 👍
tests/test_views.py 69.27% 🙂 69.27% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
src/boost_histogram/_internal/view.py WeightedSumView.__array_ufunc__ 28 😞 428 ⛔ 22 ⛔ 14.52% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/boost_histogram/_internal/hist.py Histogram.__setitem__ 32 😞 327 ⛔ 21 ⛔ 14.75% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/boost_histogram/_internal/hist.py Histogram.__getitem__ 34 ⛔ 253 ⛔ 20 ⛔ 17.19% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/boost_histogram/_internal/hist.py Histogram.fill 16 🙂 253 ⛔ 13 😞 35.05% 😞 Try splitting into smaller methods. Extract out complex expressions
src/boost_histogram/_internal/hist.py Histogram.__init__ 15 🙂 192 😞 16 ⛔ 35.97% 😞 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.

@github-actions github-actions bot removed the needs changelog Might need a changelog entry label Apr 25, 2021
@henryiii
Copy link
Member Author

I really like Sourcery as a one time run, but the regular messages from it are annoying. Will probably turn it off.

@henryiii henryiii marked this pull request as ready for review April 26, 2021 02:00
@henryiii henryiii merged commit 6f4813f into develop Apr 26, 2021
@henryiii henryiii deleted the fix/reprs branch April 26, 2021 04:00
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.

[BUG] Scaling Weight storage histograms

2 participants