Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7e239f3

Browse files
authoredApr 7, 2025··
Merge pull request #136 from tpapp/tp/clarify-inverse-API
Add note about stability of `inverse` etc eltypes.
2 parents 5263ffe + 085e8d9 commit 7e239f3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/generic.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ with transform, so the following holds:
153153
```julia
154154
inverse(t)(y) == inverse(t, y) == inverse(transform(t))(y)
155155
```
156+
157+
!!! note
158+
`eltype(inverse(t, transform(t, x)))` is not necessarily equal to `eltype(x)`,
159+
it is not guaranteed to be the narrowest possible type, and may change without
160+
warning between versions. Some effort is made to come up with a reasonable
161+
concrete type even in corner cases.
156162
"""
157163
inverse(t::AbstractTransform) = Base.Fix1(inverse, t)
158164

@@ -174,6 +180,11 @@ inverse(f::CallableInverse) = Base.Fix1(transform, f.x)
174180
`$(FUNCTIONNAME)(t::AbstractTransform, y)`
175181
176182
The element type for vector `x` so that `inverse!(x, t, y)` works.
183+
184+
!!! note
185+
It is not guaranteed that the result is the narrowest possible type, and may change
186+
without warning between versions. Some effort is made to come up with a reasonable
187+
concrete type even in corner cases.
177188
"""
178189
function inverse_eltype end
179190

2 commit comments

Comments
 (2)

devmotion commented on Apr 7, 2025

@devmotion
Collaborator

JuliaRegistrator commented on Apr 7, 2025

@JuliaRegistrator

Registration pull request created: JuliaRegistries/General/128597

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

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.8.16 -m "<description of version>" 7e239f3512fc787623a396e908a97547d6f11bb7
git push origin v0.8.16
Please sign in to comment.