8000 ENH: better error message for invalid axis and concatenate inputs by juliantaylor · Pull Request #4926 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: better error message for invalid axis and concatenate inputs #4926

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

Merged
merged 1 commit into from
Aug 4, 2014

Conversation

juliantaylor
Copy link
Contributor

the old errors
np.concatenate(1,2)
TypeError: object of type 'int' has no len()

concatenate([1], [2])
TypeError: an integer is required

are not very helpful, add a new internal function that allows adding
some context to axis argument conversion failures and check for sequence
inputs in concatenate.
Closes gh-4923.

@juliantaylor
Copy link
Contributor Author

if we put the functions in the header or the API we could also use it for the ufunc axis arguments. There are probably also a few more places to put this.

the concatenate error message as confused me alot when I started using numpy, just remembered the pain with the report :) so I'd like to put it into 1.9 so a non API approach is probably better.

the old errors
np.concatenate(1,2)
TypeError: object of type 'int' has no len()

concatenate([1], [2])
TypeError: an integer is required

are not very unhelpful, add a new internal function that allows adding
some context to axis argument conversion failures and check for sequence
inputs in concatenate.
Closes numpygh-4923.
charris added a commit that referenced this pull request Aug 4, 2014
ENH: better error message for invalid axis and concatenate inputs
@charris charris merged commit 7e53e9b into numpy:master Aug 4, 2014
@charris
Copy link
Member
charris commented Aug 4, 2014

Thanks Julian.

@juliantaylor
Copy link
Contributor Author

ok for 1.9?

@charris
Copy link
Member
charris commented Aug 4, 2014

That's up to you, but I don't think it is needed.

juliantaylor added a commit that referenced this pull request Aug 4, 2014
ENH: better error message for invalid axis and concatenate inputs
@juliantaylor
Copy link
Contributor Author

added, I think its a significant usability improvement of the function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

concatenate error could be more helpful
2 participants
0