Skip to content

Sourcery Starbot ⭐ refactored sametz/pydnmr#9

Open
SourceryAI wants to merge 1 commit intosametz:masterfrom
SourceryAI:master
Open

Sourcery Starbot ⭐ refactored sametz/pydnmr#9
SourceryAI wants to merge 1 commit intosametz:masterfrom
SourceryAI:master

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


I = (P * (1 + tau * ((pb / T2a) + (pa / T2b))) + Q * R) / (P ** 2 + R ** 2)
return I
return (P * (1 + tau * ((pb / T2a) + (pa / T2b))) + Q * R) / (P ** 2 + R ** 2)
Copy link
Author

Choose a reason for hiding this comment

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

Function two_spin refactored with the following changes:

  • Inline variable that is only used once

Comment on lines -244 to +243
I = (n1 / d1) + (n2 / d2)
return I
return (n1 / d1) + (n2 / d2)
Copy link
Author

Choose a reason for hiding this comment

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

Function dnmr_AB refactored with the following changes:

  • Inline variable that is only used once

Comment on lines -150 to +156
if foundLayout:
print('Found layout named', foundLayout.objectName())
print('Found layout has parent:', foundLayout.parent(),
foundLayout.parent().objectName())
else:
if not foundLayout:
foundLayout = self.ui.centralWidget().layout()
print('Did not find QGridLayout child named "twosingletlayout"')
print('Found layout named', foundLayout.objectName())
print('Found layout has parent:', foundLayout.parent(),
foundLayout.parent().objectName())

print('Found layout named', foundLayout.objectName())
print('Found layout has parent:', foundLayout.parent(),
foundLayout.parent().objectName())
Copy link
Author

Choose a reason for hiding this comment

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

Function TestDefaultGUi.test_find_two_singlets_layout refactored with the following changes:

  • Hoist repeated code outside conditional statement
  • Swap if/else to remove empty if body

Comment on lines -364 to +361
if widget.key == 'k_ab' or widget.key == 'wa':
if widget.key in ['k_ab', 'wa']:
Copy link
Author

Choose a reason for hiding this comment

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

Function TestABGUi.test_twiddle_buttons refactored with the following changes:

  • Replace multiple comparisons of same variable with in operator

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