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

Adapt Manifolds to new Decorator type #388

Merged
merged 15 commits into from
Jun 30, 2021

Conversation

kellertuer
Copy link
Member

@kellertuer kellertuer commented Jun 23, 2021

...that was introduced in ManifoldsBase 0.12.0

This PR also

  • Reduces code lines in MetricManifold
  • Reduces code lines in Group Manifold
  • checks/updates docs

@kellertuer
Copy link
Member Author

The main rework is done, however there is more tests failing than I thought, so I might have missed something, hopefully just for the group manifold, since there we do not have explicit checks for transparency.

src/groups/group.jl Outdated Show resolved Hide resolved
src/groups/group.jl Outdated Show resolved Hide resolved
src/groups/group.jl Outdated Show resolved Hide resolved
src/groups/group.jl Outdated Show resolved Hide resolved
@kellertuer
Copy link
Member Author

kellertuer commented Jun 23, 2021

The group manifold has some little strange transparency tests that I do not yet understand, maybe @sethaxen you wrote them?
Why are there tests checking for a function with parameters (

@test Manifolds.decorator_transparent_dispatch(compose, G, x, x, x) ===
Val{:intransparent}()
@test Manifolds.decorator_transparent_dispatch(compose!, G, x, x, x) ===
Val{:intransparent}()
@test Manifolds.decorator_transparent_dispatch(group_exp, G, x, x) ===
Val{:intransparent}()
@test Manifolds.decorator_transparent_dispatch(group_log, G, x, x) ===
Val{:intransparent}()
@test Manifolds.decorator_transparent_dispatch(
) that I understand and that are currently covered (or I hope they are) and some that are without parameters (
for f in [compose, compose!, translate_diff!, translate_diff]
@test Manifolds.decorator_transparent_dispatch(f, G) === Val{:transparent}()
end
for f in [translate, translate!]
@test Manifolds.decorator_transparent_dispatch(f, G) === Val{:intransparent}()
end
for f in [inverse_translate_diff!, inverse_translate_diff]
@test Manifolds.decorator_transparent_dispatch(f, G) === Val{:transparent}()
end
for f in [group_exp!, group_exp, group_log, group_log!]
@test Manifolds.decorator_transparent_dispatch(f, G, x, x) ===
Val{:intransparent}()
end
for f in [get_vector, get_coordinates]
@test Manifolds.decorator_transparent_dispatch(f, G) === Val{:parent}()
end
) these I do not understand, especially since they are different to the first ones...

Edit: Since I seem to have last touched (git blame) the second part of lines, I might propose now to maybe delete those since I do not know what they are supposed to test.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mateuszbaran
Copy link
Member

Edit: Since I seem to have last touched (git blame) the second part of lines, I might propose now to maybe delete those since I do not know what they are supposed to test.

IIRC such tests are there to just notify that transparency changed. If the change is deliberate, you can adjust the test. If it's not, It'd be better to fix the code.

@kellertuer
Copy link
Member Author

The main problem is, that the two contradict, so with parameters is different form without, and I think that is not only strange but also that without parameters the testing is not even well defined nor useful?

@mateuszbaran
Copy link
Member

Ah, OK, so you can just remove these tests then I think.

@kellertuer
Copy link
Member Author

Hm, seems that I have introduced some side effects that I did not intent to; I will have to check closer what is going wrong currently. Sorry that it will take a while, since it seems the CompatHelper still gives us an update every day ( I thought that was fixed?)

@mateuszbaran
Copy link
Member

Hm, seems that I have introduced some side effects that I did not intent to; I will have to check closer what is going wrong currently.

No problem. I will continue my work on connections after this is done but I have plenty of other things to do 🙂 . Including writing of better documentation for groups (it's very basic right now).

it seems the CompatHelper still gives us an update every day ( I thought that was fixed?)

Maybe 0.12.1 release triggered it again? We could easily check 🙂

* Makes the original group transparency type the transparent one
* Introduce a default transparency type, that is similar to the DefaultEmbedding one.
* reimplement the `base_manifold` scheme also for (abstract) groups
src/groups/group.jl Outdated Show resolved Hide resolved
src/groups/group.jl Outdated Show resolved Hide resolved
@kellertuer
Copy link
Member Author

I hope I finally fixed the tests.

  • There were two kinds of transparencies used. Instead of having a Hierarchy that (as currently) goes first to the decorator then the transparency type, we could maybe do it the other way around, that would reduce code by a few lines (i.e. Having a TransparentDecoratorType as a super type for TransparentEmbedding and TransparentGroup).
  • one function had to be reimplemented: base_manifold.

@codecov
Copy link

codecov bot commented Jun 25, 2021

Codecov Report

Merging #388 (d631822) into master (991569f) will decrease coverage by 0.19%.
The diff coverage is 60.31%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #388      +/-   ##
==========================================
- Coverage   97.92%   97.72%   -0.20%     
==========================================
  Files          76       76              
  Lines        5914     5841      -73     
==========================================
- Hits         5791     5708      -83     
- Misses        123      133      +10     
Impacted Files Coverage Δ
src/Manifolds.jl 100.00% <ø> (ø)
src/groups/group.jl 90.76% <50.00%> (-3.52%) ⬇️
src/groups/group_action.jl 87.50% <55.55%> (-4.17%) ⬇️
src/groups/general_linear.jl 100.00% <100.00%> (ø)
src/groups/special_linear.jl 100.00% <100.00%> (ø)
src/manifolds/HyperbolicHyperboloid.jl 100.00% <100.00%> (ø)
src/manifolds/MetricManifold.jl 97.41% <100.00%> (-0.92%) ⬇️
src/manifolds/Rotations.jl 95.81% <0.00%> (-0.02%) ⬇️

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 991569f...d631822. Read the comment docs.

@kellertuer
Copy link
Member Author

The 13 lines we miss are due to macros not being checked correctly (I shortened code there by replacing a function definition and a @signature with the direct @function. I will look at the lins closely when investigating the documentation.

@kellertuer
Copy link
Member Author

The 13 lines we still miss might be due to an issue like JuliaLang/julia#36283

@kellertuer kellertuer added the documentation Improvements or additions to documentation label Jun 27, 2021
@kellertuer kellertuer added the Ready-for-Review A label for pull requests that are feature-ready label Jun 27, 2021
@kellertuer kellertuer mentioned this pull request Jun 27, 2021
7 tasks
@mateuszbaran
Copy link
Member

Yes, all of these failures look like false positives.

docs/src/interface.md Outdated Show resolved Hide resolved
docs/src/interface.md Outdated Show resolved Hide resolved
docs/src/interface.md Outdated Show resolved Hide resolved
src/groups/group.jl Outdated Show resolved Hide resolved
src/groups/group.jl Outdated Show resolved Hide resolved
src/groups/group.jl Outdated Show resolved Hide resolved
src/groups/group.jl Outdated Show resolved Hide resolved
src/groups/group.jl Outdated Show resolved Hide resolved
src/groups/group.jl Show resolved Hide resolved
Co-authored-by: Mateusz Baran <[email protected]>
Copy link
Member

@mateuszbaran mateuszbaran left a comment

Choose a reason for hiding this comment

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

OK, I think this is fine now 🙂

@kellertuer
Copy link
Member Author

Nice! I will wait for the tests and merge maybe in the evening or tomorrow morning.

@kellertuer kellertuer merged commit fcc8645 into master Jun 30, 2021
@kellertuer kellertuer deleted the kellertuer/decorator-adaptions branch June 30, 2021 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Ready-for-Review A label for pull requests that are feature-ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants