Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@px39n
Copy link
Contributor

@px39n px39n commented Nov 8, 2022

Delete inappropriate Validation in klib.catplot()

top, bottom: is bins number to be visualized for each column.

But data.shape[1] = Total column amount.

In the original code, the validation check is to make

0 < top, bottom < df.shape[1]

This is not logical.

I think you may intend to check boundary for bin number:

for each column
     0 < top, bottom < column.nunique() 

(But the bin number is already adaptive adjusted, see variable top_lim)

So please delete these two lines, or otherwise, eg
when we have a table with 5 column. and we want to set top=6, bop=3.
Error will be raised.

Delete Validation in klib.displot()

top, bottom is bins number to be visualized for each column .

data.shape[1] is column amount.

for each column
0<top<column.unique is more logical. (But this validation is also not neccessary)
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 8, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 9.86 🙂 9.79 🙂 -0.07 👍
Method Length 484.83 ⛔ 481.17 ⛔ -3.66 👍
Working memory 16.93 ⛔ 16.89 ⛔ -0.04 👍
Quality 31.88% 😞 31.99% 😞 0.11% 👍
Other metrics Before After Change
Lines 776 774 -2
Changed files Quality Before Quality After Quality Change
src/klib/describe.py 31.88% 😞 31.99% 😞 0.11% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
src/klib/describe.py cat_plot 17 🙂 672 ⛔ 21 ⛔ 21.30% ⛔ Try splitting into smaller methods. Extract out complex expressions
src/klib/describe.py missingval_plot 6 ⭐ 822 ⛔ 19 ⛔ 32.20% 😞 Try splitting into smaller methods. Extract out complex expressions
src/klib/describe.py dist_plot 9 🙂 798 ⛔ 15 😞 33.10% 😞 Try splitting into smaller methods. Extract out complex expressions
src/klib/describe.py corr_plot 2 ⭐ 270 ⛔ 22 ⛔ 38.99% 😞 Try splitting into smaller methods. Extract out complex expressions
src/klib/describe.py corr_mat 8 ⭐ 199 😞 51.35% 🙂 Try splitting into smaller methods

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!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 8, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@px39n px39n changed the title Delete inappropriate validation in klib.displot() Delete inappropriate validation in klib.catplot() Nov 8, 2022
@akanz1 akanz1 self-requested a review November 8, 2022 14:14
@akanz1 akanz1 added the bug Something isn't working label Nov 8, 2022
@akanz1
Copy link
Owner

akanz1 commented Nov 9, 2022

Will verify in the next days and draft a release, thanks for reporting @px39n

Copy link
Owner

@akanz1 akanz1 left a comment

Choose a reason for hiding this comment

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

thanks, good point

@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Merging #71 (8010531) into main (8d42746) will increase coverage by 0.22%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main      #71      +/-   ##
==========================================
+ Coverage   53.31%   53.54%   +0.22%     
==========================================
  Files           3        3              
  Lines         467      465       -2     
  Branches       63       63              
==========================================
  Hits          249      249              
+ Misses        211      209       -2     
  Partials        7        7              
Impacted Files Coverage Δ
src/klib/describe.py 19.74% <ø> (+0.16%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@akanz1 akanz1 merged commit d6d9480 into akanz1:main Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants