Skip to content

Commit

Permalink
Change _pglib to use input path, not constant global
Browse files Browse the repository at this point in the history
  • Loading branch information
noahrhodes committed May 27, 2024
1 parent 2b16d7e commit e71cb53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PGLib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ function _pglib(fname::AbstractString, path::AbstractString)
case = PowerModels.parse_file(joinpath(path, "pglib_opf_$fname.m"))
else
# if single case contains name
files = readdir(joinpath(PGLib_opf))
files = readdir(joinpath(path))
filtered_files = filter(x-> occursin(fname,x) , files)
if length(filtered_files)==1
file=filtered_files[1]
@info "opening case `$file`"
case = PowerModels.parse_file(joinpath(PGLib_opf, file))
case = PowerModels.parse_file(joinpath(path, file))
else
@warn "Case `$(fname)` was not found. Try running `find_pglib_case(\"$fname\")` to find similar case names."
return Dict{String,Any}()
Expand Down

0 comments on commit e71cb53

Please sign in to comment.