Additional tooling #18
Open
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.
This cleans up some of the existing tooling and adds some more. Specifically:
requirements.txtand adds all deps tosetup.pyinstead.run_rep_learner,il_trainandil_testcommands toentry_pointsso that we don't have to dopython src/il_representations/scripts/{name}.py.flake8andisortas part of the unit tests. This uses thepytest-isortandpytest-flake8plugins.reformat.shscript that automatically cleans up imports withisortandautoflake, then reformats to be PEP8-compliant withyapf. This can handle most of the problems identified bypytest-isortandpytest-flake8. My hope is that from now on, we can just runreformat.shbefore committing but otherwise not have to worry about formatting at all (except wrapping strings and comments).This PR also reformats ALL the code to be compliant with the new
flake8style. I've rebased everything into two commits: one that makes the tooling changes, and one that makes the (mostly automated) formatting changes. This should make it easier to review.One potentially controversial choice I've made here is the line length of 100. I noticed that Cody and Cynthia's code was mostly around ~120 columns. I personally prefer shorter line lengths because I can fit more code on my screen; e.g. <=83 columns means I can fit five files, <=105 columns means I can fit four, and <~130 means I can fit three. I chose 100 as a compromise that makes it easy to fit several files on the screen at the same time without forcing us to wrap too much. I'm open to discussions about that choice, as well as discussions about how we can tweak
yapfto make files look nice 😄Another thing: this PR requires everyone to uninstall & reinstall MAGICAL (if they have it installed already). I made some changes that are necessary to work with the latest version of Pyglet, but apparently those won't automatically get installed by pip if you have an existing version 😞