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

map(f,::DNDSparse) fix for changing value type #316

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gkappler
Copy link

fixes failing

filter(isodd, map(v->v.a+1,ndsparse((numid=1:10,), (a=1:10,b=1:10); chunks=2)))

@gkappler
Copy link
Author

promote_type seemed overkill at first to me; yet it might be required in corner cases.

src/ndsparse.jl Outdated
@@ -483,10 +483,11 @@ internally by many DNDSparse operations.
"""
function mapchunks(f, t::DNDSparse{K,V}; keeplengths=true) where {K,V}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice we should probably remove the V from here.

Copy link
Author

Choose a reason for hiding this comment

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

Agreed, I changed the PR accordingly.

@gkappler gkappler force-pushed the mapchunks branch 2 times, most recently from 8cb9d34 to d67cd0a Compare August 19, 2020 11:52
fixes failing cases like
filter(isodd, map(v->v.a+1,ndsparse((numid=1:10,), (a=1:10,b=1:10); chunks=2)))
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.

2 participants