forked from okfn-brasil/serenata-de-amor
-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP: Refactor campaign donation script #1
Merged
lacerdamarcelo
merged 14 commits into
lacerdamarcelo:issue_275
from
cuducos:cuducos-campaign-donations-data
Nov 27, 2017
Merged
WIP: Refactor campaign donation script #1
lacerdamarcelo
merged 14 commits into
lacerdamarcelo:issue_275
from
cuducos:cuducos-campaign-donations-data
Nov 27, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…RIBUTING.md with the correct command
Jupyter Notebook not available (docker) okfn-brasil#274
…a-de-amor into lacerdamarcelo-issue_275
Use 3rd party libs (requests and tqdm) to simplify code and to avoid reinventing the wheel
DRY by using a flexible function that always returns a DataFrame, using or not the `chunksize` argument
DRY using a base class with the intention to re-use it later
DRY using a temporary context manager (later the idea is to re-use the class built for 2010 directory)
Gather 2010 and 2012-2016 context managers in a common context manager
Gather all these operations in a single point of the script
DRY by using a save function
Done (I guess)… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @lacerdamarcelo,
Once more thank you very much for the PR with the script to collect data on campaign donations!
There are still some bugs in this PR I guess — I'll test it further tomorrow. However this is what I had in mind when I suggested we could follow the DRY (don't repeat yourself) moto a bit closer, adding more readability and maintainability to the great script you've started.
The bulk os changes might seem too big IMHO. However your strategies were solid and I tried to wrap them in a more concise code structure — roughly 22% less code. I kept changes more atomic commit by commit. Maybe the best way to approach this PR is to follow my commit messages and differences, step by step, commits by commit from 4b669e1 to 18d5bc5 (there are commits ahead of them, but the core changes were made in this interval).