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

Deprecate regrids #4548

Merged
merged 9 commits into from
Jan 31, 2022
Merged

Deprecate regrids #4548

merged 9 commits into from
Jan 31, 2022

Conversation

pp-mo
Copy link
Member

@pp-mo pp-mo commented Jan 27, 2022

Deprecate everything in iris.experimental.regrid, as noted in #4394

Some of the content has already moved; some will vanish; some can be accessed in a better way.

In this case, as for iris.experimental.raster, merely importing it will give a warning.
But I have also put deprecation warnings in the docstrings, and a runtime warning, for all of the public features.

@pp-mo pp-mo force-pushed the deprecate_regrids branch from dca6f16 to 4fce2db Compare January 27, 2022 15:58
@pp-mo pp-mo requested a review from wjbenfold January 27, 2022 15:59
@pp-mo pp-mo mentioned this pull request Jan 28, 2022
8 tasks
@pp-mo
Copy link
Member Author

pp-mo commented Jan 28, 2022

Latest change : triggered by the observation that we must avoid the deprecation message in normal use of AreaWeightedRegridder.
I might have broken something in the test imports here, so will just see what the CI tests say...

@pp-mo pp-mo force-pushed the deprecate_regrids branch from 870417b to 16dc083 Compare January 28, 2022 15:44
@pp-mo
Copy link
Member Author

pp-mo commented Jan 28, 2022

Latest probably fixed tests.
But .. we seem to have an import circularity problem that is specific to the docs-build ??
Not clear how that can be ...

@lbdreyer
Copy link
Member

Hey @pp-mo is this close to being ready? Once this is in we can merge #4540, then we should be ready to cut the v3.2.x branch

@pp-mo
Copy link
Member Author

pp-mo commented Jan 28, 2022

Hey @pp-mo is this close to being ready? Once this is in we can merge #4540, then we should be ready to cut the v3.2.x branch

I think the main job is done, but there is an outstanding CI problem, and I'm not clear what is wrong.
It seems to be an import glitch (like a circularity import problem?) that only happens when running the doctests.
So, that will need a bit of investigation.

@pp-mo
Copy link
Member Author

pp-mo commented Jan 29, 2022

It seems to be an import glitch (like a circularity import problem?) that only happens when running the doctests.

Update : rather luckily (!) it is also failing in the benchmarks, where it is a lot easier to see what got run.
So basically "from iris import analysis" or "import iris.analysis" fails, but it's ok if you import "iris.cube" first.

Search goes on ...

@pp-mo
Copy link
Member Author

pp-mo commented Jan 29, 2022

OK, that fixed it !
I can't quite understand why neither PyCharm or flake8 spotted that the import of iris.cube was not necessary, yet don't complain when it is removed. Possibly because it is referenced in the docstrings + there is special handling for that ??

Reminder of the goals + what appears to now work :

  • All the non-obsolete support code used by AreaWeighted has been relocated into iris.analysis._area_weighted
    • it all seems to function, without emitting a runtime DeprecationWarning.
  • the original public api regrid_... functions and ProjectedUnstructured.. classes remain in experimental.regrid
    • where everything is now deprecated, with runtime DeprecationWarnings, including import of the module itself.

Copy link
Member

@lbdreyer lbdreyer left a comment

Choose a reason for hiding this comment

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

All looks good to me! Thanks @pp-mo !

@lbdreyer lbdreyer merged commit 2fa7c59 into SciTools:main Jan 31, 2022
@pp-mo pp-mo deleted the deprecate_regrids branch January 31, 2022 15:10
tkknight added a commit to tkknight/iris that referenced this pull request Mar 16, 2022
* main: (64 commits)
  [pre-commit.ci] pre-commit autoupdate (SciTools#4587)
  fix test (SciTools#4585)
  Loading Benchmarks (SciTools#4477)
  Fix refresh lockfile worrkflow pull request title (SciTools#4579)
  gha: lockfiles labels and auto-pr details (SciTools#4578)
  Bump actions/script from 4 to 5.1.0 (SciTools#4576)
  Bump actions/stale from 4.0.0 to 4.1.0 (SciTools#4575)
  Bump peter-evans/create-pull-request from 3.8.2 to 3.12.1 (SciTools#4577)
  adopt dependabot GHA (SciTools#4568)
  New tool-agnostic ASV environment management (SciTools#4571)
  Updated environment lockfiles (SciTools#4567)
  Update version to 3.3.dev0 (SciTools#4565)
  Reset whats new (SciTools#4563)
  docs: move whatsnew (SciTools#4540)
  Deprecate regrids (SciTools#4548)
  Update latest.rst (SciTools#4556)
  Updated environment lockfiles (SciTools#4555)
  Added whatsnew for SciTools#4551. (SciTools#4553)
  Update SciTools#4505 doctests for SciTools#4528. (SciTools#4554)
  minor optimisations (SciTools#4549)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants