Skip to content

Commit

Permalink
change keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieugomez committed Jun 20, 2024
1 parent a1d9662 commit 8aa62cc
Show file tree
Hide file tree
Showing 2 changed files with 5 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 = "InfinitesimalGenerators"
uuid = "2fce0c6f-5f0b-5c85-85c9-2ffe1d5ee30d"
version = "2.2.0"
version = "2.3.0"

[deps]
Arpack = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97"
Expand Down
8 changes: 4 additions & 4 deletions src/derivatives.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# bc corresponds to value of first derivative outside the grid. Default to (0, 0), which corresponds to reflecting.
struct FirstDerivative{T, X <: AbstractVector{<:Real}, Y <: AbstractVector{<: Real}} <: AbstractVector{T}
x::X
y::Y
Expand All @@ -7,20 +7,20 @@ struct FirstDerivative{T, X <: AbstractVector{<:Real}, Y <: AbstractVector{<: Re
function FirstDerivative(x, y, bc, direction)
size(x) == size(y) || throw(DimensionMismatch(
"cannot match grid of length $(length(x)) with vector of length $(length(y))"))
direction (:upward, :downward) || throw(ArgumentError("direction must be :upward or :downward"))
direction (:forward, :backward) || throw(ArgumentError("direction must be :forward or :backward"))
return new{float(eltype(y)), typeof(x), typeof(y)}(x, y, bc, direction)
end
end

FirstDerivative(x, y; bc = (0, 0), direction = :upward) = FirstDerivative(x, y, bc, direction)
FirstDerivative(x, y; bc = (0, 0), direction = :forward) = FirstDerivative(x, y, bc, direction)

Base.size(d::FirstDerivative) = (length(d.x), 1)

Base.IndexStyle(d::FirstDerivative) = IndexLinear()

function Base.getindex(d::FirstDerivative{T}, i::Int) where {T}
x, y, bc, direction = d.x, d.y, d.bc, d.direction
if direction == :upward
if direction == :forward
if i == length(x)
return convert(T, bc[end])
else
Expand Down

2 comments on commit 8aa62cc

@matthieugomez
Copy link
Owner 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/109429

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 v2.3.0 -m "<description of version>" 8aa62ccc39f774086a2bd3550a885d9562e59675
git push origin v2.3.0

Please sign in to comment.