Skip to content

Commit 696b4ce

Browse files
authored
Merge pull request #228 from RoseauTechnologies/develop
Version 0.9.0
2 parents b1c37f6 + e5d1abd commit 696b4ce

Some content is hidden

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

75 files changed

+2977
-1865
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.pdf filter=lfs diff=lfs merge=lfs -text
22
*.png filter=lfs diff=lfs merge=lfs -text
33
*.ico filter=lfs diff=lfs merge=lfs -text
4+
*.pfd filter=lfs diff=lfs merge=lfs -text
45
.vscode/*.json linguist-language=jsonc

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ A clear and concise description of what the bug is.
1313
Minimal Working Example to understand the problem
1414

1515
```python
16-
from roseau.load_flow import *
16+
import roseau.load_flow as rlf
1717

1818
# Your code here
19-
# Please do not add username, password or API keys here
19+
# PLEASE DO NOT ADD LICENSE KEYS HERE
2020
```
2121

2222
**Expected behavior**
@@ -27,9 +27,9 @@ A clear and concise description of what you expected to happen.
2727
Please copy/paste here the output of the function `show_versions`
2828

2929
```python
30-
from roseau.load_flow import show_versions
30+
import roseau.load_flow as rlf
3131

32-
show_versions()
32+
rlf.show_versions()
3333
```
3434

3535
```

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
hooks:
1616
- id: poetry-check
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.3.5
18+
rev: v0.4.10
1919
hooks:
2020
- id: ruff
2121
types_or: [python, pyi, jupyter]
@@ -28,14 +28,14 @@ repos:
2828
- id: blacken-docs
2929
files: ^doc/.*\.md$
3030
args: [-l 90]
31-
- repo: https://github.com/pre-commit/mirrors-prettier
32-
rev: v4.0.0-alpha.8
31+
- repo: https://github.com/rbubley/mirrors-prettier
32+
rev: v3.3.2
3333
hooks:
3434
- id: prettier
3535
args: ["--print-width", "120"]
3636
require_serial: true
3737
- repo: https://github.com/cmhughes/latexindent.pl
38-
rev: V3.23.9
38+
rev: V3.24.2
3939
hooks:
4040
- id: latexindent
4141
args: [-l, -m, -s, -wd]

.vscode/cspell.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
"mathrm",
2222
"nbsphinx",
2323
"ndarray",
24+
"noloadloss",
25+
"normhkva",
26+
"nphases",
2427
"nplin",
28+
"opendss",
2529
"phasor",
2630
"pipx",
2731
"pmatrix",

doc/Changelog.md

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

1818
# Changelog
1919

20+
## Version 0.9.0
21+
22+
- {gh-pr}`227` Sources and loads are now allowed to have floating neutrals. This means that a load/source
23+
with `phases="abcn"` can now be connected to a bus with `phases="abc"`.
24+
- {gh-pr}`225` The `calculate_voltages` function now accepts and return pint quantities.
25+
- MacOS wheels for roseau-load-flow-engine are now published on PyPI. This means that `pip install roseau-load-flow`
26+
should now work on macOS.
27+
- Added support for running in Google Colab documents.
28+
- Fixed a bug in license checks caching on Windows.
29+
- Added support for Numpy 2.0.
30+
- {gh-issue}`222` {gh-pr}`223` `from_catalogue()` methods of the electrical network and transformer
31+
and line parameters now perform "full match" comparison on textual inputs. If you need the old
32+
behavior, use regular expression wild cards `.*` in the input string.
33+
- {gh-issue}`220` {gh-pr}`221` Add `LineParameters.from_open_dss` and `TransformerParameters.from_open_dss` methods to
34+
easily import OpenDSS lines and transformer models into Roseau Load Flow. More information is
35+
available in the documentation of these methods.
36+
- {gh-issue}`210` {gh-pr}`219` Add a parameter to `LineParameters.from_catalogue` to choose the number
37+
of phases of the created line parameters object.
38+
- {gh-pr}`218` Add `Transformer.res_power_losses` to get the total power losses in a transformer.
39+
- {gh-pr}`217` Add an ID override to `TransformerParameters.from_catalogue` similar to
40+
`LineParameters.from_catalogue`.
41+
- {gh-issue}`216` {gh-pr}`217` **BREAKING CHANGE**: Rename the `id` parameter of `TransformerParameters`
42+
catalogue methods to `name` to be consistent with `LineParameters`.
43+
**If you call these methods by keyword arguments**, make sure to update your usage of
44+
`TransformerParameters.from_catalogue(id="xxx")` to `TransformerParameters.from_catalogue(name="xxx")`.
45+
- {gh-pr}`212` **BREAKING CHANGE**: Modify the constructor of `TransformerParameters` to take the `z2`
46+
and `ym` parameters directly instead of the open and short circuit tests parameters. You can still
47+
create an object from these tests using the `from_open_and_short_circuit_tests` constructor. This
48+
change comes with other changes to `TransformerParameters`, notably:
49+
- The `z2`, `ym`, `k`, and `orientation` are now always available as attributes on the instance
50+
- The `to_zyk` method is deprecated in favour of the direct attribute access on the instance. This
51+
method will be removed in a future version
52+
- The parameters `i0`, `p0`, `psc`, and `vsc` are now optional. They return None for instances
53+
created using `z2` and `ym` directly
54+
- The JSON representation of `TransformerParameters` has changed, but it is still compatible with
55+
the old representation.
56+
2057
## Version 0.8.1
2158

2259
- {gh-issue}`214` Solve a bug in the engine when using delta connected flexible loads.

doc/License.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ There are two ways to activate the license in your project:
6161

6262
```python
6363
from pathlib import Path
64-
import roseau.load_flow as lf
64+
import roseau.load_flow as rlf
6565

66-
lf.activate_license(Path("my_license_key.txt").read_text().strip())
66+
rlf.activate_license(Path("my_license_key.txt").read_text().strip())
6767

6868
# Rest of your code here
6969
```
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
# author = "Benoît Vinot"
2323

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

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

doc/models/Bus.md

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ A bus is identified by its unique id and must define the phases it is connected
3232
have all the phases of the elements connected to it.
3333

3434
```python
35-
from roseau.load_flow import Bus, PowerLoad
35+
import roseau.load_flow as rlf
3636

37-
bus1 = Bus(id="bus1", phases="abcn") # A three-phase bus with a neutral
38-
bus2 = Bus(id="bus2", phases="abc") # A three-phase bus without a neutral
39-
bus3 = Bus(id="bus3", phases="an") # A single-phase bus
37+
bus1 = rlf.Bus(id="bus1", phases="abcn") # A three-phase bus with a neutral
38+
bus2 = rlf.Bus(id="bus2", phases="abc") # A three-phase bus without a neutral
39+
bus3 = rlf.Bus(id="bus3", phases="an") # A single-phase bus
4040

41-
PowerLoad(id="load1", bus=bus1, powers=[100, 0, 50j], phases="abcn") # OK
42-
PowerLoad(id="load2", bus=bus1, powers=[100, 0, 50j], phases="abc") # OK
43-
PowerLoad(id="load3", bus=bus2, powers=[100], phases="ab") # OK
44-
PowerLoad(
41+
rlf.PowerLoad(id="load1", bus=bus1, powers=[100, 0, 50j], phases="abcn") # OK
42+
rlf.PowerLoad(id="load2", bus=bus1, powers=[100, 0, 50j], phases="abc") # OK
43+
rlf.PowerLoad(id="load3", bus=bus2, powers=[100], phases="ab") # OK
44+
rlf.PowerLoad(
4545
id="load4", bus=bus3, powers=[100], phases="ab"
4646
) # Error: bus3 does not have phase "b"
4747
```
@@ -50,10 +50,10 @@ Since a bus represents a point in the network, it is possible to define the coor
5050
point:
5151

5252
```python
53+
import roseau.load_flow as rlf
5354
from shapely import Point
54-
from roseau.load_flow import Bus
5555

56-
bus = Bus(id="bus", phases="abc", geometry=Point(1.0, -2.5))
56+
bus = rlf.Bus(id="bus", phases="abc", geometry=Point(1.0, -2.5))
5757
```
5858

5959
This information is not used by the load flow solver but could be used to generate geographical
@@ -69,37 +69,29 @@ Here is an example of a simple short-circuit between two phases:
6969
```python
7070
import functools as ft
7171
import numpy as np
72-
from roseau.load_flow import (
73-
Bus,
74-
ElectricalNetwork,
75-
Line,
76-
LineParameters,
77-
PotentialRef,
78-
Q_,
79-
VoltageSource,
80-
)
72+
import roseau.load_flow as rlf
8173

8274
# Two buses
83-
bus1 = Bus(id="bus1", phases="abcn")
84-
bus2 = Bus(id="bus2", phases="abcn")
75+
bus1 = rlf.Bus(id="bus1", phases="abcn")
76+
bus2 = rlf.Bus(id="bus2", phases="abcn")
8577

8678
# A line
87-
lp = LineParameters(id="lp", z_line=Q_((0.3 + 0.35j) * np.eye(4), "ohm/km"))
88-
line = Line(id="line", bus1=bus1, bus2=bus2, parameters=lp, length=Q_(1, "km"))
79+
lp = rlf.LineParameters(id="lp", z_line=rlf.Q_((0.3 + 0.35j) * np.eye(4), "ohm/km"))
80+
line = rlf.Line(id="line", bus1=bus1, bus2=bus2, parameters=lp, length=rlf.Q_(1, "km"))
8981

9082
# A voltage source on the first bus
9183
un = 400 / np.sqrt(3)
92-
voltages = Q_(un * np.exp([0, -2j * np.pi / 3, 2j * np.pi / 3]), "V")
93-
vs = VoltageSource(id="source", bus=bus1, voltages=voltages)
84+
voltages = rlf.Q_(un * np.exp([0, -2j * np.pi / 3, 2j * np.pi / 3]), "V")
85+
vs = rlf.VoltageSource(id="source", bus=bus1, voltages=voltages)
9486

9587
# The neutral of the voltage source is fixed at potential 0
96-
pref = PotentialRef(id="pref", element=bus1, phase="n")
88+
pref = rlf.PotentialRef(id="pref", element=bus1, phase="n")
9789

9890
# Create a short-circuit on bus2 between phases "a" and "b"
9991
bus2.add_short_circuit("a", "b")
10092

10193
# Create a network and solve a load flow
102-
en = ElectricalNetwork.from_element(bus1)
94+
en = rlf.ElectricalNetwork.from_element(bus1)
10395
en.solve_load_flow()
10496

10597
# Get the currents flowing to the line from bus1

0 commit comments

Comments
 (0)