cartopy icon indicating copy to clipboard operation
cartopy copied to clipboard

API: inconsistent projection arguments in img_transform.regrid

Open ellequelle opened this issue 4 years ago • 4 comments

While helping someone with their code I noticed this inconsistency in the img_transform.regrid API and docstring. The projection parameters are source_cs and target_proj, but in the docstring they're listed as source_cs and target_cs:

regrid excerpt

https://github.com/SciTools/cartopy/blob/22cdafca511744143c5b673598a1889f169c1e3d/lib/cartopy/img_transform.py#L222-L241

Could this be changed to match img_transform.wrap_array, with source_proj and target_proj?

wrap_array excerpt

https://github.com/SciTools/cartopy/blob/22cdafca511744143c5b673598a1889f169c1e3d/lib/cartopy/img_transform.py#L124-L141

ellequelle avatar Mar 10 '22 14:03 ellequelle

I prefer consistency, so I would say yes that sounds like a great idea. A PR for the change would be great! There are probably other locations of mismatch as well, so if there are others you find don't hesitate to make PRs for them.

greglucas avatar Mar 10 '22 16:03 greglucas

If we do that, it's technically an API change (since people passing via kwargs would be broken). That's fine, but we need to make sure it gets noted in the release notes.

dopplershift avatar Mar 10 '22 18:03 dopplershift

I have two questions:

  1. Does cartopy have a standard way of dealing with API deprecations?
  2. Is there a whatsnew file or someplace to make note of the API change?

ellequelle avatar Mar 10 '22 19:03 ellequelle

@ellequelle In some cases we'll warn for a change. I think this is minimally disruptive, and given our 0.x versioning, I feel fine just making the change. We generally don't have an on-going what's new file, but the release manager writes up the release notes from the PRs included in the release milestone. The easiest way to deal with this might be to just add an "api change" label.

dopplershift avatar Mar 10 '22 20:03 dopplershift