Skip to content

remove code with 1+ year-old DeprecationWarnings - #1851

Merged
erogluorhan merged 4 commits into
mainfrom
sevans/remove-old-deprecated-code
Oct 28, 2026
Merged

erogluorhan merged 4 commits into
mainfrom
sevans/remove-old-deprecated-code

Conversation

@Sevans711

Copy link
Copy Markdown
Collaborator

Closes #1707

Overview

Finishes deprecating all code tagged with a 1+ year-old DeprecationWarning (except for the one remaining DeprecationWarning in UxDataArray.gradient(), which is instead being handled in #1823). All code removed here has had a corresponding DeprecationWarning tag for at least 14 months.

In particular, this removes:

  • Grid.cross_section (use Grid.subset instead)
  • Grid.parsed_attrs (use Grid.attrs instead)
  • _get_grid(..., latlon=...) (use _get_grid(..., grid_kwargs=dict(..., latlon=...)) instead)
  • UxDataArray.cross_section.constant_latitude (use UxDataArray.subset.constant_latitude instead) and similarly for .constant_longitude, .constant_latitude_interval, and .constant_longitude_interval.
  • obj.to_geodataframe(..., exclude_antimeridian=...) (use obj.to_geodataframe(..., periodic_elements=...) instead: periodic_elements="exclude" for exclude_antimeridian=True; periodic_elements="split" for exclude_antimeridian=False) for obj a Grid or UxDataArray

Also tightened accepted kwargs in a few places:

  • api._get_grid() now no longer accepts arbitrary kwargs (which were being ignored, except for "latlon", which is now fully deprecated).
  • Grid.to_geodataframe() and UxDataArray.to_geodataframe() no longer accept arbitrary kwargs (which were being ignored, except for "project". The "project" kwarg is now included explicitly in the signature and docstring).

PR Checklist

General

  • An issue is created and linked
  • Added appropriate labels (if your uxarray repo permissions allow it)
  • Filled out Overview and Expected Usage (if applicable) sections

Testing & Benchmarking

  • There is adequate test coverage of changes from this PR (add new tests if needed)
  • [N/A] If this PR could affect performance, ran ASV benchmarks and confirmed they show expected behavior (add a new benchmark if necessary)

Documentation and Examples

  • Docstrings updated with any function changes, and included in all new functions
  • [N/A] User (public) functions added to docs/api.rst; internal (private) function names start with an underscore (_)
  • [N/A] If touched any notebook files, cleared the output of all cells before committing
  • [N/A] If added new notebook files, put into appropriate directories and referenced in appropriate files

AI Disclosure

AI Usage: just GitHub Copilot's inline code suggestions

  • I have tested and take responsibility for all AI-generated content in my PR.

(except for the DeprecationWarning in gradient(); that is being handled by #1823)
@Sevans711 Sevans711 added the developer experience Makes the codebase easier to read, debug, maintain, or extend. label Oct 27, 2026
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@cmdupuis3

Copy link
Copy Markdown
Collaborator

@Sevans711 One thing, open_dataset is still passing kwargs to _get_grid, is that intended?

so don't call it with **kwargs. Also, added a regression test which would have caught this issue.
@Sevans711

Copy link
Copy Markdown
Collaborator Author

One thing, open_dataset is still passing kwargs to _get_grid, is that intended?

@cmdupuis3 Great catch, thank you! That was not intended; I originally fixed it in open_mfdataset then forgot to look for it in open_dataset too.

Fixed, and added a regression test which would have caught it, test_open_dataset_drop_variables. This test passes on main, and now passes here too, but failed on this branch before the fix.

@erogluorhan
erogluorhan merged commit 04e2ace into main Oct 28, 2026
16 checks passed
@Sevans711
Sevans711 deleted the sevans/remove-old-deprecated-code branch October 28, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

developer experience Makes the codebase easier to read, debug, maintain, or extend.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Finish deprecating code with 1+ year old DeprecationWarnings

3 participants