Import and Export Reference
Sparlectra.FetchMatpowerCase — Module
Utilities for downloading MATPOWER-compatible case files on demand.
Note:
- Downloaded files are stored locally and are not part of the Sparlectra source distribution.
- Users are responsible for complying with the license terms of the respective upstream sources.
Sparlectra.FetchMatpowerCase.emit_julia_case — Method
emit_julia_case(mfile, outdir; legacy_compat=true, overwrite=false) -> jlfile::StringParses a MATPOWER .m case and writes a Julia NamedTuple (.jl) compatible with MatpowerIO.readcasejulia().
Sparlectra.FetchMatpowerCase.ensure_casefile — Method
ensure_casefile(casefile; outdir=nothing, overwrite=false, to_jl=true) -> StringEnsure a MATPOWER-compatible case file exists locally.
- If
casefileis an existing path, it is returned unchanged. - If
casefileis a bare filename (e.g.case14.m), it is downloaded intooutdir. - If
casefileends with.jland is missing, the corresponding.mis downloaded and.jlis generated.
Returns the local path to the requested case file.
Sparlectra.FetchMatpowerCase.ensure_matpower_case — Method
ensure_matpower_case(; url, outdir, to_jl=true, overwrite=false, legacy_compat=true, verbose=true)
-> (mfile::String, jlfile::Union{Nothing,String})Ensures the MATPOWER .m file exists in outdir by downloading it if missing. Optionally emits a Julia NamedTuple case (.jl).
This is intended to be called from examples and other code.
Sparlectra.FetchMatpowerCase.fetch_matpower_case — Method
fetch_matpower_case(url, outdir; overwrite=false) -> mfile::StringDownloads a MATPOWER *.m file from url into outdir (unless already present). Returns the local path to the downloaded file.
Sparlectra.FetchMatpowerCase.main — Function
main(args=ARGS) -> nothingCLI entry point. If no –url is provided, it prints help and returns without error.