Skip to content

Commit 568c4d3

Browse files
authored
Merge pull request #233 from RoseauTechnologies/develop
Version 0.9.1
2 parents 696b4ce + eddd015 commit 568c4d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3980
-887
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ repos:
1515
hooks:
1616
- id: poetry-check
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.4.10
18+
rev: v0.5.0
1919
hooks:
2020
- id: ruff
2121
types_or: [python, pyi, jupyter]
2222
args: [--fix]
2323
- id: ruff-format
2424
types_or: [python, pyi, jupyter]
2525
- repo: https://github.com/adamchainz/blacken-docs
26-
rev: 1.16.0
26+
rev: 1.18.0
2727
hooks:
2828
- id: blacken-docs
2929
files: ^doc/.*\.md$

.vscode/cspell.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,78 @@
88
"abcn",
99
"absolufy",
1010
"acsr",
11+
"aldrey",
1112
"asarray",
1213
"astype",
14+
"bline",
15+
"bnline",
16+
"bnpline",
1317
"bysource",
18+
"cohl",
19+
"cosgini",
20+
"cterm",
21+
"curmg",
1422
"cython",
23+
"direc",
24+
"dline",
1525
"dropna",
1626
"dtype",
27+
"elmlodmv",
28+
"elmpvsys",
1729
"furo",
30+
"gscale",
1831
"htmlcov",
32+
"ilini",
33+
"imiso",
34+
"inom",
1935
"isort",
2036
"mathjax",
2137
"mathrm",
38+
"mlei",
2239
"nbsphinx",
2340
"ndarray",
41+
"nlnph",
42+
"nneutral",
2443
"noloadloss",
2544
"normhkva",
45+
"nphase",
2646
"nphases",
2747
"nplin",
2848
"opendss",
49+
"pcutr",
50+
"pgini",
2951
"phasor",
52+
"phtech",
3053
"pipx",
54+
"plini",
3155
"pmatrix",
3256
"pmax",
3357
"pyproj",
3458
"pyproject",
3559
"pytest",
3660
"pyupgrade",
61+
"qgini",
62+
"qlini",
63+
"qurs",
3764
"raphson",
65+
"rline",
66+
"rnline",
67+
"rnpline",
3868
"rtol",
69+
"sgini",
70+
"slini",
71+
"strn",
3972
"susceptance",
4073
"transfo",
74+
"uknom",
75+
"uktr",
4176
"ureg",
77+
"utrn",
78+
"xline",
4279
"xlpe",
80+
"xnet",
81+
"xnline",
82+
"xnpline",
4383
"yesqa"
4484
],
4585
// flagWords - list of words to be always considered incorrect

doc/Changelog.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,33 @@ og:description: See what's new in the latest release of Roseau Load Flow !
1717

1818
# Changelog
1919

20+
## Version 0.9.1
21+
22+
```{note}
23+
The wheels for Windows are temporarily unavailable anymore. If you need them, please post an issue on GitHub.
24+
```
25+
26+
- {gh-pr}`231` Add `LineParameters.from_power_factory` and `TransformerParameters.from_power_factory`
27+
methods to easily import PowerFactory lines and transformer models into Roseau Load Flow.
28+
- {gh-pr}`230` Improve the algorithm for assigning potential references for DGS networks.
29+
- {gh-pr}`229` Several fixes and improvements to the PowerFactory import:
30+
31+
- Update the "Export Definition Folder" bundled with _Roseau Load Flow_ as a pfd file;
32+
- Support lines with missing type ID. This is the case when the `TypLne` objects are inherited
33+
from an external library in PowerFactory and not included in the project being exported; A
34+
`LineParameters` object is automatically created for these lines;
35+
- Support "General Load (`ElmLod`)" elements;
36+
- Preserve Geometry information on buses and branches;
37+
- Improve handling of phases of several elements. Previously, phases were hard-coded.
38+
- Fix the unit of the power of static generators;
39+
- Fix the re-sizing of the matrices of line types without neutral elements;
40+
- Fix the total power of "MV Loads (`ElmLodmv`)" to take into account the generation power;
41+
- Fix all loads to no longer ignore the scale factor of the power;
42+
- Fix the sign of the reactive power of MV and LV loads
43+
- Fix the ground connection to the source bus
44+
45+
And many more...
46+
2047
## Version 0.9.0
2148

2249
- {gh-pr}`227` Sources and loads are now allowed to have floating neutrals. This means that a load/source

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
# The full version, including alpha/beta/rc tags
2525
version = "0.9"
26-
release = "0.9.0"
26+
release = "0.9.1"
2727

