Skip to content

Conversation

amangoel185
Copy link
Collaborator

Fixes #200

@henryiii
Copy link
Member

Could you add a test for the repr to make this doesn't happen again?

@amangoel185
Copy link
Collaborator Author

Sure, I'll do that.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 21, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.62 ⭐ 0.44 ⭐ -0.18 👍
Method Length 30.38 ⭐ 36.48 ⭐ 6.10 👎
Working memory 7.04 🙂 7.58 🙂 0.54 👎
Quality 85.63% 82.97% -2.66% 👎
Other metrics Before After Change
Lines 232 268 36
Changed files Quality Before Quality After Quality Change
src/hist/axis/init.py 83.98% ⭐ 83.98% ⭐ 0.00%
tests/test_reprs.py 88.86% ⭐ 82.10% ⭐ -6.76% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
src/hist/axis/init.py Regular.__init__ 2 ⭐ 71 🙂 17 ⛔ 61.22% 🙂 Extract out complex expressions
src/hist/axis/init.py Integer.__init__ 2 ⭐ 65 🙂 15 😞 64.25% 🙂 Extract out complex expressions
src/hist/axis/init.py Variable.__init__ 2 ⭐ 63 🙂 14 😞 65.82% 🙂 Extract out complex expressions
tests/test_reprs.py test_ND_empty_repr 0 ⭐ 80 🙂 12 😞 68.22% 🙂 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!

@amangoel185
Copy link
Collaborator Author

I've added the tests, @henryiii. You can merge it if it looks good to you.

Comment on lines -215 to +216
growth: bool = False,
metadata: Any = None,
growth: bool = False,
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why these got reordered, but due to the "*" above, order does not affect users, so it's safe. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, I reordered them since I saw that order in Regular.

@henryiii henryiii merged commit 9a33976 into scikit-hep:main Jun 22, 2021
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] Repr issues

2 participants