Import and Export Reference

Sparlectra.FetchMatpowerCaseModule

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.
source
Sparlectra.FetchMatpowerCase.emit_julia_caseMethod
emit_julia_case(mfile, outdir; legacy_compat=true, overwrite=false) -> jlfile::String

Parses a MATPOWER .m case and writes a Julia NamedTuple (.jl) compatible with MatpowerIO.readcasejulia().

source
Sparlectra.FetchMatpowerCase.ensure_casefileMethod
ensure_casefile(casefile; outdir=nothing, overwrite=false, to_jl=true) -> String

Ensure a MATPOWER-compatible case file exists locally.

  • If casefile is an existing path, it is returned unchanged.
  • If casefile is a bare filename (e.g. case14.m), it is downloaded into outdir.
  • If casefile ends with .jl and is missing, the corresponding .m is downloaded and .jl is generated.

Returns the local path to the requested case file.

source
Sparlectra.FetchMatpowerCase.ensure_matpower_caseMethod
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.

source