-
Notifications
You must be signed in to change notification settings - Fork 81
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
Ac/documentation branch #1209
Ac/documentation branch #1209
Conversation
… for Tutorials in the folder dict.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1209 +/- ##
==========================================
+ Coverage 84.37% 84.45% +0.08%
==========================================
Files 181 181
Lines 8382 8278 -104
==========================================
- Hits 7072 6991 -81
+ Misses 1310 1287 -23
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss these changes, and figure out what to do with the get_buses sections. Thanks!
@@ -0,0 +1,303 @@ | |||
# Manipulating Static Data Sets using `get_component` and `set_*` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Manipulating Static Data Sets using `get_component` and `set_*` | |
# Manipulating Data Sets |
|
||
!!! note "Static vs Dynamic Data" | ||
|
||
Static and dynamic data can be manipulated using the `get_*` and `set_*` functions. However, it is important to note their differences. Static data encompasses all data necessary to run a steady state model. Dynamic data encompasses the data necessary to run a transient model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a focus here, so let's remove this note.
|
||
`PowerSystems` returns Julia iterators in order to avoid unnecessary memory allocations. The `get_*` and `set_*` functions are used as iterators to loop through data fields to access or set specific parameters. However, when using the `get_*` function you can use `collect` to return a vector. | ||
|
||
We are going to begin by loading in a test case from the `PowerSystemCaseBuilder`, see the reference for [PSCB](https://nrel-sienna.github.io/PowerSystems.jl/stable/how_to/powersystembuilder/#psb). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are going to begin by loading in a test case from the `PowerSystemCaseBuilder`, see the reference for [PSCB](https://nrel-sienna.github.io/PowerSystems.jl/stable/how_to/powersystembuilder/#psb). | |
We are going to begin by loading in a test case from the [`PowerSystemCaseBuilder.jl`](https://nrel-sienna.github.io/PowerSystems.jl/stable/how_to/powersystembuilder/#psb): |
sys = build_system(PSISystems, "c_sys5_pjm") | ||
``` | ||
|
||
Recall that we can see the components of our system simply by printing it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recall that we can see the components of our system simply by printing it. | |
Notice this system contains various [static](@ref S) components, including 5 [ThermalStandard](@ref) generators. |
|
||
Recall that we can see the components of our system simply by printing it. | ||
|
||
```@repl system |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this print statement, since the system was just printed above. Might not be the right fit for this tutorial after all, since we're not adding components
|
||
```@repl system | ||
get_units_base(sys) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a specific reflection statement here about what the data just showed above means in this unit base
show_components(ThermalStandard, sys, [:active_power, :reactive_power]) | ||
``` | ||
|
||
We can see that our values have changed, based on the unit base our system is in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More specific here -- explain an actual example
Now when we look at our `active_power` and `reactive_power` we can see that they have changed. | ||
|
||
```@repl system | ||
show_components(ThermalStandard, sys, [:active_power, :reactive_power]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Show Base power again, so you can see it hasn't changed?
|
||
Now lets focus on accessing all `ACBus` components and adjusting their base voltages. We can access all the buses in the system using two key function, `get_components`, which we have already seen, and `get_buses` which we will dive into now. | ||
|
||
### Iterator Approach |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this section. We should be using power systems functions to get iterators -- that's either get_buses or get_components in case
Now let's set all of our thermal generators to unavailable. | ||
|
||
```@repl system | ||
for i in thermal_iter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check with function dot notation also works here
Overhauled the
Manipulating Data Sets
Tutorial following the Diataxis guidelines.@kdayday