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

Rename to SiennaPRASInterface #37

Merged
merged 2 commits into from
Nov 25, 2024
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
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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/)
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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, <a href="https://www.clahub.com/agreements/NREL/PRASInterface.jl">sign the Contributor License Agreement</a>.
- To get started, <a href="https://www.clahub.com/agreements/NREL/SiennaPRASInterface.jl">sign the Contributor License Agreement</a>.
- 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/).
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
[<img src="https://img.shields.io/badge/slack-@Sienna/PRASInterface-sienna.svg?logo=slack">](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)
[<img src="https://img.shields.io/badge/slack-@Sienna/SiennaPRASInterface-sienna.svg?logo=slack">](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/))
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 4 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Documenter, PRASInterface
using Documenter, SiennaPRASInterface
import OrderedCollections: OrderedDict

pages = OrderedDict(
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/internal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Internal API

```@autodocs
Modules = [PRASInterface, PRAS]
Modules = [SiennaPRASInterface, PRAS]
Public = false
```
2 changes: 1 addition & 1 deletion docs/src/api/public.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Public API Reference

```@docs
PRASInterface
SiennaPRASInterface
generate_pras_system
PRAS
SystemModel
Expand Down
12 changes: 6 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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).
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/PRASInterface.jl → src/SiennaPRASInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
#################################################################################
Expand Down Expand Up @@ -75,7 +75,7 @@ const PSY = PowerSystems

Module for Probabilistic Resource Adequacy Studies (PRAS).

Re-exported in PRASInterface
Re-exported in SiennaPRASInterface

# Source

Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/rts_gmlc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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=λ,
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using PRASInterface
using SiennaPRASInterface
using Test

import Aqua
Expand Down
42 changes: 23 additions & 19 deletions test/test-generate-pras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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

Expand All @@ -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
Expand Down
Loading