Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/readoperator.jl @ 828:ca182cbb8f49 operator_storage_array_of_table
Add a method to parse_stencil which allows controlling the element type
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 12 Jan 2022 08:39:48 +0100 |
parents | 219c9661e700 |
children | 21ab60cc0a5c |
comparison
equal
deleted
inserted
replaced
827:beae513ef8b3 | 828:ca182cbb8f49 |
---|---|
83 | 83 |
84 weights = parse_rational.(toml["s"]) | 84 weights = parse_rational.(toml["s"]) |
85 return Stencil(weights..., center = toml["c"]) | 85 return Stencil(weights..., center = toml["c"]) |
86 end | 86 end |
87 | 87 |
88 parse_stencil(T, toml) = Stencil{T}(parse_stencil(toml)) | |
89 | |
88 function check_stencil_toml(toml) | 90 function check_stencil_toml(toml) |
89 if !(toml isa Dict || toml isa Vector{String}) | 91 if !(toml isa Dict || toml isa Vector{String}) |
90 throw(ArgumentError("the TOML for a stencil must be a vector of strings or a table.")) | 92 throw(ArgumentError("the TOML for a stencil must be a vector of strings or a table.")) |
91 end | 93 end |
92 | 94 |