Skip to content

Commit

Permalink
Merge pull request #1015 from pitmonticone/master
Browse files Browse the repository at this point in the history
Clean docs, docstrings, comments and code
  • Loading branch information
jd-lara authored Oct 18, 2023
2 parents 44b5021 + 9cf92cd commit fff7151
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/src/formulation_library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Formulation documentation should *roughly* follow the template established by Re
## Auto generated items

- Valid DeviceModel table: just change the device category in the filter function
- Time Series Parameters: just change the device category and formulation in the `get_defualt_time_series_names` method call
- Time Series Parameters: just change the device category and formulation in the `get_default_time_series_names` method call


## Linked items

- Formulations in the Valid DeviceModel table must have a docstring in src/core/formulations.jl
- The Formulation in the @docs block must have a docstring in src/core/formulations.jl
- The Variables must have docstrings in src/core/variables.jl
- The Time Series Paraemters must have docstrings in src/core/paramters.jl
- The Time Series Parameters must have docstrings in src/core/parameters.jl
2 changes: 1 addition & 1 deletion docs/src/modeler_guide/debugging_infeasible_models.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Debugging infeasible models

Getting infeasible solutions to models is a common ocurrence in operations simulations, there are multiple reasons why this can happen.
Getting infeasible solutions to models is a common occurrence in operations simulations, there are multiple reasons why this can happen.
`PowerSimulations.jl` has several tools to help debug this situation.

## Adding slacks to the model
Expand Down
2 changes: 1 addition & 1 deletion docs/src/quick_start_guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Quick Start Guide

* **Julia:** If this is your first time using Julia visit our [Introduction to Julia](https://nrel-Sienna.github.io/SIIP-Tutorial/fundamentals/introduction-to-julia/) and the official[Getting started with Julia](https://julialang.org/learning/).
* **Julia:** If this is your first time using Julia visit our [Introduction to Julia](https://nrel-Sienna.github.io/SIIP-Tutorial/fundamentals/introduction-to-julia/) and the official [Getting started with Julia](https://julialang.org/learning/).
* **Package Installation:** If you want to install packages check the [Package Manager](https://pkgdocs.julialang.org/v1/environments/) instructions, or you can refer to the [PowerSimulations installation instructions](@ref Installation).
* **PowerSystems:** [PowerSystems.jl](https://github.com/nrel-Sienna/PowerSystems.jl) manages the data and is a fundamental dependency of PowerSimulations.jl. Check the [PowerSystems.jl Basics Tutorial](https://nrel-sienna.github.io/PowerSystems.jl/stable/tutorials/basics/) and [PowerSystems.jl documentation](https://nrel-Sienna.github.io/PowerSystems.jl/stable/) to understand how the inputs to the models are organized.
* **Dataset Library:** If you don't have a data set to start using `PowerSimulations.jl` check the test systems provided in [`PowerSystemCaseBuilder.jl`](https://nrel-sienna.github.io/PowerSystems.jl/stable/tutorials/powersystembuilder/)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/adding_new_problem_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ It is possible to define a Custom Decision Problem that gives the user full cont
struct MyCustomDecisionProblem <: PSI.DecisionProblem end
```

Alternatevely, it is possible to define a Custom Decision Problem subtyping from `DefaultDecisionProblem` which imposes more requirements and structure onto the developer but employs more checks and validations in the process. Be aware that this route will decrease the flexibility of what can be done inside the custom model.
Alternatively, it is possible to define a Custom Decision Problem subtyping from `DefaultDecisionProblem` which imposes more requirements and structure onto the developer but employs more checks and validations in the process. Be aware that this route will decrease the flexibility of what can be done inside the custom model.

```julia
struct MyCustomDecisionProblem <: PSI.DefaultDecisionProblem end
Expand Down
2 changes: 1 addition & 1 deletion src/core/definitions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const MAX_START_STAGES = 3
const OBJECTIVE_FUNCTION_POSITIVE = 1.0
const OBJECTIVE_FUNCTION_NEGATIVE = -1.0
const INITIALIZATION_PROBLEM_HORIZON = 3
# The DEFAULT_RESERVE_COST value is used to avoid degeneracy of the solutions, reseve cost isn't provided.
# The DEFAULT_RESERVE_COST value is used to avoid degeneracy of the solutions, reserve cost isn't provided.
const DEFAULT_RESERVE_COST = 1.0
const KiB = 1024
const MiB = KiB * KiB
Expand Down
4 changes: 2 additions & 2 deletions src/core/formulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Formulation type to enable basic unit commitment representation without any inte
"""
struct ThermalBasicUnitCommitment <: AbstractStandardUnitCommitment end
"""
Formulaiton type to enable standard unit commitment with intertemporal constraints and simplified startup profiles
Formulation type to enable standard unit commitment with intertemporal constraints and simplified startup profiles
"""
struct ThermalStandardUnitCommitment <: AbstractStandardUnitCommitment end
"""
Expand Down Expand Up @@ -58,7 +58,7 @@ abstract type AbstractLoadFormulation <: AbstractDeviceFormulation end
abstract type AbstractControllablePowerLoadFormulation <: AbstractLoadFormulation end

"""
Formulation type to add a time series paraemter for non-dispatchable `ElectricLoad` withdrawls to power balance constraints
Formulation type to add a time series parameter for non-dispatchable `ElectricLoad` withdrawls to power balance constraints
"""
struct StaticPowerLoad <: AbstractLoadFormulation end

Expand Down
2 changes: 1 addition & 1 deletion src/network_models/powermodels_interface.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#################################################################################
# Comments
#
# - Ideally the net_injection variables would be bounded. This can be done using an adhoc data model extention
# - Ideally the net_injection variables would be bounded. This can be done using an adhoc data model extension
# - the `instantiate_*_expr_model` functions combine `PM.instantiate_model` and the `build_*` methods
#################################################################################
# Model Definitions
Expand Down
2 changes: 1 addition & 1 deletion src/operation/decision_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ end
"""
AGCReserveDeployment(system::PSY.System; kwargs...)
Creates a `ProblemTemplate` with default DeviceModels for an AGC Reserve Deplyoment Problem.
Creates a `ProblemTemplate` with default DeviceModels for an AGC Reserve Deployment Problem.
Uses the template to create an `DecisionProblem`.
# Example
Expand Down
2 changes: 1 addition & 1 deletion src/operation/operation_problem_templates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ end
"""
template_agc_reserve_deployment(; kwargs...)
Creates a `ProblemTemplate` with default DeviceModels for an AGC Reserve Deplyment Problem. This model doesn't support customization
Creates a `ProblemTemplate` with default DeviceModels for an AGC Reserve Deployment Problem. This model doesn't support customization
# Example
Expand Down
4 changes: 2 additions & 2 deletions src/services_models/agc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function add_constraints!(
IS.@assert_op frequency_response >= 0.0

# This value is the one updated later in simulation based on the UC result
inv_frequency_reponse = 1 / frequency_response
inv_frequency_response = 1 / frequency_response

area_balance = get_variable(container, ActivePowerVariable(), PSY.Area)
frequency = get_variable(container, SteadyStateFrequencyDeviation(), U)
Expand All @@ -163,7 +163,7 @@ function add_constraints!(
end
const_container[t] = JuMP.@constraint(
container.JuMPmodel,
frequency[t] == -inv_frequency_reponse * system_balance
frequency[t] == -inv_frequency_response * system_balance
)
end
return
Expand Down
2 changes: 1 addition & 1 deletion src/services_models/reserve_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end

################################## Reserve Requirement Constraint ##########################
"""
This function creates the requirement constraint that will be attained by the apropriate services
This function creates the requirement constraint that will be attained by the appropriate services
"""
function add_constraints!(
container::OptimizationContainer,
Expand Down

0 comments on commit fff7151

Please sign in to comment.