Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/readoperator.jl @ 809:219c9661e700 operator_storage_array_of_table
Always parse as rationals
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sat, 18 Sep 2021 23:40:25 +0200 |
parents | 3881386f25e6 |
children | ca182cbb8f49 |
comparison
equal
deleted
inserted
replaced
808:9479c03f413b | 809:219c9661e700 |
---|---|
75 """ | 75 """ |
76 function parse_stencil(toml) | 76 function parse_stencil(toml) |
77 check_stencil_toml(toml) | 77 check_stencil_toml(toml) |
78 | 78 |
79 if toml isa Array | 79 if toml isa Array |
80 weights = Float64.(parse_rational.(toml)) | 80 weights = parse_rational.(toml) |
81 return CenteredStencil(weights...) | 81 return CenteredStencil(weights...) |
82 end | 82 end |
83 | 83 |
84 weights = Float64.(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 function check_stencil_toml(toml) | 88 function check_stencil_toml(toml) |
89 if !(toml isa Dict || toml isa Vector{String}) | 89 if !(toml isa Dict || toml isa Vector{String}) |