question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We need a refactor. Maybe a redesign (breaking backwards compatibility). The codebase has accrued just a little too much tech debt. Particularly in the train_dalle.py and README.md

Training loop

  • The training loop needs to be refactored into a function in the style of pytorch lightning. This dramatically improves readability and makes early returns possible which is a cleaner solution than raising an Exception.

Argument parsing

  • All arg-parsing need to be well-consolidated into a single file. Perhaps another file at the root of the repo as it’s still something people are going to want to open up quickly.

Style guide and automatic formatting in CI

  • This one’s easy - we need a consistent target format for multiple contributors to target. I like PEP8 but honestly if we just pick one I’ll be happy we’re using a linter/formatter at all. Alternatives are black/yapf. I could integrate this into Github Actions so that code is automatically formatted upon merge to main.

Configuration:

README.md

  • The readme is a bit long; but that’s alright. I prefer the idea of a single source of truth with documentation; especially one that doesn’t require the internet after you’ve downloaded it e.g. the wiki
  • It just needs a table of contents and a “quick start” at the top. I do like the idea of continuing to give progress updates on the current best at the top as well. So let’s keep that. taming-transformers has a wonderfully clean README.md with a table of contents which could be used as a basis.

Feel free to criticize the current design (please be constructive and polite - we’re all lazy coders at the end of the day) so we can decide if breaking backwards compatibility for a new design would be worthwhile.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
janEbertcommented, Jun 16, 2021

@afiaka87 with regard to the loop comment, I don’t disagree with putting the loop (or I’m guessing training step) into its own function. Just like I’d favor having a main with corresponding if __name__ == '__main__' guard. I was just referring to not including too many abstracting functions in it. 😃

Just to be clear, I agree with or am neutral towards what I didn’t write about!

2reactions
johnpaulbincommented, Jun 16, 2021

Move this to Discussions 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code refactoring - Wikipedia
In computer programming and software design, code refactoring is the process of restructuring existing computer code—changing the factoring—without changing ...
Read more >
refactor - Wiktionary
(writing) To rewrite existing text in order to improve its readability, reusability or structure without intentionally affecting its meaning. Similar to, but ...
Read more >
clean your code - Refactoring.Guru
Refactoring is a systematic process of improving code without creating new functionality that can transform a mess into clean code and simple design....
Read more >
Refactoring
Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.
Read more >
Refactor Capital
Refactor Capital is an early-stage venture capital firm that invests in founders solving fundamental human problems.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found