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

feature ndim #577

Merged
merged 9 commits into from
Jun 5, 2020
Merged

feature ndim #577

merged 9 commits into from
Jun 5, 2020

Conversation

mtar
Copy link
Collaborator

@mtar mtar commented Jun 2, 2020

Description

Add method ndim to dndarray for NumPy-API-compatibility. Will replaces numdims()

Issue/s resolved: None

Changes proposed:

  • additional DNDarray method ndim
  • deprecation warning on numdims
  • replace function calls

Type of change

New feature

Due Diligence

  • All split configurations tested
  • Multiple dtypes tested in relevant functions
  • Documentation updated (if needed)
  • Updated changelog.md under the title "Pending Additions"

Does this change modify the behaviour of other functions? If so, which?

no

@codecov
Copy link

codecov bot commented Jun 2, 2020

Codecov Report

Merging #577 into master will increase coverage by 0.00%.
The diff coverage is 98.27%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #577   +/-   ##
=======================================
  Coverage   96.47%   96.47%           
=======================================
  Files          75       75           
  Lines       15161    15169    +8     
=======================================
+ Hits        14626    14634    +8     
  Misses        535      535           
Impacted Files Coverage Δ
heat/core/operations.py 92.77% <ø> (ø)
heat/regression/lasso.py 91.52% <75.00%> (ø)
heat/core/dndarray.py 96.84% <100.00%> (+0.01%) ⬆️
heat/core/indexing.py 100.00% <100.00%> (ø)
heat/core/linalg/basics.py 93.67% <100.00%> (ø)
heat/core/linalg/solver.py 68.36% <100.00%> (ø)
heat/core/manipulations.py 99.51% <100.00%> (ø)
heat/core/statistics.py 97.82% <100.00%> (ø)
heat/core/tests/test_dndarray.py 99.37% <100.00%> (+<0.01%) ⬆️
heat/core/tiling.py 96.35% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca40f93...8d95f77. Read the comment docs.

@mtar mtar added the good first issue Good for newcomers label Jun 2, 2020
@mtar mtar changed the title feature ndims feature ndim Jun 2, 2020
@mtar mtar requested a review from ClaudiaComito June 3, 2020 10:41
Copy link
Contributor

@ClaudiaComito ClaudiaComito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YES! 👏
I'd be for not going through numdims though. In fact, I'd be for deprecating numdims and removing it before v1.0. What do you think?

@mtar
Copy link
Collaborator Author

mtar commented Jun 4, 2020

I think so, too. Neither Numpy nor Pytorch use 'numdims'. ndim should be the preferred method name.
Does Numpy have any aliases for this function?

Pytorch's equivalent function is called dim(). ndim() and ndimension() are two aliases I'm aware of. Should we add them? I don't think that we need those as we're striving for numpy API compatibility.

ClaudiaComito
ClaudiaComito previously approved these changes Jun 4, 2020
@ClaudiaComito ClaudiaComito merged commit 7ed9e58 into master Jun 5, 2020
@ClaudiaComito ClaudiaComito deleted the feature/ndims branch June 5, 2020 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants