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

Rename 'eye' #1054

Closed
AlexMouton opened this Issue Mar 1, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@AlexMouton

AlexMouton commented Mar 1, 2018

Just a vote here to rename this to 'identity'.
Two reasons, Identity is ubiquitous, and an 'eye matrix' can be confused for a view/projection/look-at matrix in graphics environments.

@josdejong josdejong referenced this issue Mar 1, 2018

Closed

Breaking changes for v5 #1045

7 of 7 tasks complete
@josdejong

This comment has been minimized.

Owner

josdejong commented Mar 1, 2018

Thanks for your suggestion. I think eye is quite common too and used in various math applications. I'm open to discussing renaming the function to identity which is indeed more clear.

At least it's very easy to create an alias identity for your self and use that instead of eye if you want :)

@harrysarson

This comment has been minimized.

Collaborator

harrysarson commented May 29, 2018

For reference:

MATLAB has eye.
numpy has both eye and identity

@josdejong

This comment has been minimized.

Owner

josdejong commented May 31, 2018

Thanks! Scilab uses eye too, and Wolfram Alpha uses IdentityMatrix.

I prefer having just one of the two, not both. If people really want they can always make an alias themselves.

@josdejong

This comment has been minimized.

Owner

josdejong commented Jun 6, 2018

I would like to decide upon this now. I prefer identity since it better reflects what the function is about. This means a breaking change though, we'll start with implementing identity and marking eye deprecated, have it output a console warning when used.

@josdejong

This comment has been minimized.

Owner

josdejong commented Jun 6, 2018

I've renamed eye to identity. Using eye throws an error explaining to use identity now. Will be released in v5.

@josdejong josdejong closed this in cf5c1c1 Jun 16, 2018

mvarble added a commit to mvarble/DefinitelyTyped that referenced this issue Sep 19, 2018

Changed "eye" to "identity"
As discussed in the link below, the mathjs.eye function was renamed to mathjs.identity in v5.

josdejong/mathjs#1054.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment