Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery Starbot ⭐ refactored soundmasteraj/WaveVAE #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SourceryAI
Copy link

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch https://github.com/sourcery-ai-bot/WaveVAE master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Comment on lines -33 to +37
train_indices, test_indices = range(0, len(paths) - test_num_samples), \
range(len(paths) - test_num_samples, len(paths))
train_indices, test_indices = (
range(len(paths) - test_num_samples),
range(len(paths) - test_num_samples, len(paths)),
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function LJspeechDataset.interest_indices refactored with the following changes:

  • Replace range(0, x) with range(x) (remove-zero-from-range)

Comment on lines -63 to -65
x = np.pad(x, [(b_pad, max_len - len(x) - b_pad), (0, 0)],
return np.pad(x, [(b_pad, max_len - len(x) - b_pad), (0, 0)],
mode="constant", constant_values=0)
return x
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _pad_2d refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)

Comment on lines -95 to -101
else:
pass
new_batch.append((x, c))
batch = new_batch
else:
pass

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function collate_fn refactored with the following changes:

  • Remove redundant pass statement (remove-redundant-pass)
  • Replace unneeded comprehension with generator (comprehension-to-generator)

Comment on lines -151 to -153
else:
pass

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function collate_fn_synthesize refactored with the following changes:

  • Remove redundant pass statement (remove-redundant-pass)
  • Replace unneeded comprehension with generator (comprehension-to-generator)

x_sample = self.decoder.generate(z, c_up)
return x_sample
return self.decoder.generate(z, c_up)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function WaveVAE.generate refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)

Comment on lines -73 to +72
out = self.final_conv(skip)
return out
return self.final_conv(skip)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Wavenet.wavenet refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)

logs_tot = logs_tot + logs
logs_tot += logs
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Wavenet_Student.iaf refactored with the following changes:

  • Replace assignment with augmented assignment (aug-assign)

receptive_field = 1
for iaf in self.iafs:
receptive_field += iaf.receptive_field_size() - 1
return receptive_field
return 1 + sum(iaf.receptive_field_size() - 1 for iaf in self.iafs)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Wavenet_Student.receptive_field refactored with the following changes:

  • Convert for loop into call to sum() (sum-comprehension)
  • Inline variable that is immediately returned (inline-immediately-returned-variable)

Comment on lines -77 to +74
for b in range(self.num_blocks):
for _ in range(self.num_blocks):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Wavenet_Flow.__init__ refactored with the following changes:

  • Replace unused for index with underscore (for-index-underscore)

Comment on lines -99 to +96
out = self.final_conv(skip)
return out
return self.final_conv(skip)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Wavenet_Flow.wavenet refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant