Skip to content

Commit

Permalink
Error message for identity_element on ProductManifold without RAT.jl (#…
Browse files Browse the repository at this point in the history
…739)

* Error message for identity_element on ProductManifold without RAT.jl

* fix tests

* don't test representation for product and semidirect product groups

* disable one more test

* disable even more
  • Loading branch information
mateuszbaran committed Aug 30, 2024
1 parent c8258b9 commit e31e7b0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 7 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.1] – 2024-08-29

### Changed

* `identity_element` on `ProductManifold` without `RecursiveArrayTools.jl` now prints a useful error message.

## [0.10.0] – 2024-08-24

### Changed
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Manifolds"
uuid = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
authors = ["Seth Axen <[email protected]>", "Mateusz Baran <[email protected]>", "Ronny Bergmann <[email protected]>", "Antoine Levitt <[email protected]>"]
version = "0.10.0"
version = "0.10.1"

[deps]
Einsum = "b7d42ee7-0b51-5a75-98ca-779d3107e4c0"
Expand Down Expand Up @@ -55,7 +55,7 @@ HybridArrays = "0.4"
Kronecker = "0.4, 0.5"
LinearAlgebra = "1.6"
ManifoldDiff = "0.3.7"
ManifoldsBase = "0.15.8"
ManifoldsBase = "0.15.15"
Markdown = "1.6"
MatrixEquations = "2.2"
NLsolve = "4"
Expand Down
3 changes: 2 additions & 1 deletion src/groups/group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ end

function allocate_result(G::AbstractDecoratorManifold, f::typeof(identity_element))
apf = allocation_promotion_function(G, f, ())
return zeros(apf(Float64), representation_size(G)...)
rs = representation_size(G)
return ManifoldsBase.allocate_result_array(G, f, apf(Float64), rs)
end

@doc raw"""
Expand Down
6 changes: 3 additions & 3 deletions test/groups/groups_general.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using Manifolds:
@test !has_biinvariant_metric(NotImplementedManifold())
@test !has_invariant_metric(NotImplementedManifold(), LeftForwardAction())
@test is_identity(G, eg) # identity transparent
@test_throws MethodError identity_element(G) # but for a NotImplOp there is no concrete id.
@test_throws ErrorException identity_element(G) # but for a NotImplOp there is no concrete id.
@test isapprox(G, eg, eg)
@test !isapprox(G, Identity(AdditionOperation()), eg)
@test !isapprox(G, Identity(AdditionOperation()), eg)
Expand All @@ -38,7 +38,7 @@ using Manifolds:
)
@test_throws DomainError is_point(G, Identity(AdditionOperation()); error=:error)
@test is_point(G, eg)
@test_throws MethodError is_identity(G, 1) # same error as before i.e. dispatch isapprox works
@test_throws ErrorException is_identity(G, 1) # same error as before i.e. dispatch isapprox works
@test Manifolds.check_size(G, eg) === nothing
@test Manifolds.check_size(
Manifolds.EmptyTrait(),
Expand All @@ -54,7 +54,7 @@ using Manifolds:
error=:error,
)
# identity_element for G not implemented
@test_throws MethodError is_vector(G, eg, X; error=:error)
@test_throws ErrorException is_vector(G, eg, X; error=:error)
@test Identity(NotImplementedOperation()) === eg
@test Identity(NotImplementedOperation) === eg
@test !is_point(G, Identity(AdditionOperation()))
Expand Down
1 change: 1 addition & 0 deletions test/groups/metric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ end
#test_inplace=true,
test_vee_hat=false,
exp_log_atol_multiplier=50,
test_representation_size=false,
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/groups/product_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ using RecursiveArrayTools
test_mutating=false,
test_adjoint_action=true,
)
test_manifold(G, pts; is_mutating=false)
test_manifold(G, pts; is_mutating=false, test_representation_size=false)
@test isapprox(
G,
exp_lie(G, X_pts[1]),
Expand Down
4 changes: 4 additions & 0 deletions test/groups/special_euclidean.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ using Manifolds:
#test_inplace=true,
test_vee_hat=true,
exp_log_atol_multiplier=50,
test_representation_size=false,
)

for CS in [CartanSchoutenMinus(), CartanSchoutenPlus(), CartanSchoutenZero()]
Expand All @@ -162,6 +163,7 @@ using Manifolds:
is_tangent_atol_multiplier=1,
test_inner=false,
test_norm=false,
test_representation_size=false,
)
end
end
Expand Down Expand Up @@ -189,6 +191,7 @@ using Manifolds:
is_mutating=true,
exp_log_atol_multiplier=50,
is_tangent_atol_multiplier=1,
test_representation_size=false,
)
end
end
Expand Down Expand Up @@ -223,6 +226,7 @@ using Manifolds:
test_vee_hat=true,
test_is_tangent=true, # fails
exp_log_atol_multiplier=50,
test_representation_size=false,
)
# specific affine tests
p = copy(G, pts[1])
Expand Down
2 changes: 2 additions & 0 deletions test/manifolds/product_manifold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ using RecursiveArrayTools: ArrayPartition
test_inplace=true,
test_rand_point=true,
test_rand_tvector=true,
test_representation_size=false,
)

@testset "manifold tests (static size)" begin
Expand Down Expand Up @@ -202,6 +203,7 @@ using RecursiveArrayTools: ArrayPartition
basis_types_to_from=basis_types,
is_tangent_atol_multiplier=1,
exp_log_atol_multiplier=1,
test_representation_size=false,
)
@test number_eltype(pts[1]) === Float64

Expand Down

2 comments on commit e31e7b0

@mateuszbaran
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:

Changed

  • identity_element on ProductManifold without RecursiveArrayTools.jl now prints a useful error message.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/114189

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.1 -m "<description of version>" e31e7b088b402af19741ef3b300eccc850d96edc
git push origin v0.10.1

Please sign in to comment.