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.

Refactoring redundant code blocks in demo files.

See original GitHub issue

@bhack @LukeWood @innat Guys, You think it make sense to refactor demo py files with something like

# examples/prepare_dataset.py
# prepare dataset utility function

# examples/plot_images.py
# plotting demo results.

I think it might hurt the readablitity of demo file a bit!

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
LukeWoodcommented, May 1, 2022

Per the original issue - yeah I agree that setting up the tf.data.dataset and showing the samples for the KPLs could be extracted into a helper file.

0reactions
tanzhenyucommented, Oct 27, 2022

Closing as this PR is merged

Read more comments on GitHub >

github_iconTop Results From Across the Web

Duplicate Code - Refactoring.Guru
If the duplicate code is inside a constructor, use Pull Up Constructor Body. If the duplicate code is similar but not completely identical,...
Read more >
Duplicate Code and its top 4 harmful effects - Codegrip
Sometimes it's impossible to refactor a duplicate code block but the aim should be to decrease as much technical debt. It helps to...
Read more >
Code Refactoring Best Practices: When (and When Not) to Do It
Inline refactoring is a way to reduce the number of unnecessary methods while simplifying the code. By finding all calls to the method...
Read more >
The Art of Refactoring: Removing Code Duplications
Our first goal is to remove the second duplication. This should be easy, because the code looks almost the same. The only difference...
Read more >
Chapter 4. Working with duplicate code - SonarQube in Action
The more complex a software system, the more code blocks are likely to be repeated. This chapter will show you how duplications affect...
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