-
Notifications
You must be signed in to change notification settings - Fork 5
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 refactored master branch #145
Conversation
input_dict = dict() | ||
input_dict = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function case_to_dict refactored with the following changes:
- Replace dict() with {}
if not username or not password: | ||
if not (username and password): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function log_in refactored with the following changes:
- Simplify logical expression
request.session['good_fields'] = dict() | ||
request.session['good_fields'] = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function create_account refactored with the following changes:
- Replace dict() with {}
if n == None: | ||
if n is None: | ||
n = len(X) | ||
|
||
resample_i = np.floor(np.random.rand(n) * len(X)).astype(int) | ||
X_resample = X[resample_i] | ||
return X_resample | ||
return X[resample_i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function bootstrap_resample refactored with the following changes:
- Inline variable that is only used once
- Use x is None rather than x == None
|
||
hours_slice, status_slice, category_slice = read_cases(filename) | ||
print('Number of cases: {}'.format(len(hours_slice))) | ||
|
||
# Key: category, value: list of (hours, status) points | ||
category_map = group_by_category(hours_slice, status_slice, category_slice) | ||
category_groups = list(get_category_groups(category_map)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function main refactored with the following changes:
- Replace list() with []
- Replace dict() with {}
- Replace list(), dict() or set() with comprehension
if n == None: | ||
if n is None: | ||
n = len(X) | ||
|
||
resample_i = np.floor(np.random.rand(n) * len(X)).astype(int) | ||
X_resample = X[resample_i] | ||
return X_resample | ||
return X[resample_i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function bootstrap_resample refactored with the following changes:
- Inline variable that is only used once
- Use x is None rather than x == None
Reviewed sourcery.ai changes and all seem good. Not tested. |
Branch
master
refactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run: