comparison src/SbpOperators/readoperator.jl @ 655:ec7490fb4404 operator_storage_array_of_table

Start sketching the toml format and needed functions
author Jonatan Werpers <jonatan@werpers.com>
date Sun, 24 Jan 2021 22:15:16 +0100
parents 4a81812150f4
children d34b515b0ae7
comparison
equal deleted inserted replaced
654:d26231227b89 655:ec7490fb4404
45 ) 45 )
46 46
47 return d2 47 return d2
48 end 48 end
49 49
50 """
51 read_stencil_set(fn, filter_pairs::Vararg{Pair})
52
53 Picks out a stencil set from the given toml file based on some filters.
54 If more than one set matches the filters an error is raised.
55
56 """
57 read_stencil_set(fn, filter_pairs::Vararg{Pair}) = get_stencil_set(TOML.parsefile(fn), filter_pairs...)
58
59 function get_stencil_set(parsed_toml, filter_pairs::Vararg{Pair})
60
61 end
50 62
51 """ 63 """
52 read_stencil(fn, path...; [center]) 64 read_stencil(fn, path...; [center])
53 65
54 Read a stencil at `path` from the file with name `fn`. 66 Read a stencil at `path` from the file with name `fn`.
131 @assert parsed_toml isa Vector{String} 143 @assert parsed_toml isa Vector{String}
132 t = Tuple(Float64.(parse_rational.(parsed_toml))) 144 t = Tuple(Float64.(parse_rational.(parsed_toml)))
133 return t 145 return t
134 end 146 end
135 147
148 function get_rationals()
149 end
150
136 # TODO: Probably should be deleted once we have gotten rid of read_D2_operator() 151 # TODO: Probably should be deleted once we have gotten rid of read_D2_operator()
137 function toml_string_array_to_tuple(::Type{T}, arr::AbstractVector{String}) where T 152 function toml_string_array_to_tuple(::Type{T}, arr::AbstractVector{String}) where T
138 return Tuple(T.(parse_rational.(arr))) 153 return Tuple(T.(parse_rational.(arr)))
139 end 154 end
140 155