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
improvement of basemap.addcyclic #138
Conversation
Thanks! Would it be that hard to make it backward compatible? I really would rather not break existing code. |
One solution would be to create a new function (addcyclic2), and then add a deprecation warning in addcyclic. After the next release, addcyclic2 could replace addcyclic. |
Thanks for your comment, Jeff. I made the function backward-compatible. It is actually more elegant this way than in the previous version. |
Great - that works. Please add a Changelog entry, and add yourself to the list of contributors in README.md, and I'll merge. |
improvement of basemap.addcyclic
Great, Jeff, I did as you told. I do not know where my name belongs in the list with respect to my small contribution... Please feel free to rearrange. |
improvement of basemap.addcyclic
Thanks a lot Jonas - merging now... |
I'm going to revert this commit in light of issue #139. j08blue, when you get a chance can you revisit this and see if there is a way to preserve the old behaviour (which treats the longitudes array differently) with your more elegant implementation? |
In its current implementation,
basemap.addcyclic
actually does not work for 2D arrays and fixing the number of input arrays to 2 is also somewhat arbitrary.The proposed version works for any number of n-dimensional arrays in
arr
and has the option to specify theaxis
along which to add the points.The new function is not backward compatible. However, users will merely have to add a pair of parentheses around their input arguments, as described in the docstring.