Skip to content

Conversation

Illviljan
Copy link
Contributor

@Illviljan Illviljan commented Jun 17, 2023

@Illviljan
Copy link
Contributor Author

We could remove hue_style argument as well. Should we add a warning in dataset.plot.scatter first?

@headtr1ck
Copy link
Collaborator

We could remove hue_style argument as well.

What do you mean by as well? Isn't this what this PR is doing?

Should we add a warning in dataset.plot.scatter first?

Since it is not working since many versions, not sure if a warning is still necessary.

@Illviljan
Copy link
Contributor Author

Sorry, I meant the argument:

hue_style: HueStyleOptions = None,

I haven't removed that one yet. So with the current PR we would just stop advertising it in docs.
Should I just remove it from there as well?

@headtr1ck
Copy link
Collaborator

Ah ok. In this case a deprecating warning doesn't hurt.
Don't we have a decorator for deprecating arguments?

@Illviljan
Copy link
Contributor Author

Not sure. There's a positional at least: https://github.com/pydata/xarray/blob/main/xarray/util/deprecation_helpers.py

@headtr1ck
Copy link
Collaborator

Ok, raising a warning is good anyway and should be a simple two line code.

@headtr1ck
Copy link
Collaborator

This should close #7907

@headtr1ck headtr1ck added the plan to merge Final call for comments label Jul 10, 2023
@Illviljan
Copy link
Contributor Author

Illviljan commented Jul 10, 2023

The warning is showing in some tests. I'll fix that.

xarray/tests/test_plot.py::TestDatasetScatterPlots::test_datetime_hue[discrete]
xarray/tests/test_plot.py::TestDatasetScatterPlots::test_datetime_hue[discrete]
xarray/tests/test_plot.py::TestDatasetScatterPlots::test_datetime_hue[continuous]
xarray/tests/test_plot.py::TestDatasetScatterPlots::test_datetime_hue[continuous]
  /home/runner/work/xarray/xarray/xarray/plot/accessor.py:306: DeprecationWarning: hue_style is no longer used for plot1d plots and the argument will eventually be removed. Convert numbers to string for a discrete hue and use add_legend or add_colorbar to control which guide to display.
    return dataarray_plot.scatter(self._da, *args, **kwargs)

...

 xarray/tests/test_plot.py: 24 warnings
  /home/runner/work/xarray/xarray/xarray/plot/facetgrid.py:515: DeprecationWarning: hue_style is no longer used for plot1d plots and the argument will eventually be removed. Convert numbers to string for a discrete hue and use add_legend or add_colorbar to control which guide to display.
    mappable = func(

@headtr1ck
Copy link
Collaborator

You can add an entry in what's new and we can merge this.

@Illviljan Illviljan enabled auto-merge (squash) July 13, 2023 21:36
@Illviljan Illviljan merged commit a47ff4e into pydata:main Jul 13, 2023
dcherian added a commit to dcherian/xarray that referenced this pull request Jul 16, 2023
* main:
  Remove hue_style from plot1d docstring (pydata#7925)
  Add new what's new section (pydata#7986)
  Release summary for v2023.07.0 (pydata#7979)
  Improve explanation in example "Working with Multidimensional Coordinates" (pydata#7984)
  Fix typo in zarr.py (pydata#7983)
  Examples added to docstrings  (pydata#7936)
  [pre-commit.ci] pre-commit autoupdate (pydata#7973)
  Skip broken tests on python 3.11 and windows (pydata#7972)
  Use another repository for upstream testing (pydata#7970)
  Move absolute path finder from open_mfdataset to own function (pydata#7968)
  ensure no forward slashes in names for HDF5-based backends (pydata#7953)
  Chunked array docs (pydata#7951)
  [pre-commit.ci] pre-commit autoupdate (pydata#7959)
  manually unshallow the repository on RTD (pydata#7961)
  Update minimum version of typing extensions in pre-commit (pydata#7960)
  Docstring examples (pydata#7881)
dcherian added a commit to dcherian/xarray that referenced this pull request Jul 24, 2023
…lazy-array

* upstream/main: (153 commits)
  Add HDF5 Section to read/write docs page (pydata#8012)
  [pre-commit.ci] pre-commit autoupdate (pydata#8014)
  Update interpolate_na in dataset.py (pydata#7974)
  improved docstring of to_netcdf (issue pydata#7127) (pydata#7947)
  Expose "Coordinates" as part of Xarray's public API (pydata#7368)
  Core team member guide (pydata#7999)
  join together duplicate entries in the text `repr` (pydata#7225)
  Update copyright year in README (pydata#8007)
  Allow opening datasets with nD dimenson coordinate variables. (pydata#7989)
  Move whats-new entry
  [pre-commit.ci] pre-commit autoupdate (pydata#7997)
  Add documentation on custom indexes (pydata#6975)
  Use variable name in all exceptions raised in `as_variable` (pydata#7995)
  Bump pypa/gh-action-pypi-publish from 1.8.7 to 1.8.8 (pydata#7994)
  New whatsnew section
  Remove future release notes before this release
  Update whats-new.rst for new release (pydata#7993)
  Remove hue_style from plot1d docstring (pydata#7925)
  Add new what's new section (pydata#7986)
  Release summary for v2023.07.0 (pydata#7979)
  ...
@Illviljan Illviljan deleted the remove_hue_style branch March 13, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan to merge Final call for comments topic-plotting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plot.scatter(hue_style="invalid") does not raise an exception plot.scatter(hue_style="discrete") does nothing
2 participants