2828
# -- General configuration ---------------------------------------------------
2929

doc/models/Line/Parameters.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,10 @@ Please note that for underground lines, the provided height $h$ must be negative
541541
... line_type=rlf.LineType.UNDERGROUND,
542542
... conductor_type=rlf.ConductorType.AL,
543543
... insulator_type=rlf.InsulatorType.PVC,
544-
... section=150, #mm²
545-
... section_neutral=70, #mm²
546-
... height=-1.5, # m # Underground so negative!
547-
... external_diameter=0.049, #m
544+
... section=150, # mm²
545+
... section_neutral=70, # mm²
546+
... height=-1.5, # m # Underground so negative!
547+
... external_diameter=0.049, # m
548548
... )
549549

550550
>>> line_parameters.z_line

doc/usage/Catalogues.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ the values in different units. For instance, if you want to get transformer para
304304
nominal power of 3150 kVA, the following two commands return the same table:
305305

306306
```pycon
307-
>>> rlf.TransformerParameters.get_catalogue(sn=3150e3) # in VA by default
307+
>>> rlf.TransformerParameters.get_catalogue(sn=3150e3) # in VA by default
308308

309309
>>> import roseau.load_flow as rlf
310310
... rlf.TransformerParameters.get_catalogue(sn=rlf.Q_(3150, "kVA"))
@@ -484,7 +484,9 @@ the method `get_catalogue` to narrow down the result to a single line in the cat
484484
For instance, these parameters filter the results down to a single line parameters:
485485

486486
```pycon
487-
>>> rlf.LineParameters.from_catalogue(line_type="underground", conductor_type="al", section=240)
487+
>>> rlf.LineParameters.from_catalogue(
488+
... line_type="underground", conductor_type="al", section=240
489+
... )
488490
LineParameters(id='U_AL_240')
489491
```
490492

@@ -520,7 +522,7 @@ to create line parameters with different numbers of phases using the `nb_phases`
520522
In case no or several results match the parameters, an error is raised:
521523

522524
```pycon
523-
>>> rlf.LineParameters.from_catalogue(name= r"U_AL.*")
525+
>>> rlf.LineParameters.from_catalogue(name=r"U_AL.*")
524526
RoseauLoadFlowException: Several line parameters matching the query (name='U_AL.*') have been found:
525527
'U_AL_19', 'U_AL_20', 'U_AL_22', 'U_AL_25', 'U_AL_28', 'U_AL_29', 'U_AL_33', 'U_AL_34', 'U_AL_37',
526528
'U_AL_38', 'U_AL_40', 'U_AL_43', 'U_AL_48', 'U_AL_50', 'U_AL_54', 'U_AL_55', 'U_AL_59', 'U_AL_60',

doc/usage/Connecting_Elements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ the new load.
116116

117117
```pycon
118118
>>> new_bus = rlf.Bus(id="new_bus", phases="abcn")
119-
>>> new_load = rlf.PowerLoad(id="new_load", bus=new_bus, phases="an", powers=[6e3]) # W
119+
>>> new_load = rlf.PowerLoad(id="new_load", bus=new_bus, phases="an", powers=[6e3]) # W
120120
```
121121

122122
At this point, they don't belong to any network:

doc/usage/Data_Exchange.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,21 @@ for Geographical Informations Systems_ (DGS) JSON format.
2727

2828
The following components are currently supported:
2929

30-
| Name | Description | RLF Element |
31-
| ---------- | -------------------------- | --------------------------- |
32-
| ElmXnet | External Grid | VoltageSource |
33-
| ElmTerm | Terminal | Bus |
34-
| StaCubic | Cubicle | N/A _(included in the bus)_ |
35-
| ElmTr2 | 2-Winding Transformer | Transformer |
36-
| TypTr2 | 2-Winding Transformer Type | TransformerParameters |
37-
| ElmCoup | Switch | Switch |
38-
| ElmLne | Line/Cable | Line |
39-
| TypLne | Line/Cable Type | LineParameters |
40-
| ElmLodLV | Load, low voltage | PowerLoad (P>=0) |
41-
| ElmLodmv | Load, medium voltage | PowerLoad (P>=0) |
42-
| ElmGenStat | Static Generator | PowerLoad (P<=0) |
43-
| ElmPvsys | PV System | PowerLoad (P<=0) |
30+
| Name | Description | RLF Element |
31+
| ---------- | -------------------------- | ----------------------- |
32+
| ElmXnet | External Grid | VoltageSource |
33+
| ElmTerm | Terminal | Bus |
34+
| StaCubic | Cubicle | N/A |
35+
| ElmTr2 | 2-Winding Transformer | Transformer |
36+
| TypTr2 | 2-Winding Transformer Type | TransformerParameters |
37+
| ElmCoup | Switch | Switch |
38+
| ElmLne | Line/Cable | Line |
39+
| TypLne | Line/Cable Type | LineParameters |
40+
| ElmLodLV | Load, low voltage | PowerLoad (P>=0) |
41+
| ElmLodmv | Load, medium voltage | PowerLoad (P>=0 or P<0) |
42+
| ElmLod | General load | PowerLoad (P>=0) |
43+
| ElmGenStat | Static Generator | PowerLoad (P<=0) |
44+
| ElmPvsys | PV System | PowerLoad (P<=0) |
4445

