mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
Merge branch 'dev' into feature/reserves
This commit is contained in:
@@ -23,15 +23,24 @@ Example
|
||||
import UnitCommitment
|
||||
instance = UnitCommitment.read_benchmark("matpower/case3375wp/2017-02-01")
|
||||
"""
|
||||
function read_benchmark(name::AbstractString)::UnitCommitmentInstance
|
||||
function read_benchmark(
|
||||
name::AbstractString;
|
||||
quiet::Bool = false,
|
||||
)::UnitCommitmentInstance
|
||||
basedir = dirname(@__FILE__)
|
||||
filename = "$basedir/../../instances/$name.json.gz"
|
||||
url = "$INSTANCES_URL/$name.json.gz"
|
||||
if !isfile(filename)
|
||||
@info "Downloading: $(url)"
|
||||
if !quiet
|
||||
@info "Downloading: $(url)"
|
||||
end
|
||||
dpath = download(url)
|
||||
mkpath(dirname(filename))
|
||||
cp(dpath, filename)
|
||||
json = _read_json(filename)
|
||||
if "SOURCE" in keys(json) && !quiet
|
||||
@info "If you use this instance in your research, please cite:\n\n$(json["SOURCE"])\n"
|
||||
end
|
||||
end
|
||||
return UnitCommitment.read(filename)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user