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

Improve Test style and coverage #319

Merged
merged 17 commits into from
Jan 8, 2021
Merged

Conversation

kellertuer
Copy link
Member

@kellertuer kellertuer commented Dec 26, 2020

This PR resolves #259 and

  • I checked all files and for the lines not mentioned below we do have tests that do not trigger somwhow/why.
  • I removed all >= 1.3 checks since we have 1.3 as a minimium requirement already.
  • should we exclude the manifold test functions form coverage? Currently a few @testsets are missed and a few nonmutating else-cases,

The following is a list of lines where I am not sure how to cover those, but it would be great to have these covered, too.
Sure with our current coverage this is maybe not that necessary, I just would like to have some feedback in them :)

@kellertuer kellertuer added help wanted Extra attention is needed restructure labels Dec 26, 2020
@codecov
Copy link

codecov bot commented Dec 26, 2020

Codecov Report

Merging #319 (4922d17) into master (a1b604f) will increase coverage by 0.88%.
The diff coverage is 86.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #319      +/-   ##
==========================================
+ Coverage   95.97%   96.86%   +0.88%     
==========================================
  Files          69       69              
  Lines        4646     4655       +9     
==========================================
+ Hits         4459     4509      +50     
+ Misses        187      146      -41     
Impacted Files Coverage Δ
src/Manifolds.jl 100.00% <ø> (ø)
src/distributions.jl 50.00% <ø> (+16.66%) ⬆️
src/manifolds/CenteredMatrices.jl 100.00% <ø> (ø)
src/manifolds/HyperbolicHyperboloid.jl 100.00% <ø> (+6.74%) ⬆️
src/manifolds/ProjectiveSpace.jl 100.00% <ø> (ø)
src/manifolds/Sphere.jl 100.00% <ø> (ø)
...manifolds/SymmetricPositiveDefiniteLinearAffine.jl 100.00% <ø> (ø)
src/riemannian_diff.jl 89.47% <ø> (ø)
src/utils.jl 83.63% <ø> (+4.68%) ⬆️
src/tests/tests_group.jl 94.33% <53.84%> (ø)
... and 34 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 a1b604f...d01401e. Read the comment docs.

@mateuszbaran
Copy link
Member

Wow, thanks for working on it. That's a nice cleanup. I will try to find some time to give you some feedback here.

@mateuszbaran
Copy link
Member

  • should we exclude the manifold test functions form coverage? Currently a few @testsets are missed and a few nonmutating else-cases,

I wouldn't exclude them but covering them seems like a low priority task.

Sure with our current coverage this is maybe not that necessary, I just would like to have some feedback in them :)

Sure, we have a good coverage but of course it can be improved 🙂 .

[ ] What do we do about the statistics default warning?

Which default warning?

[ ] Can we do a test for https://codecov.io/gh/JuliaManifolds/Manifolds.jl/src/master/src/groups/metric.jl#L216

Sure, we just need a metric group manifold with a non-bi-invariant metric.

How can we best test the det_local_metric? For example

I think the whole metric stuff needs a larger rework aimed at addressing #6. IIRC this quantity depends on the selection of a chart so this is somewhat broken now. I think this is perhaps supposed to return this for normal coordinates which is I think well defined but I don't like it anyway.

That looks doable, I'll take a look at it later.

[ ] Which errors do appear in Rotations? https://codecov.io/gh/JuliaManifolds/Manifolds.jl/src/master/src/manifolds/Rotations.jl#L438

I don't know, sylvester for custom array types could throw something else so I wouldn't touch it.

Probably yes but it looks like a very special case.

Sure, I can add that.

@kellertuer
Copy link
Member Author

Thanks for the long response. I think we do not have to solve all of my points, for example if the det local metric is not yet finished, there is surely no need to do a test.

[ ] What do we do about the statistics default warning?

Which default warning?

Sorry, that I forgot to link something, this one
https://github.com/JuliaManifolds/Manifolds.jl/pull/319/checks?check_run_id=1611331687#step:5:395

[ ] Which errors do appear in Rotations? https://codecov.io/gh/JuliaManifolds/Manifolds.jl/src/master/src/manifolds/Rotations.jl#L438

I don't know, sylvester for custom array types could throw something else so I wouldn't touch it.

