Skip to content

Commit cd80e82

Browse files
authored
Merge pull request #127 from NREL-Sienna/psy5
PSY5
2 parents 6789245 + 87d9243 commit cd80e82

File tree

6 files changed

+15
-225
lines changed

6 files changed

+15
-225
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
2323
CSV = "~0.9, 0.10"
2424
Colors = "~0.12"
2525
DataFrames = "1"
26-
DataStructures = "0.18"
27-
InfrastructureSystems = "2"
26+
DataStructures = "~0.18, ~0.19"
27+
InfrastructureSystems = "3"
2828
Plots = "1"
2929
PowerAnalytics = "1"
30-
PowerSystems = "4"
30+
PowerSystems = "5"
3131
Reexport = "1"
3232
Requires = "1"
33-
TimeSeries = "0.24"
33+
TimeSeries = "~0.25"
3434
YAML = "~0.4"
3535
julia = "^1.10"

src/call_plots.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ plot = plot_demand(res)
5959
- `bar::Bool` : create bar plot
6060
- `nofill::Bool` : force empty area fill
6161
- `stair::Bool`: Make a stair plot instead of a stack plot
62-
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems.get_available-Tuple{Component}): filter components included in plot
63-
"""
62+
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems InfrastructureSystems.get_available-Tuple{RenewableDispatch}): filter components included in plot
63+
""" # ^ temporary workaround for https://github.com/NREL-Sienna/PowerSystems.jl/issues/1598
6464

6565
function plot_demand(result::Union{IS.Results, PSY.System}; kwargs...)
6666
return plot_demand!(_empty_plot(), result; kwargs...)
@@ -97,7 +97,7 @@ Plots the demand in the system.
9797
- `bar::Bool` : create bar plot
9898
- `nofill::Bool` : force empty area fill
9999
- `stair::Bool`: Make a stair plot instead of a stack plot
100-
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems.get_available-Tuple{Component}): filter components included in plot
100+
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems InfrastructureSystems.get_available-Tuple{RenewableDispatch}): filter components included in plot
101101
- `palette` : color palette from [`load_palette`](@ref)
102102
"""
103103
function plot_demand!(p, result::Union{IS.Results, PSY.System}; kwargs...)
@@ -412,7 +412,7 @@ plot = plot_fuel(res)
412412
- `bar::Bool` : create bar plot
413413
- `nofill::Bool` : force empty area fill
414414
- `stair::Bool`: Make a stair plot instead of a stack plot
415-
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems.get_available-Tuple{Component}): filter components included in plot
415+
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems InfrastructureSystems.get_available-Tuple{RenewableDispatch}): filter components included in plot
416416
"""
417417
function plot_fuel(result::IS.Results; kwargs...)
418418
return plot_fuel!(_empty_plot(), result; kwargs...)
@@ -446,7 +446,7 @@ and assigns each fuel type a specific color.
446446
- `bar::Bool` : create bar plot
447447
- `nofill::Bool` : force empty area fill
448448
- `stair::Bool`: Make a stair plot instead of a stack plot
449-
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems.get_available-Tuple{Component}): filter components included in plot
449+
- `filter_func::Function = `[`PowerSystems.get_available`](@extref PowerSystems InfrastructureSystems.get_available-Tuple{RenewableDispatch}): filter components included in plot
450450
- `palette` : Color palette as from [`load_palette`](@ref).
451451
"""
452452
function plot_fuel!(p, result::IS.Results; kwargs...)

test/runtests.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@ const TEST_OUTPUTS = joinpath(BASE_DIR, "test", "test_results")
3030
!isdir(TEST_OUTPUTS) && mkdir(TEST_OUTPUTS)
3131
const TEST_RESULT_DIR = joinpath(TEST_OUTPUTS, "results")
3232
!isdir(TEST_RESULT_DIR) && mkdir(TEST_RESULT_DIR)
33+
const TEST_SIM_NAME = "results_sim"
3334

3435
import PowerSystemCaseBuilder
3536
const PSB = PowerSystemCaseBuilder
3637
template_dir = joinpath(BASE_DIR, "report_templates")
3738
const generic_template = joinpath(template_dir, "generic_report_template.jmd")
3839

40+
PA_DIR = string(dirname(dirname(pathof(PowerAnalytics))))
41+
include(joinpath(PA_DIR, "test", "test_data", "results_data.jl"))
42+
3943
LOG_LEVELS = Dict(
4044
"Debug" => Logging.Debug,
4145
"Info" => Logging.Info,
@@ -85,7 +89,6 @@ function get_logging_level(env_name::String, default)
8589
end
8690

8791
function run_tests()
88-
include(joinpath(BASE_DIR, "test", "test_data", "results_data.jl"))
8992
console_level = get_logging_level("PS_CONSOLE_LOG_LEVEL", "Error")
9093
console_logger = ConsoleLogger(stderr, console_level)
9194
file_level = get_logging_level("PS_LOG_LEVEL", "Info")

test/test_data/results_data.jl

Lines changed: 0 additions & 213 deletions
This file was deleted.

test/test_plot_creation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function test_plots(file_path::String; backend_pkg::String = "gr")
1212
cleanup = true
1313
@info("running tests with $backend_pkg with dispalay $set_display and cleanup $cleanup")
1414

15-
(results_uc, results_ed) = run_test_sim(TEST_RESULT_DIR)
15+
(results_uc, results_ed) = run_test_sim(TEST_RESULT_DIR, TEST_SIM_NAME)
1616
problem_results = run_test_prob()
1717
gen_uc = get_generation_data(results_uc)
1818
gen_ed = get_generation_data(results_ed)

test/test_reports.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function test_reports(file_path::String; backend_pkg::String = "gr")
1414
out_path = joinpath(file_path, backend_pkg * "_reports")
1515
!isdir(out_path) && mkpath(out_path)
1616
report_out_path = joinpath(out_path, "test_report.html")
17-
(results_uc, results_ed) = run_test_sim(TEST_RESULT_DIR)
17+
(results_uc, results_ed) = run_test_sim(TEST_RESULT_DIR, TEST_SIM_NAME)
1818

1919
PG.report(
2020
results_uc,

0 commit comments

Comments
 (0)