Closed oxinabox closed 2 years ago
Merging #163 (590b88e) into master (92a5178) will increase coverage by
0.34%
. The diff coverage is96.66%
.
@@ Coverage Diff @@
## master #163 +/- ##
==========================================
+ Coverage 90.33% 90.68% +0.34%
==========================================
Files 8 8
Lines 414 397 -17
==========================================
- Hits 374 360 -14
+ Misses 40 37 -3
Impacted Files | Coverage Δ | |
---|---|---|
src/pdsparsemat.jl | 94.64% <94.44%> (+0.30%) |
:arrow_up: |
src/utils.jl | 95.65% <95.45%> (+3.98%) |
:arrow_up: |
src/pdiagmat.jl | 98.76% <100.00%> (-0.22%) |
:arrow_down: |
src/scalmat.jl | 96.66% <100.00%> (ø) |
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 92a5178...590b88e. Read the comment docs.
@devmotion what do you think. is this good to go now?
Or do you want
bump
@oxinabox can you also rebase on master?
The approach here of just demanding indexes are the same seems to be what is recommended by this thread. Rather than assuming that iteration order is order we should add together. https://discourse.julialang.org/t/discussion-on-why-i-no-longer-recommend-julia-by-yuri-vishnevsky/81151/314?u=oxinabox
@devmotion I'll let you have a last look but LGTM
This PR is a follow up to https://github.com/JuliaStats/PDMats.jl/pull/162#issuecomment-1135971969
It relaxes the StridedMatrix restrictions and uses
eachindex
,axes
and broadcasting rather than1:size(x,2)
etc. A lot of places were usingStridedMatrix
with the assumption that it indexed safe with that scheme. (Which is not infact true, AFAIK, as any array extendingDenseArray
is aStridedArray
. AndDenseArray only requires contiguously in memory. But realistically
OffsetArraysdoesn't actually subtype
DenseArray`, so doesn't really matter)This PR changes:
1:size(x,2)
toaxes(x, 2)
and1:length(x)
toeachindex(x)
(this is done even when the types were not relaxed as it reads better)@checkargs
to now checkseachindex
andaxes
, rather thanlength
andsize
. (this makes certain they are indexed the same when we are using one eachindex rather than other. Foreachindex
we could use the 2 arg form but mostly we want to match aeachindex(a)
against aaxes(x,2)
, so can't)StridedArray
intoAbstractArray
It currently adds no tests, I am not familar with how this package is tested so I don't know if there is an easy way to test it e.g. with OffsetArrays or noncontigious SubArrays or something.