stable-baselines icon indicating copy to clipboard operation
stable-baselines copied to clipboard

Code Cleanup

Open ernestum opened this issue 5 years ago • 5 comments

When I run the pycharm code inspections, I get 8 errors, 177 warnings, 412 weak warnings and 3325 typos. This includes 77 duplicated code fragments and the following python specific issues:

Access to a protected member of a class or a module inspection 5 weak warnings Class must implement all abstract methods inspection 4 weak warnings Code compatibility inspection inspection 50 warnings Inconsistent indentation inspection 37 warnings Incorrect call arguments inspection 8 warnings Incorrect docstring inspection 3 weak warnings Instance attribute defined outside init inspection 7 weak warnings Method signature does not match signature of overridden method inspection 2 warnings Package requirements inspection 204 weak warnings PEP 8 coding style violation inspection 66 weak warnings PEP 8 naming convention violation inspection 3 weak warnings Shadowing built‑ins inspection 1 weak warning Shadowing names from outer scopes inspection 16 weak warnings Type checker inspection 11 warnings 8 weak warnings Unbound local variable inspection 15 warnings Unresolved references inspection 7 errors 37 warnings Unused local inspection 9 weak warnings

I would be happy to gradually walk through them and fix them but I am well aware that this can make merging the existing open PRs a nightmare (especially the duplicated code fragments).

When would be a good moment to attack this issue? Maybe right before a release after many PRs have been merged? I could also imagine that you assign me subsets of the files that I can work in because there are probably no/minimal collisions with existing PRs.

ernestum avatar Feb 05 '20 10:02 ernestum

Thank you for the proposition.

When would be a good moment to attack this issue?

I think you can almost already start. There is only two "big" PR currently:

  • common refactoring #540 by @Miffyli , I don't know when he will have time to complete that one
  • callback collection #644 by myself (but I mostly changed the callbacks only), which should be done soon

Most of the PEP8 is about line too long (but we can have a higher threshold I think). There is also a lot of warnings due to pycharm not understanding how PyTorch work...

araffin avatar Feb 05 '20 11:02 araffin

Bit of warning: #540 will be moving bunch of files around and merging things, so it might make things complicated (should probably finish that up at some point... Deadlines, deadlines, deadlines :( ).

Miffyli avatar Feb 05 '20 11:02 Miffyli

Ok so I will wait for @Miffyli to not make any work in #540 useless?

ernestum avatar Feb 06 '20 15:02 ernestum

@erniejunior I doubt this would make any of the work useless, I am just more worried that it will create a bunch of headache to start redoing these fixes on #540 or other way around if things are done concurrently :). But! This will serve as a good motivator for me to get things done!

Miffyli avatar Feb 06 '20 15:02 Miffyli

@erniejunior the PR are now merged with master ;)

araffin avatar Feb 28 '20 19:02 araffin