Skip to content
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

removed colors argument for Table#scatter #389

Merged
merged 3 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

### v0.16.1
* No longer support the `colors` argument for `Table#scatter`. Use `group` instead.

### v0.15.10
* Include ipynb files in tests, and when measuring test coverage

Expand Down
13 changes: 3 additions & 10 deletions datascience/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2470,8 +2470,7 @@ def group_barh(self, column_label, **vargs):
self.group(column_label).barh(column_label, **vargs)

def scatter(self, column_for_x, select=None, overlay=True, fit_line=False,
group=None, labels=None, sizes=None, width=5, height=5, s=20,
colors=None, **vargs):
group=None, labels=None, sizes=None, width=5, height=5, s=20, **vargs):
"""Creates scatterplots, optionally adding a line of best fit.

Args:
Expand Down Expand Up @@ -2538,14 +2537,8 @@ def scatter(self, column_for_x, select=None, overlay=True, fit_line=False,
options.update(vargs)

x_data, y_labels = self._split_column_and_labels(column_for_x)
if group is not None and colors is not None and group != colors:
warnings.warn("Do not pass both colors and group to scatter().")
if group is None and colors is not None:
# Backward compatibility
group = colors
# TODO: In a future release, warn that this is deprecated.
# Deprecated
# warnings.warn("scatter(colors=x) is deprecated. Use scatter(group=x)", FutureWarning)
if "colors" in vargs and vargs["colors"]:
Copy link
Member Author

Choose a reason for hiding this comment

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

Now that I think about it, this should warn on run of the code instead of just the first run. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. Seems like warning every time might be preferable.

warnings.warn("scatter(colors=x) has been removed. Use scatter(group=x)", FutureWarning)
if group is not None:
y_labels.remove(self._as_label(group))
if sizes is not None:
Expand Down
2 changes: 1 addition & 1 deletion datascience/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.15.10'
__version__ = '0.16.1'