sgravel/tracts — pull request #2 by djeik (2014-11-27 21:02:08+00:00)
Title: Adjust style to conform to Python standards

Most of the code in the tracts project was not conformant to the style guide advocated in the Python standard library, namely PEP-8, https://www.python.org/dev/peps/pep-0008. Using the tool autopep8 for most of the code produced pretty good results, although a lot of it was also done by hand. I've tested the resulting code against the examples included in the repository, and they work as expected.

This pull request does include a minor change to the API which breaks it. The `tractlengths` attribute in the `chrom` class was renamed to `tract_lengths`. The example scripts included were updated to reflect this, although other driver scripts that exist will also need to be updated to reflect this change. Perhaps the version number of tracts should be bumped up to reflec this change in API.

This pull request also fixes a few bugs that seemed to be present in the original program or examples. For instance, calling `len` on a generator object.

Also, the changes by @DomNelson are included. They include a cleanup of local variables, removing unused ones, and some minor renaming in local scopes to avoid confusion with identifiers defined in the global scope.