-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
MAINT: Cleanup pandas/src/parser #14740
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
// Process string of digits | ||
while (isdigit(*p)) | ||
{ | ||
// Process string of digits. |
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.
so this style seems to be prevalent. we don't have c-style checkers, so if you are changing this, nothing to stop someone else to change it back / another way.
can we clarify what is the correct style, maybe even add a checker in? (IIRC we should be using google c styles)
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.
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.
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.
- Code has not been updated in some time.
- Code is also not Python 3 compatible, nor is its dependency.
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.
what are you referring? this is just a program that we run so why does it matter if it's updated or not (and 4 months is pretty recent)
how does it matter if it's not in python 3?
it's checking c code
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.
Because the checker is in Python. Also, that's inconvenient for people who are using Python 3 for development and / or personal use.
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 don't think this is a big deal
you simply create another env
of course open to other suggestions - but being in python makes this cross platform
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.
Hmm...I would keep looking. Tool doesn't seem too extensive AFAICT (see here)
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.
Current coverage is 85.28% (diff: 100%)@@ master #14740 diff @@
==========================================
Files 144 144
Lines 50953 50968 +15
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43452 43467 +15
Misses 7501 7501
Partials 0 0
|
481dd18
to
ec66af4
Compare
@jreback : All green, so ready to merge if there are no other concerns. |
ec66af4
to
80e60f9
Compare
@gfyoung can you add the checker in, you can even do it in another PR so we can see the failures. |
@jreback : Here's the command I ran (after doing
Note: you can disable extensions: e.g. Here's what the linter is complaining about right now:
|
Immediate thoughts:
Related SO here
|
811d248
to
c99cb2c
Compare
@jreback : Any thoughts / updates on this? |
i would like to include a checker for the syntax |
@jreback : That doesn't address the question about the syntax errors I'm getting from it though. |
not sure what you mean if this is changed gen we need a checker to assure it is not changed just for style |
Right, but we need to figure which things to actually respect. See the errors that I get out above. We can't just throw a style checker in without knowing what we're checking, especially since this is geared towards C++ and not C in particular. |
as I said above, let's find a workable checker then. its actually only important this actually runs on linux/osx as that is where it is checked (of course if it works on windows that is great but not necessary). We can start with an optional check and make it strict as needed. |
@jreback : So you mean just include the checker but don't fail if the style check fails right now? |
well I would like to fix this, but only if we have a checker |
@gfyoung sure. so put together a minimal set of checks and change the code to match those. over time we can become more strict by adding options (or requiring more checks) in the linter. |
@jreback : Fair enough. Will start with the |
b35e4a1
to
4dc1f73
Compare
@jreback : Successfully incorporated linter on Travis. Ready to merge if there are no other concerns. |
Remove dead code and reformat for style using Google's C++ style guide. Also adds Google's cpplint (fork) to the style checking for Travis.
4dc1f73
to
b2c4211
Compare
lgtm. ping on green. |
@gfyoung I would do those additional files, but exclude src/headers & src/klib IOW include src/datetime |
@jreback : Sounds good. I'll do that as a follow-up then after this is merged. |
thanks @gfyoung @jorisvandenbossche you may need to pick this for 0.19.2 (if we have fixes that depend on it). |
So from the list in pandas/src:
@jreback : Can you confirm the other three? |
msgpack -> no not sure where period_helper.c came from (but prob ok to clean) |
@jreback yes, it will depend on whether there will still be fixes to the parser for 0.19.2 and how complex they are. But if possible, would like to keep this for 0.20.0 as it's purely clean-up and not needed for 0.19.2 |
@jreback : |
"cpplint" was introduced pandas-devgh-14740, and this commit extends to check other *.c and *.h files in the pandas repo. Currently, they all reside in pandas/src, and this commit expands the lint to check all of the following: 1) datetime (dir) 2) ujson (dir) 3) period_helper.c 4) All header files The parser directory was handled in pandas-devgh-14740, and the others have been deliberately omitted.
"cpplint" was introduced pandas-devgh-14740, and this commit extends to check other *.c and *.h files in the pandas repo. Currently, they all reside in pandas/src, and this commit expands the lint to check all of the following: 1) datetime (dir) 2) ujson (dir) 3) period_helper.c 4) All header files The parser directory was handled in pandas-devgh-14740, and the others have been deliberately omitted.
* commit 'v0.19.0-174-g81a2f79': (156 commits) BLD: escape GH_TOKEN in build_docs TST: Correct results with np.size and crosstab (pandas-dev#4003) (pandas-dev#14755) Frame benchmarking sum instead of mean (pandas-dev#14824) CLN: lint of test_base.py BUG: Allow TZ-aware DatetimeIndex in merge_asof() (pandas-dev#14844) BUG: GH11847 Unstack with mixed dtypes coerces everything to object TST: skip testing on windows for specific formatting which sometimes hangs (pandas-dev#14851) BLD: try new gh token for pandas-docs CLN/PERF: clean-up of the benchmarks (pandas-dev#14099) ENH: add timedelta as valid type for interpolate with method='time' (pandas-dev#14799) DOC: add section on groupby().rolling/expanding/resample (pandas-dev#14801) TST: add test to confirm GH14606 (specify category dtype for empty) (pandas-dev#14752) BLD: use org name in build-docs.sh BF(TST): use = (native) instead of < (little endian) for target data types (pandas-dev#14832) ENH: Introduce UnsortedIndexError GH11897 (pandas-dev#14762) ENH: Add the ability to have a separate title for each subplot when plotting (pandas-dev#14753) DOC: Fix grammar and formatting typos (pandas-dev#14803) BLD: try new build credentials for pandas-docs TST: Test pivot with categorical data MAINT: Cleanup pandas/src/parser (pandas-dev#14740) ...
release 0.19.1 was from release branch * releases: (156 commits) BLD: escape GH_TOKEN in build_docs TST: Correct results with np.size and crosstab (pandas-dev#4003) (pandas-dev#14755) Frame benchmarking sum instead of mean (pandas-dev#14824) CLN: lint of test_base.py BUG: Allow TZ-aware DatetimeIndex in merge_asof() (pandas-dev#14844) BUG: GH11847 Unstack with mixed dtypes coerces everything to object TST: skip testing on windows for specific formatting which sometimes hangs (pandas-dev#14851) BLD: try new gh token for pandas-docs CLN/PERF: clean-up of the benchmarks (pandas-dev#14099) ENH: add timedelta as valid type for interpolate with method='time' (pandas-dev#14799) DOC: add section on groupby().rolling/expanding/resample (pandas-dev#14801) TST: add test to confirm GH14606 (specify category dtype for empty) (pandas-dev#14752) BLD: use org name in build-docs.sh BF(TST): use = (native) instead of < (little endian) for target data types (pandas-dev#14832) ENH: Introduce UnsortedIndexError GH11897 (pandas-dev#14762) ENH: Add the ability to have a separate title for each subplot when plotting (pandas-dev#14753) DOC: Fix grammar and formatting typos (pandas-dev#14803) BLD: try new build credentials for pandas-docs TST: Test pivot with categorical data MAINT: Cleanup pandas/src/parser (pandas-dev#14740) ...
`cpplint` was introduced #14740, and this commit extends to check other `*.c` and `*.h` files. Currently, they all reside in `pandas/src`, and this commit expands the lint to check all of the following: 1) `datetime` (dir) 2) `ujson` (dir) 3) `period_helper.c` 4) `All header files` The parser directory was handled in #14740, and the others have been deliberately omitted per the discussion <a href="https://github.com/pandas- dev/pandas/pull/14740#issuecomment-265260209">here</a>. Author: gfyoung <[email protected]> Closes #14814 from gfyoung/c-style-continue and squashes the following commits: 27d4d46 [gfyoung] MAINT: Style check *.c and *.h files
`cpplint` was introduced pandas-dev#14740, and this commit extends to check other `*.c` and `*.h` files. Currently, they all reside in `pandas/src`, and this commit expands the lint to check all of the following: 1) `datetime` (dir) 2) `ujson` (dir) 3) `period_helper.c` 4) `All header files` The parser directory was handled in pandas-dev#14740, and the others have been deliberately omitted per the discussion <a href="https://github.com/pandas- dev/pandas/pull/14740#issuecomment-265260209">here</a>. Author: gfyoung <[email protected]> Closes pandas-dev#14814 from gfyoung/c-style-continue and squashes the following commits: 27d4d46 [gfyoung] MAINT: Style check *.c and *.h files
Remove dead code and reformat for style using Google's C++ style guide (found here).
Also adds line of code to install fork of Google's C++ style checker (source code here) when doing style checks in Travis.