From 7dbe187a3fb4a2e59e716c8d2e24bce05c84ff1d Mon Sep 17 00:00:00 2001 From: Joseph McKinsey Date: Mon, 25 Nov 2024 13:51:29 -0700 Subject: [PATCH 1/2] Rename to SiennaPRASInterface --- .github/pull_request_template.md | 4 +- CONTRIBUTING.md | 2 +- Project.toml | 2 +- README.md | 18 ++++---- docs/Project.toml | 1 + docs/make.jl | 8 ++-- docs/src/api/internal.md | 2 +- docs/src/api/public.md | 2 +- docs/src/index.md | 12 +++--- ...RASInterface.jl => SiennaPRASInterface.jl} | 4 +- test/Project.toml | 2 +- test/rts_gmlc.jl | 2 +- test/runtests.jl | 2 +- test/test-generate-pras.jl | 42 ++++++++++--------- 14 files changed, 54 insertions(+), 49 deletions(-) rename src/{PRASInterface.jl => SiennaPRASInterface.jl} (98%) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7098aac..e050782 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,3 @@ -Thanks for opening a PR to PRASInterface.jl, please take note of the following when making a PR: +Thanks for opening a PR to SiennaPRASInterface.jl, please take note of the following when making a PR: -Check the [contributor guidelines](https://nrel-sienna.github.io/PRASInterface.jl/stable/code_base_developer_guide/developer/) +Check the [contributor guidelines](https://nrel-sienna.github.io/SiennaPRASInterface.jl/stable/code_base_developer_guide/developer/) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24779f4..c684fed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing Community driven development of this package is encouraged. To maintain code quality standards, please adhere to the following guidlines when contributing: - - To get started, sign the Contributor License Agreement. + - To get started, sign the Contributor License Agreement. - Please do your best to adhere to our [coding style guide](docs/src/developer/style.md). - To submit code contributions, [fork](https://help.github.com/articles/fork-a-repo/) the repository, commit your changes, and [submit a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). diff --git a/Project.toml b/Project.toml index 1d90f15..aab69f7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,4 +1,4 @@ -name = "PRASInterface" +name = "SiennaPRASInterface" uuid = "4b496c86-8d00-441d-b504-079c710e0aa7" authors = ["Surya Chandan Dhulipala, Joseph McKinsey, Jose Daniel Lara"] version = "0.1.0" diff --git a/README.md b/README.md index 9a3635b..de5cde4 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# PRASInterface.jl +# SiennaPRASInterface.jl -[![Main - CI](https://github.com/NREL-Sienna/PRASInterface.jl/actions/workflows/main-tests.yml/badge.svg)](https://github.com/NREL-Sienna/PRASInterface.jl/actions/workflows/main-tests.yml) -[![codecov](https://codecov.io/gh/NREL-Sienna/PRASInterface.jl/graph/badge.svg?token=AwsS9lNNSE)](https://codecov.io/gh/NREL-Sienna/PRASInterface.jl) -[![Documentation Build](https://github.com/NREL-Sienna/PRASInterface.jl/workflows/Documentation/badge.svg?)](https://nrel-sienna.github.io/PRASInterface.jl/dev) -[](https://join.slack.com/t/nrel-sienna/shared_invite/zt-glam9vdu-o8A9TwZTZqqNTKHa7q3BpQ) +[![Main - CI](https://github.com/NREL-Sienna/SiennaPRASInterface.jl/actions/workflows/main-tests.yml/badge.svg)](https://github.com/NREL-Sienna/SiennaPRASInterface.jl/actions/workflows/main-tests.yml) +[![codecov](https://codecov.io/gh/NREL-Sienna/SiennaPRASInterface.jl/graph/badge.svg?token=AwsS9lNNSE)](https://codecov.io/gh/NREL-Sienna/SiennaPRASInterface.jl) +[![Documentation Build](https://github.com/NREL-Sienna/SiennaPRASInterface.jl/workflows/Documentation/badge.svg?)](https://nrel-sienna.github.io/SiennaPRASInterface.jl/dev) +[](https://join.slack.com/t/nrel-sienna/shared_invite/zt-glam9vdu-o8A9TwZTZqqNTKHa7q3BpQ) ## About this package -PRASInterface.jl is a Julia package that provides an interface to (the unregistered package) [PRAS.jl](https://nrel.github.io/PRAS/) employing PowerSystem.jl's System data model. This package facilitates executing and analyzing the resource adequacy of a bulk power system using Monte Carlo methods with Julia. +SiennaPRASInterface.jl is a Julia package that provides an interface to (the unregistered package) [PRAS.jl](https://nrel.github.io/PRAS/) employing PowerSystem.jl's System data model. This package facilitates executing and analyzing the resource adequacy of a bulk power system using Monte Carlo methods with Julia. -For information on using the package check the [documentation]([https://nrel-sienna.github.io/PowerSystems.jl/dev/](https://nrel-sienna.github.io/PRASInterface.jl/dev)). +For information on using the package check the [documentation]([https://nrel-sienna.github.io/PowerSystems.jl/dev/](https://nrel-sienna.github.io/SiennaPRASInterface.jl/dev)). ## Development -Contributions to the development and enahancement of PRASInterface is welcome. Please see [CONTRIBUTING.md](https://github.com/NREL-Sienna/PRASInterface.jl/blob/master/CONTRIBUTING.md) for code contribution guidelines. +Contributions to the development and enahancement of SiennaPRASInterface is welcome. Please see [CONTRIBUTING.md](https://github.com/NREL-Sienna/SiennaPRASInterface.jl/blob/master/CONTRIBUTING.md) for code contribution guidelines. ## License -PRASInterface is released under a BSD [license](https://github.com/NREL/PRASInterface/blob/master/LICENSE). PRASInterface has been developed as part of the transmission planning tools project at the U.S. Department of Energy's National Renewable Energy Laboratory ([NREL](https://www.nrel.gov/)) +SiennaPRASInterface is released under a BSD [license](https://github.com/NREL/SiennaPRASInterface/blob/master/LICENSE). SiennaPRASInterface has been developed as part of the transmission planning tools project at the U.S. Department of Energy's National Renewable Energy Laboratory ([NREL](https://www.nrel.gov/)) diff --git a/docs/Project.toml b/docs/Project.toml index 486171c..9070b29 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,6 +1,7 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +SiennaPRASInterface = "4b496c86-8d00-441d-b504-079c710e0aa7" [compat] Documenter = "0.27" diff --git a/docs/make.jl b/docs/make.jl index ad33534..e57d1be 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,4 +1,4 @@ -using Documenter, PRASInterface +using Documenter, SiennaPRASInterface import OrderedCollections: OrderedDict pages = OrderedDict( @@ -9,15 +9,15 @@ pages = OrderedDict( ) makedocs( - modules=[PRASInterface, PRAS], + modules=[SiennaPRASInterface, PRAS], format=Documenter.HTML(prettyurls=haskey(ENV, "GITHUB_ACTIONS")), - sitename="PRASInterface.jl", + sitename="SiennaPRASInterface.jl", authors="Surya Dhulipala, Joseph McKinsey, José Daniel Lara", pages=Any[p for p in pages], ) deploydocs( - repo="github.com/NREL-Sienna/PRASInterface.jl.git", + repo="github.com/NREL-Sienna/SiennaPRASInterface.jl.git", target="build", branch="gh-pages", devbranch="main", diff --git a/docs/src/api/internal.md b/docs/src/api/internal.md index 87e2021..e5756cc 100644 --- a/docs/src/api/internal.md +++ b/docs/src/api/internal.md @@ -1,6 +1,6 @@ # Internal API ```@autodocs -Modules = [PRASInterface, PRAS] +Modules = [SiennaPRASInterface, PRAS] Public = false ``` diff --git a/docs/src/api/public.md b/docs/src/api/public.md index 597ba99..55a2c5f 100644 --- a/docs/src/api/public.md +++ b/docs/src/api/public.md @@ -1,7 +1,7 @@ # Public API Reference ```@docs -PRASInterface +SiennaPRASInterface generate_pras_system PRAS SystemModel diff --git a/docs/src/index.md b/docs/src/index.md index c718188..b1e246b 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,23 +1,23 @@ # PRASInterface.jl ```@meta -CurrentModule = PRASInterface +CurrentModule = SiennaPRASInterface ``` ## About -`PRASInterface.jl` is a [`Julia`](http://www.julialang.org) package that provides an interface to [`PRAS.jl`](https://nrel.github.io/PRAS) from [Sienna](https://www.nrel.gov/analysis/sienna.html)'s [`PowerSystem.jl`](https://github.com/NREL-Sienna/PowerSystems.jl)'s `System` data model. +`SiennaPRASInterface.jl` is a [`Julia`](http://www.julialang.org) package that provides an interface to [`PRAS.jl`](https://nrel.github.io/PRAS) from [Sienna](https://www.nrel.gov/analysis/sienna.html)'s [`PowerSystem.jl`](https://github.com/NREL-Sienna/PowerSystems.jl)'s `System` data model. The Probabilistic Resource Adequacy Suite (PRAS) analyzes the resource adequacy of a bulk power system using Monte Carlo methods. ## Getting Started -To use `PRASInterface.jl`, you first need a `System` from `PowerSystems.jl` +To use `SiennaPRASInterface.jl`, you first need a `System` from `PowerSystems.jl` ### 1. Install ``` -] add PRASInterface +] add SiennaPRASInterface ``` ### 2. Add Data @@ -37,7 +37,7 @@ add_supplemental_attribute!(sys, component, transition_data) ### 3. Calculate Shortfalls and Expected Unserved Energy on System ```julia -using PRASInterface +using SiennaPRASInterface method = SequentialMonteCarlo(samples=10_000, seed=1) shortfalls, = assess(sys, PowerSystems.Area, sequential_monte_carlo, Shortfall()) eue = EUE(shortfalls) @@ -54,5 +54,5 @@ Depth = 2 * * * -PRASInterface has been developed as part of the Transmission Planning Tools Maintenance project at the U.S. Department of Energy's National Renewable Energy +SiennaPRASInterface has been developed as part of the Transmission Planning Tools Maintenance project at the U.S. Department of Energy's National Renewable Energy Laboratory ([NREL](https://www.nrel.gov/)) funded by DOE Grid Deployment Office (GDO). diff --git a/src/PRASInterface.jl b/src/SiennaPRASInterface.jl similarity index 98% rename from src/PRASInterface.jl rename to src/SiennaPRASInterface.jl index 56235dd..246bec8 100644 --- a/src/PRASInterface.jl +++ b/src/SiennaPRASInterface.jl @@ -14,7 +14,7 @@ PowerSystems Interface for Probabilistic Resource Adequacy Studies (PRAS) - [`LOLE`](@ref): PRAS metric for loss of load expectation - [`EUE`](@ref): PRAS metric for energy unserved expectation """ -module PRASInterface +module SiennaPRASInterface ################################################################################# # Exports ################################################################################# @@ -75,7 +75,7 @@ const PSY = PowerSystems Module for Probabilistic Resource Adequacy Studies (PRAS). -Re-exported in PRASInterface +Re-exported in SiennaPRASInterface # Source diff --git a/test/Project.toml b/test/Project.toml index 6ceabbd..fa18be7 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -3,8 +3,8 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" -PRASInterface = "4b496c86-8d00-441d-b504-079c710e0aa7" PowerSystemCaseBuilder = "f00506e0-b84f-492a-93c2-c0a9afc4364e" +SiennaPRASInterface = "4b496c86-8d00-441d-b504-079c710e0aa7" PowerSystems = "bcd98974-b02a-5e2f-9ee0-a103f5c450dd" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e" diff --git a/test/rts_gmlc.jl b/test/rts_gmlc.jl index 72402e1..74dd390 100644 --- a/test/rts_gmlc.jl +++ b/test/rts_gmlc.jl @@ -13,7 +13,7 @@ function get_rts_gmlc_outage() gen_for_data = CSV.read(joinpath(@__DIR__, "descriptors/gen.csv"), DataFrames.DataFrame) for row in DataFrames.eachrow(gen_for_data) - λ, μ = PRASInterface.rate_to_probability(row.FOR, row["MTTR Hr"]) + λ, μ = SiennaPRASInterface.rate_to_probability(row.FOR, row["MTTR Hr"]) transition_data = PSY.GeometricDistributionForcedOutage(; mean_time_to_recovery=row["MTTR Hr"], outage_transition_probability=λ, diff --git a/test/runtests.jl b/test/runtests.jl index 915d137..7c45b02 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using PRASInterface +using SiennaPRASInterface using Test import Aqua diff --git a/test/test-generate-pras.jl b/test/test-generate-pras.jl index e437060..5f104d5 100644 --- a/test/test-generate-pras.jl +++ b/test/test-generate-pras.jl @@ -61,14 +61,14 @@ end PSY.get_name.( PSY.get_components(PSY.Branch, rts_da_sys) do c PSY.get_available(c) && - !(any(c isa T for T in PRASInterface.TransformerTypes)) # From definitions.jl + !(any(c isa T for T in SiennaPRASInterface.TransformerTypes)) # From definitions.jl PSY.get_area(PSY.get_from_bus(c)) != PSY.get_area(PSY.get_to_bus(c)) end ) # Make a PRAS System from PSY-4.X System rts_pras_sys = generate_pras_system(rts_da_sys, PSY.Area) - @test rts_pras_sys isa PRASInterface.PRAS.SystemModel + @test rts_pras_sys isa SiennaPRASInterface.PRAS.SystemModel @test test_names_equal(rts_pras_sys.regions.names, area_names) @test test_names_equal(rts_pras_sys.generators.names, generator_names) @@ -119,25 +119,29 @@ end @test all(rts_pras_sys.regions.load .== Int.(floor.(load_values))) # Test Assess Run - sequential_monte_carlo = PRASInterface.PRAS.SequentialMonteCarlo(samples=2, seed=1) - shortfalls, = PRASInterface.PRAS.assess( + sequential_monte_carlo = + SiennaPRASInterface.PRAS.SequentialMonteCarlo(samples=2, seed=1) + shortfalls, = SiennaPRASInterface.PRAS.assess( rts_pras_sys, sequential_monte_carlo, - PRASInterface.PRAS.Shortfall(), + SiennaPRASInterface.PRAS.Shortfall(), ) - lole = PRASInterface.PRAS.LOLE(shortfalls) - eue = PRASInterface.PRAS.EUE(shortfalls) - @test lole isa PRASInterface.PRAS.ReliabilityMetric - @test eue isa PRASInterface.PRAS.ReliabilityMetric - @test PRASInterface.PRAS.val(lole) >= 0 && PRASInterface.PRAS.val(lole) <= 10 - @test PRASInterface.PRAS.stderror(lole) >= 0 && PRASInterface.PRAS.stderror(lole) <= 10 - @test PRASInterface.PRAS.val(eue) >= 0 && PRASInterface.PRAS.val(eue) <= 10 - @test PRASInterface.PRAS.stderror(eue) >= 0 && PRASInterface.PRAS.stderror(eue) <= 10 + lole = SiennaPRASInterface.PRAS.LOLE(shortfalls) + eue = SiennaPRASInterface.PRAS.EUE(shortfalls) + @test lole isa SiennaPRASInterface.PRAS.ReliabilityMetric + @test eue isa SiennaPRASInterface.PRAS.ReliabilityMetric + @test SiennaPRASInterface.PRAS.val(lole) >= 0 && + SiennaPRASInterface.PRAS.val(lole) <= 10 + @test SiennaPRASInterface.PRAS.stderror(lole) >= 0 && + SiennaPRASInterface.PRAS.stderror(lole) <= 10 + @test SiennaPRASInterface.PRAS.val(eue) >= 0 && SiennaPRASInterface.PRAS.val(eue) <= 10 + @test SiennaPRASInterface.PRAS.stderror(eue) >= 0 && + SiennaPRASInterface.PRAS.stderror(eue) <= 10 @testset "Lumped Renewable Generators" begin rts_pras_sys = generate_pras_system(rts_da_sys, PSY.Area, lump_region_renewable_gens=true) - @test rts_pras_sys isa PRASInterface.PRAS.SystemModel + @test rts_pras_sys isa SiennaPRASInterface.PRAS.SystemModel @test test_names_equal(rts_pras_sys.regions.names, area_names) rts_pras_sys = generate_pras_system( @@ -146,7 +150,7 @@ end lump_region_renewable_gens=true, availability=false, ) - @test rts_pras_sys isa PRASInterface.PRAS.SystemModel + @test rts_pras_sys isa SiennaPRASInterface.PRAS.SystemModel @test test_names_equal(rts_pras_sys.regions.names, area_names) rts_pras_sys = generate_pras_system( @@ -156,10 +160,10 @@ end availability=false, export_location=joinpath(@__DIR__, "rts.pras"), ) - @test rts_pras_sys isa PRASInterface.PRAS.SystemModel + @test rts_pras_sys isa SiennaPRASInterface.PRAS.SystemModel @test test_names_equal(rts_pras_sys.regions.names, area_names) @test isfile(joinpath(@__DIR__, "rts.pras")) - rts_pras_sys2 = PRASInterface.PRAS.SystemModel(joinpath(@__DIR__, "rts.pras")) + rts_pras_sys2 = SiennaPRASInterface.PRAS.SystemModel(joinpath(@__DIR__, "rts.pras")) end end @@ -177,13 +181,13 @@ end storage_names = PSY.get_name.(PSY.get_components(PSY.Storage, rts_da_sys)) rts_pras_sys = generate_pras_system(rts_da_sys, PSY.Area) - @test rts_pras_sys isa PRASInterface.PRAS.SystemModel + @test rts_pras_sys isa SiennaPRASInterface.PRAS.SystemModel @test test_names_equal(rts_pras_sys.regions.names, area_names) @test test_names_equal(rts_pras_sys.generators.names, generator_names) @test test_names_equal(rts_pras_sys.storages.names, storage_names) # 201_HYDRO_4 should have 5.15 FOR, 11.6 POR, and 22 MTTR idx = findfirst(x -> x == "201_HYDRO_4", rts_pras_sys.generators.names) - λ, μ = PRASInterface.rate_to_probability(5.15, 22) + λ, μ = SiennaPRASInterface.rate_to_probability(5.15, 22) @test array_all_equal(rts_pras_sys.generators.λ[idx, :], λ) @test array_all_equal(rts_pras_sys.generators.μ[idx, :], μ) end From 7dd058223cee377803dcf81a777a6eb47f7118ea Mon Sep 17 00:00:00 2001 From: Joseph McKinsey Date: Mon, 25 Nov 2024 13:55:56 -0700 Subject: [PATCH 2/2] Rename files to PowerSystems --- src/{PRAS2PSY.jl => PRAS2PowerSystems.jl} | 0 src/{PSY2PRAS.jl => PowerSystems2PRAS.jl} | 0 src/SiennaPRASInterface.jl | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/{PRAS2PSY.jl => PRAS2PowerSystems.jl} (100%) rename src/{PSY2PRAS.jl => PowerSystems2PRAS.jl} (100%) diff --git a/src/PRAS2PSY.jl b/src/PRAS2PowerSystems.jl similarity index 100% rename from src/PRAS2PSY.jl rename to src/PRAS2PowerSystems.jl diff --git a/src/PSY2PRAS.jl b/src/PowerSystems2PRAS.jl similarity index 100% rename from src/PSY2PRAS.jl rename to src/PowerSystems2PRAS.jl diff --git a/src/SiennaPRASInterface.jl b/src/SiennaPRASInterface.jl index 246bec8..607607c 100644 --- a/src/SiennaPRASInterface.jl +++ b/src/SiennaPRASInterface.jl @@ -130,8 +130,8 @@ include("util/sienna/add_csv_time_series_data.jl") include("util/draws/draw_helper_functions.jl") include("util/draws/sienna_draws.jl") -include("PSY2PRAS.jl") -include("PRAS2PSY.jl") +include("PowerSystems2PRAS.jl") +include("PRAS2PowerSystems.jl") """ assess(