Skip to content

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/amodem master
git merge --ff-only FETCH_HEAD
git reset HEAD^

data = self.stream.read(size)
if data:
if data := self.stream.read(size):
Copy link
Author

Choose a reason for hiding this comment

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

Function Compressor.read refactored with the following changes:

Comment on lines -91 to +95
volume_controllers = [
dict(test='pactl --version',
send='pactl set-sink-volume @DEFAULT_SINK@',
recv='pactl set-source-volume @DEFAULT_SOURCE@')
]
if args.calibrate == 'auto':
volume_controllers = [
dict(test='pactl --version',
send='pactl set-sink-volume @DEFAULT_SINK@',
recv='pactl set-source-volume @DEFAULT_SOURCE@')
]
Copy link
Author

Choose a reason for hiding this comment

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

Function get_volume_cmd refactored with the following changes:

if success:
msg = 'good signal'
else:
msg = f'too {errors[flags.index(False)]} signal'

msg = 'good signal' if success else f'too {errors[flags.index(False)]} signal'
Copy link
Author

Choose a reason for hiding this comment

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

Function detector refactored with the following changes:

Comment on lines -126 to +128
if _prev['success'] and _next['success']:
if _prev['freq'] != _next['freq']:
if not curr['success']:
curr['msg'] = 'frequency change'
if (
_prev['success']
and _next['success']
and _prev['freq'] != _next['freq']
and not curr['success']
):
curr['msg'] = 'frequency change'
Copy link
Author

Choose a reason for hiding this comment

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

Function recv_iter refactored with the following changes:

offset = index + len(zeroes)
return offset
return index + len(zeroes)
Copy link
Author

Choose a reason for hiding this comment

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

Function Detector.find_start refactored with the following changes:

Comment on lines -38 to +37
z = []
for i in common.icapture(x, result=y):
z.append(i)
z = list(common.icapture(x, result=y))
Copy link
Author

Choose a reason for hiding this comment

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

Function test_icapture refactored with the following changes:

for i in range(10000):
for _ in range(10000):
Copy link
Author

Choose a reason for hiding this comment

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

Function test_overflow refactored with the following changes:

r = list(itertools.islice(dsp.prbs(reg=1, poly=0x1100b, bits=16), period))
r.sort()
r = sorted(itertools.islice(dsp.prbs(reg=1, poly=0x1100b, bits=16), period))
Copy link
Author

Choose a reason for hiding this comment

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

Function test_prbs refactored with the following changes:

blob = bytearray(r.randrange(0, 256) for i in range(64 * 1024))
blob = bytearray(r.randrange(0, 256) for _ in range(64 * 1024))
Copy link
Author

Choose a reason for hiding this comment

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

Lines 13-13 refactored with the following changes:

Comment on lines -26 to -31
j = 0
for i, buf in result:
for j, (i, buf) in enumerate(result):
assert i == j
assert len(buf) == f.bufsize
j += 1

Copy link
Author

Choose a reason for hiding this comment

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

Function test_read refactored with the following changes:

@romanz romanz self-requested a review January 21, 2023 19:02
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