Skip to content
Merged

PSY5 #127

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
CSV = "~0.9, 0.10"
Colors = "~0.12"
DataFrames = "1"
DataStructures = "0.18"
InfrastructureSystems = "2"
DataStructures = "~0.18, ~0.19"
InfrastructureSystems = "3"
Plots = "1"
PowerAnalytics = "1"
PowerSystems = "4"
PowerSystems = "5"
Reexport = "1"
Requires = "1"
TimeSeries = "0.24"
TimeSeries = "~0.25"
YAML = "~0.4"
julia = "^1.10"
10 changes: 5 additions & 5 deletions src/call_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ plot = plot_demand(res)
- `bar::Bool` : create bar plot
- `nofill::Bool` : force empty area fill
- `stair::Bool`: Make a stair plot instead of a stack plot
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems.get_available-Tuple{Component}): filter components included in plot
"""
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems InfrastructureSystems.get_available-Tuple{RenewableDispatch}): filter components included in plot
""" # ^ temporary workaround for https://github.com/NREL-Sienna/PowerSystems.jl/issues/1598

function plot_demand(result::Union{IS.Results, PSY.System}; kwargs...)
return plot_demand!(_empty_plot(), result; kwargs...)
Expand Down Expand Up @@ -97,7 +97,7 @@ Plots the demand in the system.
- `bar::Bool` : create bar plot
- `nofill::Bool` : force empty area fill
- `stair::Bool`: Make a stair plot instead of a stack plot
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems.get_available-Tuple{Component}): filter components included in plot
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems InfrastructureSystems.get_available-Tuple{RenewableDispatch}): filter components included in plot
- `palette` : color palette from [`load_palette`](@ref)
"""
function plot_demand!(p, result::Union{IS.Results, PSY.System}; kwargs...)
Expand Down Expand Up @@ -412,7 +412,7 @@ plot = plot_fuel(res)
- `bar::Bool` : create bar plot
- `nofill::Bool` : force empty area fill
- `stair::Bool`: Make a stair plot instead of a stack plot
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems.get_available-Tuple{Component}): filter components included in plot
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems InfrastructureSystems.get_available-Tuple{RenewableDispatch}): filter components included in plot
"""
function plot_fuel(result::IS.Results; kwargs...)
return plot_fuel!(_empty_plot(), result; kwargs...)
Expand Down Expand Up @@ -446,7 +446,7 @@ and assigns each fuel type a specific color.
- `bar::Bool` : create bar plot
- `nofill::Bool` : force empty area fill
- `stair::Bool`: Make a stair plot instead of a stack plot
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems.get_available-Tuple{Component}): filter components included in plot
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems InfrastructureSystems.get_available-Tuple{RenewableDispatch}): filter components included in plot
- `palette` : Color palette as from [`load_palette`](@ref).
"""
function plot_fuel!(p, result::IS.Results; kwargs...)
Expand Down
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ const TEST_OUTPUTS = joinpath(BASE_DIR, "test", "test_results")
!isdir(TEST_OUTPUTS) && mkdir(TEST_OUTPUTS)
const TEST_RESULT_DIR = joinpath(TEST_OUTPUTS, "results")
!isdir(TEST_RESULT_DIR) && mkdir(TEST_RESULT_DIR)
const TEST_SIM_NAME = "results_sim"

import PowerSystemCaseBuilder
const PSB = PowerSystemCaseBuilder
template_dir = joinpath(BASE_DIR, "report_templates")
const generic_template = joinpath(template_dir, "generic_report_template.jmd")

PA_DIR = string(dirname(dirname(pathof(PowerAnalytics))))
include(joinpath(PA_DIR, "test", "test_data", "results_data.jl"))

LOG_LEVELS = Dict(
"Debug" => Logging.Debug,
"Info" => Logging.Info,
Expand Down Expand Up @@ -85,7 +89,6 @@ function get_logging_level(env_name::String, default)
end

function run_tests()
include(joinpath(BASE_DIR, "test", "test_data", "results_data.jl"))
console_level = get_logging_level("PS_CONSOLE_LOG_LEVEL", "Error")
console_logger = ConsoleLogger(stderr, console_level)
file_level = get_logging_level("PS_LOG_LEVEL", "Info")
Expand Down
213 changes: 0 additions & 213 deletions test/test_data/results_data.jl

This file was deleted.

2 changes: 1 addition & 1 deletion test/test_plot_creation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function test_plots(file_path::String; backend_pkg::String = "gr")
cleanup = true
@info("running tests with $backend_pkg with dispalay $set_display and cleanup $cleanup")

(results_uc, results_ed) = run_test_sim(TEST_RESULT_DIR)
(results_uc, results_ed) = run_test_sim(TEST_RESULT_DIR, TEST_SIM_NAME)
problem_results = run_test_prob()
gen_uc = get_generation_data(results_uc)
gen_ed = get_generation_data(results_ed)
Expand Down
2 changes: 1 addition & 1 deletion test/test_reports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function test_reports(file_path::String; backend_pkg::String = "gr")
out_path = joinpath(file_path, backend_pkg * "_reports")
!isdir(out_path) && mkpath(out_path)
report_out_path = joinpath(out_path, "test_report.html")
(results_uc, results_ed) = run_test_sim(TEST_RESULT_DIR)
(results_uc, results_ed) = run_test_sim(TEST_RESULT_DIR, TEST_SIM_NAME)

PG.report(
results_uc,
Expand Down
Loading