-
Notifications
You must be signed in to change notification settings - Fork 20
Suppress logging #18
Suppress logging #18
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ | |
# ### Dependencies | ||
# Let's use the 5-bus dataset we parsed in the MATPOWER example | ||
using SIIPExamples | ||
using PowerSystems | ||
using Logging | ||
|
||
logger = configure_logging(console_level = Error, file_level = Info, filename = "ex.log") | ||
pkgpath = dirname(dirname(pathof(SIIPExamples))) | ||
include(joinpath(pkgpath, "test", "2_PowerSystems_examples", "parse_matpower.jl")) | ||
|
||
|
@@ -22,14 +26,9 @@ include(joinpath(pkgpath, "test", "2_PowerSystems_examples", "parse_matpower.jl" | |
FORECASTS_DIR = joinpath(base_dir, "forecasts", "5bus_ts") | ||
fname = joinpath(FORECASTS_DIR, "timeseries_pointers_da.json") | ||
open(fname, "r") do f | ||
for line in eachline(f) | ||
println(line) | ||
end | ||
@JSON3.@pretty JSON3.read(f) | ||
end | ||
|
||
# ### Read the pointers | ||
ts_pointers = PowerSystems.IS.read_time_series_file_metadata(fname) | ||
|
||
# ### Read and assign time series to `System` using the `ts_pointers` struct | ||
add_time_series!(sys, ts_pointers) | ||
# ### Read and assign time series to `System` using these parameters. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @claytonpbarrows IMHO it is better to keep this simpler. If you do want to expose the intermediate step to users, I'll revert the change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the same, there are too many intermediate steps here for this to be a tutorial |
||
add_time_series!(sys, fname) | ||
sys |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,17 +10,19 @@ | |
# ### Dependencies | ||
# Let's use a dataset from the [tabular data parsing example](../../notebook/2_PowerSystems_examples/parse_matpower.ipynb) | ||
using SIIPExamples | ||
using Logging | ||
logger = configure_logging(console_level = Error, file_level = Info, filename = "ex.log") | ||
pkgpath = dirname(dirname(pathof(SIIPExamples))) | ||
include(joinpath(pkgpath, "test", "2_PowerSystems_examples", "parse_matpower.jl")) | ||
|
||
# ### Write data to a temporary directory | ||
|
||
folder = mktempdir() | ||
path = joinpath(folder, "system.json") | ||
@info "Serializing to $path" | ||
println("Serializing to $path") | ||
to_json(sys, path) | ||
|
||
filesize(path) / 1000000 #MB | ||
filesize(path) / (1024 * 1024) #MiB | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tools like |
||
|
||
# ### Read the JSON file and create a new `System` | ||
sys2 = System(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add something like the following: