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

Make decorators import optional? #64

Open
wleftwich opened this issue Jan 27, 2023 · 1 comment
Open

Make decorators import optional? #64

wleftwich opened this issue Jan 27, 2023 · 1 comment

Comments

@wleftwich
Copy link

wleftwich commented Jan 27, 2023

I recently discovered PhiK, and made it a standard step in my modeling process. Thank you!

One suggestion: When the decorators module is imported in __init__.py, it adds methods to pandas.DataFrame and Series. This happens even if one only explicitly imports a function from a phik submodule. It tends to make Python programmers queasy.

In my own copy of the package, I removed "from phik import decorators" from __init__.py. It's easy enough to import if I want to attach the methods to DataFrame. (I also renamed decorators to monkeypatch, and added a warning; but that's a matter of taste.)

Thanks again.

@mbaak
Copy link
Contributor

mbaak commented Jan 8, 2024

Better late than never. :-)

Thanks for your suggestion. We agree the monkey-patching in phik should be removed (or else made optional).
We're working on a new patch release, that will still include it.

However after that the idea is to make a new major release (with api changes) where it will be removed.
To be continued.

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

No branches or pull requests

2 participants