Skip to content

Commit

Permalink
Add extra_paths kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
moyner committed Jul 2, 2024
1 parent 43fefa2 commit 788a111
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/InputParser/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,13 @@ highly recommended.
- `units=:si`: Units to use for return values. Requires `input_units` to be set.
- `input_units=nothing`: The units the file is given in.
- `verbose=false`: Toggle verbosity.
- `extra_paths`: List of extra paths to parse as a part of grid section, ex: `["PORO.inc", "PERM.inc"]`.
"""
function parse_grdecl_file(filename;
actnum_path = missing,
input_units = :metric,
extra_paths = String[],
kwarg...
)
outer_data = Dict{String, Any}()
Expand All @@ -288,6 +290,16 @@ function parse_grdecl_file(filename;
if !haskey(data, "ACTNUM")
data["ACTNUM"] = fill(true, data["cartDims"])
end
for local_path in extra_paths
if !ispath(k)
# Try looking in the same folder?
dir = first(splitdir(filename))
fname = local_path
local_path = joinpath(dir, fname)
isfile(local_path, "Tried parsing $fname, but was not the name of an existing file.")
end
parse_data_file!(outer_data, local_path, data; input_units = input_units, kwarg...)
end
delete!(data, "CURRENT_BOX")
return data
end
Expand Down

0 comments on commit 788a111

Please sign in to comment.