Skip to content

Commit

Permalink
updated linear_interpolation to comform to new api
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelio-amerio committed Sep 28, 2022
1 parent ff91358 commit be34f54
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FunctionTabulations"
uuid = "5f4392ac-266a-47fe-a3f9-ac8379aae758"
authors = ["Aurelio Amerio <[email protected]>"]
version = "0.2.0"
version = "0.2.1"

[deps]
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
Expand All @@ -13,11 +13,11 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
CodecZlib = "0.7"
Interpolations = "0.13, 0.14"
Interpolations = "^0.14.5"
JLD2 = "0.4"
ProgressMeter = "1"
Unitful = "1"
julia = "^1.6"
julia = "^1.7"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
7 changes: 4 additions & 3 deletions src/FunctionTabulations.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module FunctionTabulations
using Interpolations
using JLD2
using CodecZlib
using ProgressMeter
using Unitful
using Unitful: FreeUnits
Expand Down Expand Up @@ -179,7 +180,7 @@ end
kwargs...
) where {T<:Union{Real,Quantity}}
Provides an interface for `create_tabulation_1D` where the tabulation points are defined by the Vector `x`. Only `LinearInterpolation` is supported.`
Provides an interface for `create_tabulation_1D` where the tabulation points are defined by the Vector `x`. Only `linear_interpolation` is supported.`
"""
function create_tabulation_1D(
func::Function,
Expand Down Expand Up @@ -432,7 +433,7 @@ end
kwargs...
) where {T<:Union{Real,Quantity},V<:Union{Real,Quantity}}
Provides an interface for `create_tabulation_2D` where the tabulation points are defined by the Vectors `x` and `y`. Only `LinearInterpolation` is supported.`
Provides an interface for `create_tabulation_2D` where the tabulation points are defined by the Vectors `x` and `y`. Only `linear_interpolation` is supported.`
"""
function create_tabulation_2D(
func::Function,
Expand Down Expand Up @@ -729,7 +730,7 @@ end
kwargs...
) where {T<:Union{Real,Quantity},V<:Union{Real,Quantity},W<:Union{Real,Quantity}}
Provides an interface for `create_tabulation_3D` where the tabulation points are defined by the Vectors `x`, `y` and `z`. Only `LinearInterpolation` is supported.`
Provides an interface for `create_tabulation_3D` where the tabulation points are defined by the Vectors `x`, `y` and `z`. Only `linear_interpolation` is supported.`
"""
function create_tabulation_3D(
func::Function,
Expand Down
2 changes: 1 addition & 1 deletion src/helpers_1D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function _get_interp_fn_1D(x, data_matrix, x_scale, f_scale, x_units, f_units, i
f_matrix = scaler.(data_matrix, f_scale)

if interpolation_type == :linear
itp = LinearInterpolation(knots, f_matrix, extrapolation_bc=extrapolation_bc())
itp = linear_interpolation(knots, f_matrix, extrapolation_bc=extrapolation_bc())
elseif interpolation_type == :cubic
itp = CubicSplineInterpolation(knots, f_matrix, extrapolation_bc=extrapolation_bc())
else
Expand Down
2 changes: 1 addition & 1 deletion src/helpers_2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function _get_interp_fn_2D(x, y, data_matrix, x_scale, y_scale, f_scale, x_units
f_matrix = scaler.(data_matrix, f_scale)

if interpolation_type == :linear
itp = LinearInterpolation(knots, f_matrix, extrapolation_bc=extrapolation_bc())
itp = linear_interpolation(knots, f_matrix, extrapolation_bc=extrapolation_bc())
elseif interpolation_type == :cubic
itp = CubicSplineInterpolation(knots, f_matrix, extrapolation_bc=extrapolation_bc())
else
Expand Down
2 changes: 1 addition & 1 deletion src/helpers_3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function _get_interp_fn_3D(x, y, z, data_matrix, x_scale, y_scale, z_scale, f_sc
f_matrix = scaler.(data_matrix, f_scale)

if interpolation_type == :linear
itp = LinearInterpolation(knots, f_matrix, extrapolation_bc=extrapolation_bc())
itp = linear_interpolation(knots, f_matrix, extrapolation_bc=extrapolation_bc())
elseif interpolation_type == :cubic
itp = CubicSplineInterpolation(knots, f_matrix, extrapolation_bc=extrapolation_bc())
else
Expand Down

0 comments on commit be34f54

Please sign in to comment.