deeplycloudy / lmatools

Python code for working with VHF Lightning Mapping Array data
BSD 2-Clause "Simplified" License
22 stars 23 forks source link

Drop six dependency to remove python 2 support #26

Closed djhoese closed 4 years ago

djhoese commented 4 years ago

As discussed in https://github.com/deeplycloudy/glmtools/pull/56, lmatools depends on six but doesn't list it as a dependency. The package could either list this as a dependency in setup.py or it could drop six as a dependency which means python 2 support is also dropped. This PR does the latter.

This was pretty easy to accomplish and in general includes three types of changes:

  1. Remove six imports for range, map, and zip which were being used for getting an iterator instead of a list like python 2's version of these functions.
  2. Importing iteritems to get the iterator version of my_dict.items() by doing iteritems(my_dict). In python 3 the first form is an iterator.
  3. An import of the next function which only exists in python 2 as a my_iter.next() method, if I remember correctly. This is the only change that should make the code non-py2 compatibie.
deeplycloudy commented 4 years ago

I just sent a PR to @djhoese to update his branch. That PR includes some updates to setup.py to actually list the minimal dependencies, and associated doc fixes. I also tested this PR against the included dataset, and everything works just fine (once I fixed my outdated test runner). So, with those updates this PR LGTM.

djhoese commented 4 years ago

@deeplycloudy You should be able to push commits directly to my branch on my fork (because I made this PR). Do you want to try that instead of making a separate PR? Or are you concerned/unsure of the changes you've made?

deeplycloudy commented 4 years ago

@djhoese ah, had to teach myself how to do that, but that's been sorted out.