KaveIO / PhiK

Phi_K correlation analyzer library
Other
156 stars 28 forks source link

Make decorators import optional? #64

Open wleftwich opened 1 year ago

wleftwich commented 1 year ago

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 commented 10 months ago

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.