Skip to content

Commit

Permalink
Merge pull request #100 from NREL-Sienna/jdrh/fix_testing
Browse files Browse the repository at this point in the history
Fix Testing
  • Loading branch information
jd-lara committed Jul 2, 2024
2 parents ce9885d + efe514e commit 16d4202
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
env:
PYTHON: ""
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: ./lcov.info
flags: unittests
Expand Down
4 changes: 2 additions & 2 deletions src/library/psi_library.jl
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ function build_5_bus_hydro_wk_sys(; raw_data, kwargs...)
time_series_in_memory = true,
sys_kwargs...,
)
PSY.transform_single_time_series!(c_sys5_hy_wk, Hour(2), Hour(48))
PSY.transform_single_time_series!(c_sys5_hy_wk, Hour(48), Hour(48))

return c_sys5_hy_wk
end
Expand Down Expand Up @@ -390,7 +390,7 @@ function build_5_bus_hydro_wk_sys_targets(; raw_data, kwargs...)
for hy in get_components(HydroEnergyReservoir, c_sys5_hy_wk)
set_operation_cost!(hy, cost)
end
PSY.transform_single_time_series!(c_sys5_hy_wk, Hour(2), Hour(48))
PSY.transform_single_time_series!(c_sys5_hy_wk, Hour(48), Hour(48))

return c_sys5_hy_wk
end
Expand Down
22 changes: 20 additions & 2 deletions test/test_psisystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,39 @@
system_catalog = SystemCatalog(SYSTEM_CATALOG)
for (name, descriptor) in system_catalog.data[PSISystems]
supported_args_permutations = PSB.get_supported_args_permutations(descriptor)
if isempty(supported_args_permutations)
sys = build_system(
PSISystems,
name;
force_build = true,
)
@test isa(sys, System)

# build a new system from json
@test PSB.is_serialized(name)
sys2 = build_system(
PSISystems,
name,
)
@test isa(sys2, System)

PSB.clear_serialized_system(name)
@test !PSB.is_serialized(name)
end
for supported_args in supported_args_permutations
sys = build_system(
PSISystems,
name;
force_build = true,
supported_args...,
)

@test isa(sys, System)

# build a new system from json
@test PSB.is_serialized(name, supported_args)
sys2 = build_system(
PSISystems,
name;
force_build = true,
supported_args...,
)
@test isa(sys2, System)
Expand Down
20 changes: 19 additions & 1 deletion test/test_psitestsystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
for (name, descriptor) in system_catalog.data[PSITestSystems]
# build a new system from scratch
supported_args_permutations = PSB.get_supported_args_permutations(descriptor)
if isempty(supported_args_permutations)
sys = build_system(
PSITestSystems,
name;
force_build = true,
)
@test isa(sys, System)

# build a new system from json
@test PSB.is_serialized(name)
sys2 = build_system(
PSITestSystems,
name,
)
@test isa(sys2, System)

PSB.clear_serialized_system(name)
@test !PSB.is_serialized(name)
end
for supported_args in supported_args_permutations
sys = build_system(
PSITestSystems,
Expand All @@ -17,7 +36,6 @@
sys2 = build_system(
PSITestSystems,
name;
force_build = true,
supported_args...,
)
@test isa(sys2, System)
Expand Down
22 changes: 20 additions & 2 deletions test/test_psytestsystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,39 @@
for (name, descriptor) in system_catalog.data[PSYTestSystems]
# build a new system from scratch
supported_args_permutations = PSB.get_supported_args_permutations(descriptor)
if isempty(supported_args_permutations)
sys = build_system(
PSYTestSystems,
name;
force_build = true,
)
@test isa(sys, System)

# build a new system from json
@test PSB.is_serialized(name)
sys2 = build_system(
PSYTestSystems,
name,
)
@test isa(sys2, System)

PSB.clear_serialized_system(name)
@test !PSB.is_serialized(name)
end
for supported_args in supported_args_permutations
sys = build_system(
PSYTestSystems,
name;
force_build = true,
supported_args...,
)

@test isa(sys, System)

# build a new system from json
@test PSB.is_serialized(name, supported_args)
sys2 = build_system(
PSYTestSystems,
name;
force_build = true,
supported_args...,
)
@test isa(sys2, System)
Expand Down

0 comments on commit 16d4202

Please sign in to comment.