Skip to content

Commit

Permalink
Update 'fittable' function to remove InteractiveUtils from dependenci…
Browse files Browse the repository at this point in the history
…es (#35)
  • Loading branch information
eliascarv authored Oct 23, 2024
1 parent 0126a6c commit 148cd40
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
DataScienceTraits = "6cb2f572-2d2b-4ba6-bdb3-e710fa044d6c"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
GeoTables = "e502b557-6362-48c1-8219-d30d308dcdb0"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa"
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
Expand Down Expand Up @@ -37,7 +36,6 @@ CategoricalArrays = "0.10"
DataScienceTraits = "1.0"
Distances = "0.10"
GeoTables = "1.21"
InteractiveUtils = "1.9"
LinearAlgebra = "1.9"
Makie = "0.21"
Meshes = "0.51 - 0.52"
Expand Down
1 change: 0 additions & 1 deletion src/GeoStatsFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ using Optim
using Tables
using Distances
using Bessels: gamma, besselk
using InteractiveUtils: subtypes
using NearestNeighbors: MinkowskiMetric
using OhMyThreads: tmapreduce
using DataScienceTraits
Expand Down
15 changes: 12 additions & 3 deletions src/fitting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
# ------------------------------------------------------------------

# models that can be fitted currently
fittable() = filter(isstationary, setdiff(subtypes(Variogram), (NuggetEffect, NestedVariogram)))
# code to generate the model list:
# filter(isstationary, setdiff(subtypes(Variogram), (NuggetEffect, NestedVariogram))) |> Tuple
fittable() = (
CircularVariogram,
CubicVariogram,
ExponentialVariogram,
GaussianVariogram,
MaternVariogram,
PentasphericalVariogram,
SineHoleVariogram,
SphericalVariogram
)

"""
FitAlgo
Expand Down Expand Up @@ -81,8 +92,6 @@ using algorithm `algo` and return the one with minimum error.
julia> fit(Variogram, g)
julia> fit(Variogram, g, WeightedLeastSquares())
```
See also `GeoStatsFunctions.fittable()`.
"""
fit(::Type{Variogram}, g::EmpiricalVariogram, algo::FitAlgo=WeightedLeastSquares(); kwargs...) =
fit(fittable(), g, algo; kwargs...)
Expand Down

0 comments on commit 148cd40

Please sign in to comment.