-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 flipud() and fliplr() in favor of flipdim() #10446
Conversation
6ffb652
to
944c16d
Compare
Seems reasonable to me. We should also delete the original definitions and the docs. Not sure what's going on with the deprecations, but they look right. |
+1 |
Depreciation messages depends on backtraces, and if they are unreliable, you'll get unpredictable results. |
-1 from me. But this might be as I am used to these functions and they are really convenient in plotting code when the image is mirrored upside down. |
@simonster I thought we would keep the definitions for one cycle, and only remove them after that? Isn't that our deprecation policy? |
@nalimilan: The |
944c16d
to
bb7dec9
Compare
OK, I've updated the PR to remove the old definitions and the docs. |
I don't know these functions, but if this is to be merged. we would also need a mention in |
For me these are pretty core functions that operate on arrays and IMHO before cleaning up in this corner there are different areas that should be first removed from base. The sparse matrices for instance. |
+1 to removing these |
@tknopp The functionality is still there and will only take 4 more characters to get. I doubt these aliases will be missed by anyone but MATLAB users. If we're going to deprecate these, I don't see why waiting would be advantageous, and moving sparse matrices out of Base seems completely orthogonal. |
bb7dec9
to
950551a
Compare
@tknopp I understand, I'm also used to I've updated the PR with a NEWS entry. |
950551a
to
b99839a
Compare
+1 Also needs to be removed from exports.jl. |
@nalimilan funny enough, that package exists: https://github.com/MatlabCompat/MatlabCompat.jl by @ayakimovich |
We do not provide other convenience functions for any other operation, like size(), and these names are obscure for non-MATLAB users.
b99839a
to
6b423ce
Compare
Updated PR with removed exports. @IainNZ Interesting! |
Deprecate flipud() and fliplr() in favor of flipdim()
@simonster It seems I have not articulated my concern well enough. You are absolutely right that the sparse matrix removal is orthogonal to this one. And while I am absolutely no fan of maintaining Matlab compatibility where their API is confusing, one cannot say that Julia takes in general an entirely different approach to API naming. In this case I simply cannot see what the issue with the function names was. |
Part of the goal of slimming down base is also slimming down the clutter in the default global namespace. As we've seen elsewhere, many of the obstacles to removing code from Base are related to naming conflicts. Multiple versions of different modules, either from different versions of Base or packages, both trying to export incompatible definitions of the same methods or types. We could have put these two methods behind a non-default import list. I think that will be the first step before we try removing anything else that existing packages depend on. For example right now I wouldn't terribly mind unexporting the sparse matrix functionality, one more import/using statement isn't the end of the world, but completely removing it from base would break all of JuliaOpt. |
This has nothing to do with trimming Base, but API cleanup. To @tknopp 's point, the |
@IainNZ thanks for the reference Now I currently work on the project together with a colleague and we address more the image analysis part. But since I have set up the repository as an organization there is an easy way to get into the project if you are interested. The more the merrier. |
@ayakimovich I've never really used Matlab myself, but I find it useful to provide a compatibility package for people who want to make the transition to Julia. |
I certainly think a compatibility package is useful - especially when porting codes and such. |
We do not provide other convenience functions for any other
operation, like size(), and these names are obscure for
non-MATLAB users.
I found only one use of
flipud
in base, and none offliplr
.BTW, I discovered something weird: if I call
flipud
first in the Julia session, calls tofliplr
do not trigger a deprecation warning; if I call the latter first, the reverse is true. Is that expected?