Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jd/psy3 #13

Merged
merged 5 commits into from
Sep 15, 2023
Merged
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
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PowerAnalytics"
uuid = "56ce1300-00bc-47e4-ba8c-b166ccc19f51"
authors = ["cbarrows <[email protected]>"]
version = "0.4.0"
version = "0.5.0"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand All @@ -18,8 +18,8 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
DataFrames = "1"
DataStructures = "0.18"
InfrastructureSystems = "1"
PowerSimulations = "^0.21"
PowerSystems = "2"
PowerSimulations = "^0.23"
PowerSystems = "3"
TimeSeries = "0.23"
YAML = "0.4"
julia = "1.6"
4 changes: 2 additions & 2 deletions src/fuel_results.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ function make_fuel_dictionary(
else
fuel = hasmethod(PSY.get_fuel, Tuple{typeof(gen)}) ? PSY.get_fuel(gen) : nothing
pm =
hasmethod(PSY.get_prime_mover, Tuple{typeof(gen)}) ?
PSY.get_prime_mover(gen) : nothing
hasmethod(PSY.get_prime_mover_type, Tuple{typeof(gen)}) ?
PSY.get_prime_mover_type(gen) : nothing
ext = get(PSY.get_ext(gen), "ext_category", nothing)
category = get_generator_category(typeof(gen), fuel, pm, ext, mapping)
end
Expand Down
6 changes: 3 additions & 3 deletions src/get_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ function get_generation_data(
results::R;
# aggregation::Union{
# Type{PSY.StaticInjection},
# Type{PSY.Bus},
# Type{PSY.ACBus},
# Type{PSY.System},
# Type{<:PSY.AggregationTopology},
# } = PSY.StaticInjection,
Expand Down Expand Up @@ -402,7 +402,7 @@ end

################################### INPUT DEMAND #################################

function _get_loads(system::PSY.System, bus::PSY.Bus)
function _get_loads(system::PSY.System, bus::PSY.ACBus)
return [
load for load in PSY.get_components(PSY.get_available, PSY.StaticLoad, system) if
PSY.get_bus(load) == bus
Expand All @@ -426,7 +426,7 @@ function get_load_data(
system::PSY.System;
aggregation::Union{
Type{PSY.StaticLoad},
Type{PSY.Bus},
Type{PSY.ACBus},
Type{PSY.System},
Type{<:PSY.AggregationTopology},
} = PSY.StandardLoad,
Expand Down
10 changes: 5 additions & 5 deletions test/test_data/results_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function add_re!(sys)
re = RenewableDispatch(
"WindBusA",
true,
get_component(Bus, sys, "bus5"),
get_component(ACBus, sys, "bus5"),
0.0,
0.0,
1.200,
Expand All @@ -18,7 +18,7 @@ function add_re!(sys)
fx = RenewableFix(
"RoofTopSolar",
true,
get_component(Bus, sys, "bus5"),
get_component(ACBus, sys, "bus5"),
0.0,
0.0,
1.100,
Expand All @@ -45,7 +45,7 @@ function add_re!(sys)
batt = GenericBattery(
"test_batt",
true,
get_component(Bus, sys, "bus4"),
get_component(ACBus, sys, "bus4"),
PrimeMovers.BA,
0.0,
(min = 0.0, max = 1.0),
Expand Down Expand Up @@ -100,7 +100,7 @@ function _execute_simulation(base_path, sim_name)
set_device_model!(template_hydro_st_uc, RenewableFix, FixedOutput)
set_device_model!(template_hydro_st_uc, RenewableDispatch, RenewableFullDispatch)
set_device_model!(template_hydro_st_uc, HydroDispatch, FixedOutput)
set_device_model!(template_hydro_st_uc, GenericBattery, BookKeeping)
set_device_model!(template_hydro_st_uc, GenericBattery, StorageDispatchWithReserves)
set_device_model!(
template_hydro_st_uc,
HydroEnergyReservoir,
Expand All @@ -120,7 +120,7 @@ function _execute_simulation(base_path, sim_name)
set_device_model!(template_hydro_st_ed, RenewableFix, FixedOutput)
set_device_model!(template_hydro_st_ed, RenewableDispatch, RenewableFullDispatch)
set_device_model!(template_hydro_st_ed, HydroDispatch, FixedOutput)
set_device_model!(template_hydro_st_ed, GenericBattery, BookKeeping)
set_device_model!(template_hydro_st_ed, GenericBattery, StorageDispatchWithReserves)
set_device_model!(
template_hydro_st_ed,
HydroEnergyReservoir,
Expand Down
2 changes: 1 addition & 1 deletion test/test_result_sorting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ end

@testset "Test system data getters" begin
sys = PSI.get_system(results_uc)
load_data1 = PA.get_load_data(sys; aggregation = Bus)
load_data1 = PA.get_load_data(sys; aggregation = ACBus)
@test length(load_data1.data) == 3
@test length(load_data1.time) == 24

Expand Down