I did mean, to we have a case where we expect the rethrow so we can check that line? Or can we do that in a one-line instead of with an if?

@mateuszbaran
Copy link
Member

Thanks for the long response. I think we do not have to solve all of my points, for example if the det local metric is not yet finished, there is surely no need to do a test.

No problem, I'll go through other points too 🙂 .

Sorry, that I forgot to link something, this one
https://github.com/JuliaManifolds/Manifolds.jl/pull/319/checks?check_run_id=1611331687#step:5:395

I'd leave it for now.

I did mean, to we have a case where we expect the rethrow so we can check that line? Or can we do that in a one-line instead of with an if?

It can be either tested by providing a custom method for sylvester for some custom types. It can also be rewritten in one line using the ternary operator ? : but the rethrow still wouldn't be covered. Ideally JuliaLang/julia#7026 would solve this.

@mateuszbaran
Copy link
Member

eigvals from StaticArrays.jl should be good enough now, I've removed it. ziptuples is still needed since it's not in StaticArrays.jl I think? eigen_safe can probably be removed as well.

[ ] is there an easy test for projected point distributions support ? https://codecov.io/gh/JuliaManifolds/Manifolds.jl/src/master/src/projected_distribution.jl#L45

There seems to be an actual major problem with projected point distributions (they seem to not work at all).

@mateuszbaran
Copy link
Member

[ ] How far is the Riemannian gradient function stuff, we could add differential! and gradient! tests? https://codecov.io/gh/JuliaManifolds/Manifolds.jl/src/master/src/riemannian_diff.jl#L27

These are just some fallbacks that aren't used. Riemannian gradients should work, let me know if there are any problems. You should be able to use them in Manopt.jl.

@kellertuer
Copy link
Member Author

Cool, I hopefully find time to check it or write an example about that then.

@mateuszbaran
Copy link
Member

I've updated formatting and hopefully fixed the projected distributions. I don't know why they had the decorator dispatch but it seems to only break things. Maybe it would be nice to fix it but :parent dispatch on metric manifold, which I thought should do the right thing, apparently unwrapped the metric decorator in the Euclidean manifold tests.

@kellertuer
Copy link
Member Author

Thanks for working on that. I hopefully find some time this week to also add a test or two. You can also mark things that we discussed.

Are there tests available for the fallbacks of the Riemannian Gradient or do we leave those untested?

@mateuszbaran
Copy link
Member

Thanks for working on that. I hopefully find some time this week to also add a test or two. You can also mark things that we discussed.

Thanks, I've marked a few things but some are only partially resolved.

Are there tests available for the fallbacks of the Riemannian Gradient or do we leave those untested?

I'd vote for merging this PR before any other new work since it touches quite a few files, and any remaining points could be put in an issue. Actually, this PR may be worth splitting into a few PRs with a smaller scope instead of solving here every issue you've listed in the first comment.

@kellertuer
Copy link
Member Author

Ok, sure, we can just mark them atop that we will do them later and finish this PR. I just came across making that list since I had rewritten our tests a little bit and an hour left to go through uncovered lines.

@kellertuer
Copy link
Member Author

I think I just did 4 more lines. Can we mark the ones we move in the initial comment (maybe with an X after the box or an -> new PR at the end?) and check the box upfront?

src/statistics.jl Outdated Show resolved Hide resolved
@mateuszbaran
Copy link
Member

I think I just did 4 more lines. Can we mark the ones we move in the initial comment (maybe with an X after the box or an -> new PR at the end?) and check the box upfront?

Maybe let's merge this PR and copy all points that are not checked as done?

@kellertuer
Copy link
Member Author

kellertuer commented Jan 7, 2021

Ok. Would you mind copying those and whereto? An Issue or multiple issues?

edit: I just lost track which ones we would resolve where, that's why I am asking.

@mateuszbaran
Copy link
Member

Sure, I'll open a new issue.

@mateuszbaran
Copy link
Member

OK, so can we merge this now?

@kellertuer
Copy link
Member Author

In my opinion, yes.

@mateuszbaran mateuszbaran merged commit 85e3940 into master Jan 8, 2021
@kellertuer kellertuer deleted the kellertuer/improve-test branch June 4, 2021 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed restructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve test suite organization
2 participants