Skip to content

Commit

Permalink
Tweak Zero to vec (#115)
Browse files Browse the repository at this point in the history
* Tweak Zero to vec

* Bump patch

* Fix Diagonal

* Revert Diagonal changes
  • Loading branch information
willtebbutt authored Nov 20, 2020
1 parent b71d2fc commit 673d6fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "FiniteDifferences"
uuid = "26cc04aa-876d-5657-8c51-4c34ba976000"
version = "0.11.2"
version = "0.11.3"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
6 changes: 2 additions & 4 deletions src/to_vec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ end


function FiniteDifferences.to_vec(x::AbstractZero)
function AbstractZero_from_vec(z)
length(z) == 1 || throw(DimensionMismatch("tried to go back to $x from $z"))
iszero(first(z)) || throw(DomainError(first(z)))
function AbstractZero_from_vec(x_vec::Vector)
return x
end
return [false], AbstractZero_from_vec
return Bool[], AbstractZero_from_vec
end

2 comments on commit 673d6fa

@willtebbutt
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()

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

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.11.3 -m "<description of version>" 673d6fa25c6eb7ac8a97d3e4ea8ca250219d3f88
git push origin v0.11.3

Please sign in to comment.