Skip to content

Sourcery refactored master branch#1

Open
sourcery-ai[bot] wants to merge 1 commit into
masterfrom
sourcery/master
Open

Sourcery refactored master branch#1
sourcery-ai[bot] wants to merge 1 commit into
masterfrom
sourcery/master

Conversation

@sourcery-ai
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot commented Dec 30, 2022

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:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai Bot requested a review from pikki622 December 30, 2022 06:52
Comment thread code/advanced_excel.py
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}'
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function format_excel refactored with the following changes:

Comment thread code/analyze_ppt.py
Comment on lines -41 to +43
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}")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function analyze_ppt refactored with the following changes:

Comment thread code/create_ppt.py
Comment on lines -77 to +83
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,
)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function create_pivot refactored with the following changes:

Comment thread code/create_ppt.py
Comment on lines -122 to +125
title.text = "Report for {}".format(manager)
title.text = f"Report for {manager}"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function create_ppt refactored with the following changes:

Comment thread code/panda_gform.py
a pandas DataFrame.

"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Lines 28-28 refactored with the following changes:

Comment thread code/winepicker.py
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)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function load_data refactored with the following changes:

Comment thread code/winepicker.py
Comment on lines -97 to +96
desc.text = "Province: {} and Price < {}".format(province_val, max_price)
desc.text = f"Province: {province_val} and Price < {max_price}"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function select_reviews refactored with the following changes:

Comment thread code/winepicker.py
Comment on lines -113 to -120
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:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function selection_change refactored with the following changes:

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()
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function parse_args refactored with the following changes:

Comment thread code/pbp_proj/pbp_proj.py
# 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}")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function summarize_sales refactored with the following changes:

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.

0 participants