-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
POC: make core.config self-contained #25176
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #25176 +/- ##
==========================================
- Coverage 92.37% 92.37% -0.01%
==========================================
Files 166 166
Lines 52408 52416 +8
==========================================
+ Hits 48412 48419 +7
- Misses 3996 3997 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25176 +/- ##
==========================================
- Coverage 91.26% 91.26% -0.01%
==========================================
Files 173 173
Lines 52968 52970 +2
==========================================
+ Hits 48340 48341 +1
- Misses 4628 4629 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all for the intent. but this is moving printing things into a very weird place.
pandas/core/config.py
Outdated
@@ -53,8 +53,13 @@ | |||
import re | |||
import warnings | |||
|
|||
import pandas.compat as compat | |||
from pandas.compat import lmap, map, u | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prob easier to wait till PY2 is out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way works for me. If we decide to move forward with this or something like it, I'd rather get a move on now and clean out the compat code in a few weeks or whenever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second waiting until PY2 is out.
Yah it does seem like a weird place for
|
FYI, I extracted pd.core.config from pandas a few months ago and made it into self-contained library. It at https://github.com/topper-123/optioneer. You`d be welcome to take a look if it can be used for this. |
@topper-123 thanks, thats pretty similar to what I have in mind. Did you find that pprint_thing was unnecessary? |
@jbrockmendel, yes, basically. I wanted to avoid the dependency on pandas or other external dependencies, so I replaced pprint_thing with some custom formatting. |
wouldn’t be averse to ripping out code and using this |
I haven't looked at it closely enough to have an opinion, but assume that @topper-123 is on the ball. I like the external-library idea in part because it would make it easier to share a config library with the rest of the ecosystem (mentioned in #25162). Whether internal or external, I think parts of |
Just using |
Updated to move the w/r/t the PY2 compat, the only compat code this module uses is Locally I've been toying with moving
Thoughts? |
After a couple days of trying to wrap my head around the cython codebase, I'm extra-adamant about the benefits of a DAG-as-possible dependency structure for newcomers. |
@@ -835,3 +837,23 @@ def is_callable(obj): | |||
if not callable(obj): | |||
raise ValueError("Value must be a callable") | |||
return True | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you moving this? this defeats the entire purpose of config_init
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to move config
out of core
(either to another dependency-free directory in pandas or something external like @topper-123's repo) and make it explicitly "upstream" from _libs
. That way we get a much cleaner dependency structure by avoiding runtime imports inside _libs
.
Closing in favor of #25613 (and follow-ups) |
As discussed in #25162. The idea from that issue would then be to move core.config to a location explicitly "upstream" from everything else in pandas.