Skip to content
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

ndim vs. rank #379

Closed
henryiii opened this issue Jun 29, 2020 · 1 comment · Fixed by #385
Closed

ndim vs. rank #379

henryiii opened this issue Jun 29, 2020 · 1 comment · Fixed by #385
Milestone

Comments

@henryiii
Copy link
Member

Boost.Histogram uses "rank" to provide the number of axes in a histogram. NumPy uses .ndim to get the number of dimensions of a histogram. Moving between histograms and arrays is a little harder due to the different names (I just got caught telling Nino to use .ndim on a histogram). NumPy used to provide np.rank, but it was deprecated in favor of np.ndim in 1.9 (not 1.10, contrary to the 1.18 release notes claim) and removed in 1.18.

Options:

  1. Support .ndim for normal boost-histogram, and .rank for cpp module. One way to do it, and all that.
  2. Add .ndim and keep .rank, for maximum compatibility with both Boost.Histogram and NumPy.
    a. Python only
    b. Python + cpp module.
  3. Keep as is.

@HDembinski, please advise.

@HDembinski
Copy link
Member

HDembinski commented Jun 30, 2020

Option 1 is best, I agree.

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 a pull request may close this issue.

2 participants