Skip to content

Commit

Permalink
fixed jldoctest
Browse files Browse the repository at this point in the history
MartinuzziFrancesco committed Dec 10, 2023
1 parent 655e011 commit b4d6ec7
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/axioms.jl
Original file line number Diff line number Diff line change
@@ -160,11 +160,13 @@ parameters, and optional keyword arguments.
# Examples
```jldoctest
julia> using SpectralIndices
julia> compute(NDVI; N=0.643, R=0.175)
0.5721271393643031
```
```jldoctest
julia> using SpectralIndices
julia> compute(NDVI; N=fill(0.643, (5, 5)), R=fill(0.175, (5, 5)))
0.572127 0.572127 0.572127 0.572127 0.572127
0.572127 0.572127 0.572127 0.572127 0.572127
6 changes: 6 additions & 0 deletions src/compute.jl
Original file line number Diff line number Diff line change
@@ -22,11 +22,13 @@ based on the provided index name, parameters, and optional keyword arguments.
# Examples
```jldoctest
julia> using SpectralIndices
julia> compute_index("NDVI"; N=0.643, R=0.175)
0.572127
```
```jldoctest
julia> using SpectralIndices
julia> compute_index("NDVI"; N=fill(0.643, (5, 5)), R=fill(0.175, (5, 5)))
0.572127 0.572127 0.572127 0.572127 0.572127
0.572127 0.572127 0.572127 0.572127 0.572127
@@ -36,6 +38,7 @@ julia> compute_index("NDVI"; N=fill(0.643, (5, 5)), R=fill(0.175, (5, 5)))
```
```jldoctest
julia> using SpectralIndices
julia> compute_index("NDVI"; N=fill(0.643, 5), R=fill(0.175, 5))
0.5721271393643031
0.5721271393643031
@@ -45,18 +48,21 @@ julia> compute_index("NDVI"; N=fill(0.643, 5), R=fill(0.175, 5))
```
```jldoctest
julia> using SpectralIndices
julia> compute_index(["NDVI", "SAVI"]; N=fill(0.643, 5), R=fill(0.175, 5), L=fill(0.5, 5))
[0.5721271393643031, 0.5721271393643031, 0.5721271393643031, 0.5721271393643031, 0.5721271393643031]
[0.5326251896813354, 0.5326251896813354, 0.5326251896813354, 0.5326251896813354, 0.5326251896813354]
```
```jldoctest
julia> using SpectralIndices
julia> compute_index(["NDVI", "SAVI"]; N=0.643, R=0.175, L=0.5)
0.5721271393643031
0.5326251896813354
```
```jldoctest
julia> using SpectralIndices
julia> compute_index(
["NDVI", "SAVI"]; N=fill(0.643, (5, 5)), R=fill(0.175, (5, 5)), L=fill(0.5, (5, 5))
)

0 comments on commit b4d6ec7

Please sign in to comment.