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

ClusterBasedNormalizer code cleanup #704

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

fealho
Copy link
Member

@fealho fealho commented Sep 6, 2023

Resolve #696.

@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (5d7f8b7) 100.00% compared to head (c8aea6e) 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #704   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1799      1800    +1     
=========================================
+ Hits          1799      1800    +1     
Files Changed Coverage Δ
rdt/transformers/numerical.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fealho
Copy link
Member Author

fealho commented Sep 6, 2023

Note: the lines with warnings.catch_warnings(): warnings.simplefilter('ignore') don't seem to do anything, ie I didn't manage to raise any warnings after removing those lines. However, since the original PR never gave an example where that warning was raised, it's possible that the examples I ran just happened to not raise the warning. I would have to investigate further to conclude that the warning will indeed never be raised, but that seems out of scope for this PR, so I'm leaving them as is.

@fealho fealho marked this pull request as ready for review September 6, 2023 04:32
@fealho fealho requested a review from a team as a code owner September 6, 2023 04:32
@fealho fealho requested review from amontanez24, pvk-developer and a team and removed request for a team September 6, 2023 04:32
data = np.stack([recovered_data, data[:, -1]], axis=1) # noqa: PD013
else:
data = recovered_data
recovered_data = np.stack([recovered_data, data[:, -1]], axis=1) # noqa: PD013
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we get rid of this noqa?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope. It thinks that is pandas stack and tells you to use melt, which is a method numpy doesn't have.

Copy link
Member

Choose a reason for hiding this comment

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

Is np.concatenate the same ?

Copy link
Member Author

Choose a reason for hiding this comment

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

stack concatenates them along a different axis. It's also supposed to be faster. I think we could change it to np.concatenate([[array1], [array2]], axis=1), or something like that, but that just seemed more confusing than the noqa.

Copy link
Member

@pvk-developer pvk-developer left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

data = np.stack([recovered_data, data[:, -1]], axis=1) # noqa: PD013
else:
data = recovered_data
recovered_data = np.stack([recovered_data, data[:, -1]], axis=1) # noqa: PD013
Copy link
Member

Choose a reason for hiding this comment

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

Is np.concatenate the same ?

Copy link
Contributor

@amontanez24 amontanez24 left a comment

Choose a reason for hiding this comment

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

:shipit:

@fealho fealho merged commit 8fc2e5e into master Sep 7, 2023
92 checks passed
@fealho fealho deleted the issue-696-cluster-based-normalizer-cleanup branch September 7, 2023 17:17
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.

ClusterBasedNormalizer code cleanup
4 participants