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

Reduce iteration over steps in _sk_visual_block_ #29022

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

deepyaman
Copy link
Contributor

@deepyaman deepyaman commented May 14, 2024

Reference Issues/PRs

N/A

What does this implement/fix? Explain your changes.

I was reading the code for _sk_visual_block, and I felt like it was unnecessary to get names and estimators from self.steps separately (the first pass simply throws away names), so I figured I'd try some drive-by refactoring.

Any other comments?

I know the "optimization" is very minimal, but I think it could also be viewed as cleaner (than discarding names in _ the first time around).

Copy link

github-actions bot commented May 14, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: b1565e9. Link to the linter CI: here

@deepyaman deepyaman marked this pull request as ready for review May 17, 2024 16:34
@deepyaman deepyaman changed the title [WIP] Reduce iteration over steps in _sk_visual_block_ Reduce iteration over steps in _sk_visual_block_ May 17, 2024
name_details = [str(est) for est in estimators]
return _VisualBlock(
"serial",
estimators,
names=names,
names=list(names),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having to add this partially undid the idea of removing one loop. 🤷 While I still think the refactor is an ever-so-slight improvement, I'm OK if want to close it, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant