Skip to content

Commit

Permalink
Make Traits a bit more stable (#203)
Browse files Browse the repository at this point in the history
* Use `ManifoldsBase.` prefix in trait macros to make the macros safer when used outside of ManifoldsBase.
* bump version.
  • Loading branch information
kellertuer committed Sep 13, 2024
1 parent 0e45f73 commit 30d587b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ 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.15.16] 13/09/2024

### Changed

* Adapt the traits, so that they also can be used when only `using ManifoldsBase`,
without importing internal `struct`s like `EmptyTrait` and `TraitList`

## [0.15.15] 29/08/2024

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ManifoldsBase"
uuid = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
authors = ["Seth Axen <[email protected]>", "Mateusz Baran <[email protected]>", "Ronny Bergmann <[email protected]>", "Antoine Levitt <[email protected]>"]
version = "0.15.15"
version = "0.15.16"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
6 changes: 3 additions & 3 deletions src/nested_trait.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ macro trait_function(sig, opts = :(), manifold_arg_no = 1)
return ($fname)(trait($fname, $(argnames...)), $(argnames...); $(kwargs_call...))
end
@inline function ($fname)(
_t::TraitList,
_t::ManifoldsBase.TraitList,
$(callargs...);
$(kwargs_list...),
) where {$(where_exprs...)}
return ($fname)(next_trait(_t), $(argnames...); $(kwargs_call...))
end
@inline function ($fname)(
_t::TraitList{IsExplicitDecorator},
_t::ManifoldsBase.TraitList{ManifoldsBase.IsExplicitDecorator},
$(callargs...);
$(kwargs_list...),
) where {$(where_exprs...)}
Expand All @@ -339,7 +339,7 @@ macro trait_function(sig, opts = :(), manifold_arg_no = 1)
# See https://discourse.julialang.org/t/extremely-slow-invoke-when-inlined/90665
# for the reasoning behind @noinline
@noinline function ($fname)(
::EmptyTrait,
::ManifoldsBase.EmptyTrait,
$(callargs...);
$(kwargs_list...),
) where {$(where_exprs...)}
Expand Down

2 comments on commit 30d587b

@kellertuer
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

  • Adapt the traits, so that they also can be used when only using ManifoldsBase,
    without importing internal structs like EmptyTrait and TraitList

@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/115145

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.15.16 -m "<description of version>" 30d587bcef68a35146ef7a86c31e3182b5e29c19
git push origin v0.15.16

Please sign in to comment.