traja-team / traja

Python tools for spatial trajectory and time-series data analysis
https://traja.readthedocs.io
MIT License
101 stars 25 forks source link

Linting #68

Open Saran-nns opened 3 years ago

Saran-nns commented 3 years ago

Analyze source code for bugs and style errors. If you lint any module from any branch, please mark them done below

JustinShenk commented 3 years ago

I added 'pre-commit' to requirements/dev.txt with flake8 and black, and ran pre-commit run --all-files. I skipped PR process and pushed it to master at b1456843c7d70e9ce63f617539b81b2d401bd608, though PR is the standard procedure. There are several errors worth attending to, like variable name complexity:

traja/tests/test_dataset.py:71:1: C901 'test_time_based_sampling_dataloaders_with_short_stride_do_not_overlap' is too complex (20)

Installing pre-commit locally will now run black and flake8 on staged files.

Also highly recommended is to add flake8 linter (and black) to Visual Studio Code or whichever IDE you use.