POC: make core.config self-contained#25176
POC: make core.config self-contained#25176jbrockmendel wants to merge 10 commits intopandas-dev:masterfrom
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.
|
jreback
left a comment
There was a problem hiding this comment.
all for the intent. but this is moving printing things into a very weird place.
pandas/core/config.py
Outdated
|
|
||
| import pandas.compat as compat | ||
| from pandas.compat import lmap, map, u | ||
|
|
There was a problem hiding this comment.
prob easier to wait till PY2 is out
There was a problem hiding this comment.
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.
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. |
| if not callable(obj): | ||
| raise ValueError("Value must be a callable") | ||
| return True | ||
|
|
There was a problem hiding this comment.
why are you moving this? this defeats the entire purpose of config_init
There was a problem hiding this comment.
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.