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

Add eachslice for Julia 1.1+ #58

Merged
merged 3 commits into from
Jul 3, 2019

Conversation

nickrobinson251
Copy link
Contributor

@nickrobinson251 nickrobinson251 commented Jul 2, 2019

@nickrobinson251
Copy link
Contributor Author

nickrobinson251 commented Jul 2, 2019

julia> a = rand(3, 3, 3);

julia> nda = NamedDimsArray(a, (:a, :b, :c));

julia> @btime (() -> eachslice($a; dims=3))();
  187.253 ns (3 allocations: 64 bytes)

julia> @btime (() -> eachslice($nda; dims=:c))();
  267.420 ns (5 allocations: 112 bytes)

updated #34 to be an issue about improving this situation

@codecov
Copy link

codecov bot commented Jul 2, 2019

Codecov Report

Merging #58 into master will increase coverage by 0.31%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #58      +/-   ##
==========================================
+ Coverage   86.11%   86.42%   +0.31%     
==========================================
  Files           8        8              
  Lines         216      221       +5     
==========================================
+ Hits          186      191       +5     
  Misses         30       30
Impacted Files Coverage Δ
src/functions.jl 95.83% <100%> (+1.09%) ⬆️

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 31a8195...8215e18. Read the comment docs.

@nickrobinson251 nickrobinson251 changed the title Add eachslices for Julia 1.1+ Add eachslice for Julia 1.1+ Jul 3, 2019
end
end
end

Copy link
Member

Choose a reason for hiding this comment

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

Do you think this is the best file for it ?
If you want to change it then do so, or if not then don't.
(Does not block this PR from being merge)

Everything else here is more programatic.

Maybe it is better in functions_dims ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it fits with "standard base overloads" more than "messing with dimensions" - and fitted better in the corresponding test file - but 🤷‍♂

will leave for now :)

@nickrobinson251
Copy link
Contributor Author

will bump patch version then merge

@nickrobinson251 nickrobinson251 merged commit 41d55be into invenia:master Jul 3, 2019
nickrobinson251 added a commit to nickrobinson251/NamedDims.jl that referenced this pull request Jul 21, 2019
* Add `eachslice` for Julia 1.1+

* Give each testset their own data

* Bump version
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