Sourcery refactored master branch#1
Conversation
| table_end = xl_rowcol_to_cell(df_size[0] + 1, df_size[1] - 1) | ||
| # This assumes we start in the left hand corner | ||
| table_range = 'A1:{}'.format(table_end) | ||
| table_range = f'A1:{table_end}' |
There was a problem hiding this comment.
Function format_excel refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting)
| title.text = 'Title for Layout {}'.format(index) | ||
| title.text = f'Title for Layout {index}' | ||
| except AttributeError: | ||
| print("No Title for Layout {}".format(index)) | ||
| print(f"No Title for Layout {index}") |
There was a problem hiding this comment.
Function analyze_ppt refactored with the following changes:
- Replace call to format with f-string [×5] (
use-fstring-for-formatting)
| table = pd.pivot_table(df, index=index_list, | ||
| values=value_list, | ||
| aggfunc=[np.sum, np.mean], fill_value=0) | ||
| return table | ||
| return pd.pivot_table( | ||
| df, | ||
| index=index_list, | ||
| values=value_list, | ||
| aggfunc=[np.sum, np.mean], | ||
| fill_value=0, | ||
| ) |
There was a problem hiding this comment.
Function create_pivot refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| title.text = "Report for {}".format(manager) | ||
| title.text = f"Report for {manager}" |
There was a problem hiding this comment.
Function create_ppt refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting)
| a pandas DataFrame. | ||
|
|
||
| """ | ||
|
|
There was a problem hiding this comment.
Lines 28-28 refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting)
| def load_data(): | ||
| df = pd.read_csv("Aussie_Wines_Plotting.csv", index_col=0) | ||
| return df | ||
| return pd.read_csv("Aussie_Wines_Plotting.csv", index_col=0) |
There was a problem hiding this comment.
Function load_data refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| desc.text = "Province: {} and Price < {}".format(province_val, max_price) | ||
| desc.text = f"Province: {province_val} and Price < {max_price}" |
There was a problem hiding this comment.
Function select_reviews refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting)
| selected = source.selected["1d"]["indices"] | ||
| if selected := source.selected["1d"]["indices"]: | ||
| # Need to get a list of the active reviews so the indices will match up | ||
| df_active = select_reviews() | ||
|
|
||
| # Need to get a list of the active reviews so the indices will match up | ||
| df_active = select_reviews() | ||
|
|
||
| # If something is selected, then get those details and format the results | ||
| # as an HTML table | ||
| if selected: |
There was a problem hiding this comment.
Function selection_change refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression) - Move assignments closer to their usage (
move-assign)
This removes the following comments ( why? ):
# If something is selected, then get those details and format the results
# as an HTML table
| '-o', help='output filename. Default is inputfile_email.html') | ||
| args = parser.parse_args() | ||
| return args | ||
| return parser.parse_args() |
There was a problem hiding this comment.
Function parse_args refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| # Connect to sqlite db | ||
| db_file = os.path.join(os.path.dirname(wb.fullname), 'pbp_proj.db') | ||
| engine = create_engine(r"sqlite:///{}".format(db_file)) | ||
| engine = create_engine(f"sqlite:///{db_file}") |
There was a problem hiding this comment.
Function summarize_sales refactored with the following changes:
- Replace call to format with f-string [×3] (
use-fstring-for-formatting)
Branch
masterrefactored 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
masterbranch, then run:Help us improve this pull request!