Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/readoperator.jl @ 861:b1f65b98778d operator_storage_array_of_table
Merge review
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 19 Jan 2022 07:28:08 +0100 |
parents | 568058183791 |
children | 06c510d40ebb 7bf3121c6864 |
comparison
equal
deleted
inserted
replaced
859:bdc718c38096 | 861:b1f65b98778d |
---|---|
9 | 9 |
10 export sbp_operators_path | 10 export sbp_operators_path |
11 | 11 |
12 | 12 |
13 """ | 13 """ |
14 read_stencil_set(fn; filters) | 14 read_stencil_set(filename; filters) |
15 | 15 |
16 Picks out a stencil set from the given toml file based on some key-value | 16 Picks out a stencil set from a TOML file based on some key-value |
17 filters. If more than one set matches the filters an error is raised. The | 17 filters. If more than one set matches the filters an error is raised. The |
18 returned stencil set contains parsed toml intended for functions like | 18 returned stencil set contains parsed TOML intended for functions like |
19 `parse_scalar` and `parse_stencil`. | 19 `parse_scalar` and `parse_stencil`. |
20 | 20 |
21 The stencil set is not parsed beyond the inital toml parse. To get usable | 21 The stencil set is not parsed beyond the inital TOML parse. To get usable |
22 stencils use the `parse_stencil` functions on the fields of the stencil set. | 22 stencils use the `parse_stencil` functions on the fields of the stencil set. |
23 | 23 |
24 The reason for this is that since stencil sets are intended to be very | 24 The reason for this is that since stencil sets are intended to be very |
25 general, and currently do not include any way to specify how to parse a given | 25 general, and currently do not include any way to specify how to parse a given |
26 section, the exact parsing is left to the user. | 26 section, the exact parsing is left to the user. |
27 | 27 |
28 For more information see [Operator file format](@ref) in the documentation. | 28 For more information see [Operator file format](@ref) in the documentation. |
29 | 29 |
30 See also [`sbp_operators_path`](@ref), [`get_stencil_set`](@ref), [`parse_stencil`](@ref), [`parse_scalar`](@ref), [`parse_tuple`](@ref),. | 30 See also [`sbp_operators_path`](@ref), [`get_stencil_set`](@ref), [`parse_stencil`](@ref), [`parse_scalar`](@ref), [`parse_tuple`](@ref),. |
31 """ | 31 """ |
32 read_stencil_set(fn; filters...) = get_stencil_set(TOML.parsefile(fn); filters...) | 32 read_stencil_set(filename; filters...) = get_stencil_set(TOML.parsefile(filename); filters...) |
33 | 33 |
34 """ | 34 """ |
35 get_stencil_set(parsed_toml; filters...) | 35 get_stencil_set(parsed_toml; filters...) |
36 | 36 |
37 Same as `read_stencil_set` but works on already parsed TOML. | 37 Picks out a stencil set from an already parsed TOML based on some key-value |
38 filters. | |
38 | 39 |
39 See also [`read_stencil_set`](@ref). | 40 See also [`read_stencil_set`](@ref). |
40 """ | 41 """ |
41 function get_stencil_set(parsed_toml; filters...) | 42 function get_stencil_set(parsed_toml; filters...) |
42 matches = findall(parsed_toml["stencil_set"]) do set | 43 matches = findall(parsed_toml["stencil_set"]) do set |
58 end | 59 end |
59 | 60 |
60 """ | 61 """ |
61 parse_stencil(parsed_toml) | 62 parse_stencil(parsed_toml) |
62 | 63 |
63 Accepts parsed toml and reads it as a stencil. | 64 Accepts parsed TOML and reads it as a stencil. |
64 | 65 |
65 See also [`read_stencil_set`](@ref), [`parse_scalar`](@ref), [`parse_tuple`](@ref). | 66 See also [`read_stencil_set`](@ref), [`parse_scalar`](@ref), [`parse_tuple`](@ref). |
66 """ | 67 """ |
67 function parse_stencil(parsed_toml) | 68 function parse_stencil(parsed_toml) |
68 check_stencil_toml(parsed_toml) | 69 check_stencil_toml(parsed_toml) |