linwoodc3 / gdeltPyR

Python based framework to retreive Global Database of Events, Language, and Tone (GDELT) version 1.0 and version 2.0 data.
https://linwoodc3.github.io/gdeltPyR/
GNU General Public License v3.0
203 stars 53 forks source link

CLN: Change utility functions/modules to private #31

Closed linwoodc3 closed 7 years ago

linwoodc3 commented 7 years ago

Cleans up the code so the exposed functions/methods to users are easy to understand. They don't need to see the underlying support functions.

smritigambhir commented 7 years ago

Hi. Still in the process of understanding the nittie-gritties of Python. Am I correct in understanding that utility function names need to begin with a double underscore as '__'?

linwoodc3 commented 7 years ago

Indeed! You want to give this one a shot?

smritigambhir commented 7 years ago

Yep, on it :)

smritigambhir commented 7 years ago

Hi. I have made changes to two files for now. Could you have a look and tell me if this is the correct way to go? https://github.com/smweetee/gdeltPyR/commit/6e8a2c66ae28404a208848c5c9bf6d368e8bf920

linwoodc3 commented 7 years ago

Did you run the code after making changes? Did it run error free? Did the unittests work?

Some reading. http://www.diveintopython.net/object_oriented_framework/private_functions.html

If your code still works, then yes, you're doing it right. I probably need to make a development environment for this library.

smritigambhir commented 7 years ago

Hi @linwoodc3 Used the same link for reference earlier, coincidentally :) I have updated the commit to make changes to the test cases for those methods as well. The build went through fine: https://www.travis-ci.org/smweetee/gdeltPyR/builds/256411772

smritigambhir commented 7 years ago

Hi, I have made similar changes for the remaining methods. But _date_input_check is having issues,specifically in the test case test_dateinputs. Would you know why? This is what I am seeing after changing date_input_check to _date_input_check. Why would this happen because of a name change?:

E AssertionError: Dates for version 2 fail outside of Feb 18 2015 tests/test_dateinputs.py:47: AssertionError

Reference for build: https://www.travis-ci.org/smweetee/gdeltPyR/builds/256427234