4546
### Export from PowerFactory
4647

@@ -105,6 +106,19 @@ Please note that there are some limitations in the supported features:
105106
- **Ignored attributes**: functionality that is not yet available in `roseau-load-flow` is ignored.
106107
This includes the state of the switches (switches are considered to be always closed);
107108

109+
### Lines and Transformers
110+
111+
In addition to the DGS import support, `roseau-load-flow` supports creating lines and transformers
112+
parameters from PowerFactory data. This is useful when you don't want to import a whole network but
113+
would like to use some of the lines and transformers models you have in a power factory project.
114+
115+
To create line parameters from a PowerFactory Line Type (`TypLne`) object, use the
116+
{meth}`LineParameters.from_power_factory() roseau.load_flow.LineParameters.from_power_factory` method.
117+
118+
To create transformer parameters from a PowerFactory 2-Winding Transformer Type (`TypTr2`) object, use the
119+
{meth}`TransformerParameters.from_power_factory() roseau.load_flow.TransformerParameters.from_power_factory`
120+
method.
121+
108122
## OpenDSS
109123

110124
`roseau-load-flow` supports creating lines and transformers from OpenDSS data.

doc/usage/Extras.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ use the {meth}`~roseau.load_flow.models.Bus.res_voltage_unbalance` method on a 3
156156
the Voltage Unbalance Factor (VUF) as per the IEC definition:
157157

158158
```{math}
159-
VUF = \frac{|V_n|}{|V_p|} * 100 (\%)
159+
VUF = \frac{|V_{\mathrm{n}}|}{|V_{\mathrm{p}}|} \times 100 (\%)
160160
```
161161

162-
Where $V_n$ is the negative-sequence voltage and $V_p$ is the positive-sequence voltage.
162+
Where $V_{\mathrm{n}}$ is the negative-sequence voltage and $V_{\mathrm{p}}$ is the positive-sequence voltage.
163163

164164
```{note}
165165
Other definitions of voltage unbalance could be added in the future. If you need a specific

doc/usage/Flexible_Loads.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ As a consequence, the provided apparent power for phase `'a'` is the maximum tha
179179
... bus=load_bus3,
180180
... phases="abcn",
181181
... powers=[si, 0, 0], # W
182-
... flexible_params=[fp, rlf.FlexibleParameter.constant(), rlf.FlexibleParameter.constant()],
182+
... flexible_params=[
183+
... fp,
184+
... rlf.FlexibleParameter.constant(),
185+
... rlf.FlexibleParameter.constant(),
186+
... ],
183187
... )
184188
```
185189

@@ -239,14 +243,24 @@ production is totally shut down.
239243
>>> # Let's try with PQ(u) control, by injecting reactive power before reducing active power
240244
... en.loads["load3"].disconnect()
241245
... fp = rlf.FlexibleParameter.pq_u_production(
242-
... up_up=240, up_max=250, uq_min=200, uq_down=210, uq_up=235, uq_max=240, s_max=4000 # V and VA
246+
... up_up=240,
247+
... up_max=250,
248+
... uq_min=200,
249+
... uq_down=210,
250+
... uq_up=235,
251+
... uq_max=240,
252+
... s_max=4000, # V and VA
243253
... )
244254
... flexible_load = rlf.PowerLoad(
245255
... id="load3",
246256
... bus=load_bus3,
247257
... phases="abcn",
248258
... powers=[si, 0, 0],
249-
... flexible_params=[fp, rlf.FlexibleParameter.constant(), rlf.FlexibleParameter.constant()],
259+
... flexible_params=[
260+
... fp,
261+
... rlf.FlexibleParameter.constant(),
262+
... rlf.FlexibleParameter.constant(),
263+
... ],
250264
... )
251265
```
252266

0 commit comments

Comments
 (0)