Skip to content

Commit

Permalink
Merge pull request #150 from RoseauTechnologies/develop
Browse files Browse the repository at this point in the history
Version 0.6.0
  • Loading branch information
benoit9126 authored Nov 29, 2023
2 parents 7497076 + 25aaeb6 commit 6eb6507
Show file tree
Hide file tree
Showing 160 changed files with 23,009 additions and 30,750 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: false

Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: false

Expand All @@ -47,17 +47,19 @@ jobs:
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
use-mamba: true

- name: Conda Build
id: conda-build
shell: bash -l {0}
run: |
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install --channel conda-forge conda-build conda-verify
mamba config --add channels conda-forge
mamba config --set channel_priority strict
mamba install --channel conda-forge conda-build conda-verify
mkdir -p dist/
conda build --output-folder dist/ conda/
echo "CONDA_ARCHIVE=$(conda build --output-folder dist/ --output conda/)" >> $GITHUB_OUTPUT
mamba build --output-folder dist/ conda/
echo "CONDA_ARCHIVE=$(mamba build --output-folder dist/ --output conda/)" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
sudo apt update
sudo apt -yq --no-install-suggests --no-install-recommends install pandoc make
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: false

Expand Down Expand Up @@ -57,20 +57,20 @@ jobs:
- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
cache: "poetry"

- name: Install dependencies
run: |
poetry env use "3.11"
poetry env use "3.12"
poetry install --only doc
- name: Build with Sphinx
run: |
poetry env use "3.11"
poetry env use "3.12"
cd doc && make html
env:
SPHINXBUILD: poetry run sphinx-build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: false
- uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
- uses: pre-commit/[email protected]
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,6 @@ benchmark/*.mtx
*.log
.ruff_cache/
doc/images/*.pdf

roseau/*
!roseau/load_flow
21 changes: 10 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: ^.idea/|^conda/meta.yaml
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-builtin-literals
- id: check-json
Expand All @@ -13,28 +13,27 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-poetry/poetry
rev: 1.6.0
rev: 1.7.0
hooks:
- id: poetry-check
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.7.0 # keep in sync with pyproject.toml
hooks:
- id: black-jupyter
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.286 # keep in sync with pyproject.toml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6 # keep in sync with pyproject.toml
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix, --exit-non-zero-on-fix]
args: [--fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
entry: bash -c "blacken-docs -l 90 $(find doc/ -name '*.md')"
args: [-l 90]
additional_dependencies: [black==23.7.0] # keep in sync with black above
additional_dependencies: [black==23.10.1] # keep in sync with black above
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
rev: v3.1.0
hooks:
- id: prettier
args: ["--print-width", "120"]
exclude: ^.vscode/
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"recommendations": [
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"ms-python.black-formatter",
"ms-python.python",
"ms-python.vscode-pylance"
"ms-python.vscode-pylance",
],
"unwantedRecommendations": [
"ms-python.flake8", // We use ruff
Expand Down
17 changes: 10 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@
"jupyter.notebookFileRoot": "${workspaceFolder}",
"notebook.formatOnSave.enabled": true,
"notebook.codeActionsOnSave": {
"source.organizeImports.ruff": true
"source.organizeImports.ruff": "explicit",
},

// Python
"python.analysis.diagnosticSeverityOverrides": {
"reportInvalidStringEscapeSequence": "warning",
"reportImportCycles": "warning",
"reportUnusedImport": "warning"
"reportUnusedImport": "warning",
},
"python.formatting.provider": "none",
"python.testing.pytestArgs": [],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports.ruff": true
}
"source.organizeImports.ruff": "explicit",
},
},
// Prettier
"prettier.printWidth": 120,
"[markdown][yaml][html][css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
}
}
4 changes: 3 additions & 1 deletion conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ dependencies:
- pint >=0.21.0
- requests >=2.28.1
- typing-extensions >=4.6.2
- rich >=13.5.2
- rich >=13.5.1
- matplotlib >=3.7.2
- networkx >=3.0.0
4 changes: 3 additions & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# prettier-ignore
{% set name = "roseau-load-flow" %}
{% set version = "0.5.0" %}
{% set version = "0.6.0" %}

package:
name: "{{ name|lower }}"
Expand Down Expand Up @@ -35,6 +35,8 @@ requirements:
- requests >=2.28.1
- typing-extensions >=4.6.2
- rich >=13.5.1
- matplotlib >=3.7.2
- networkx >=3.0.0

test:
imports:
Expand Down
11 changes: 11 additions & 0 deletions doc/Bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,14 @@ @misc{wiki:Method_Of_Image_Charges
url = {http://en.wikipedia.org/w/index.php?title=Method\%20of\%20image\%20charges&oldid=1152888135},
note = "[Online; accessed 25-August-2023]"
}

@inproceedings{Girigoudar_2019,
author = {Girigoudar, Kshitij and Molzahn, Daniel K. and Roald, Line A.},
booktitle = {2019 North American Power Symposium (NAPS)},
title = {On The Relationships Among Different Voltage Unbalance Definitions},
year = {2019},
volume = {},
number = {},
pages = {1-6},
doi = {10.1109/NAPS46351.2019.9000231}
}
36 changes: 36 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## Version 0.6.0

- {gh-pr}`149` {gh-issue}`145` Add custom pint wrapper for better handling of pint arrays.
- {gh-pr}`148` {gh-issue}`122` deprecate `LineParameters.from_name_lv()` in favor of the more generic
`LineParameters.from_geometry()`. The method will be removed in a future release.
- {gh-pr}`142` {gh-issue}`136` Add `Bus.res_voltage_unbalance()` method to get the Voltage Unbalance
Factor (VUF) as defined by the IEC standard IEC 61000-3-14.
- {gh-pr}`141` {gh-issue}`137` Add `ElectricalNetwork.to_graph()` to get a `networkx.Graph` object
representing the electrical network for graph theory studies. Install with the `"graph"` extra to
get _networkx_.
`ElectricalNetwork` also gained a new `buses_clusters` property that returns a list of sets of
IDs of buses that are connected by a line or a switch. This can be useful to isolate parts of the
network for localized analysis. For example, to study a LV subnetwork of a MV feeder. Alternatively,
to get the cluster certain bus belongs to, you can use `Bus.get_connected_buses()`.
- {gh-pr}`141` Add official support for Python 3.12. This is the last release to support Python 3.9.
- {gh-pr}`138` Add network constraints for analysis of the results.
- Buses can define minimum and maximum voltages. Use `bus.res_violated` to see if the bus has
over- or under-voltage.
- Lines can define a maximum current. Use `line.res_violated` to see if the loading of any of the
line's cables is too high.
- Transformers can define a maximum power. Use `transformer.res_violated` to see if the transformer
loading is too high.
- The new fields also appear in the data frames of the network.
- {gh-pr}`133` {gh-issue}`126` Add Qmin and Qmax limits of flexible parameters.
- {gh-pr}`132` {gh-issue}`101` Document extra utilities including converters and constants.
- {gh-pr}`131` {gh-issue}`127` Improve the documentation of the flexible loads.
- Add the method `compute_powers` method to the `FlexibleParameter` class to compute the resulting flexible powers
for a given theoretical power and a list of voltage norms.
- Add the `plot_control_p`, `plot_control_q` and `plot_pq` methods to the `FlexibleParameter` class to plot the
control curves and control trajectories.
- Add the extra `plot` to install `matplotlib` alongside `roseau-load-flow`.
- {gh-pr}`131` Correction of a bug in the error message of the powers setter method.
- {gh-pr}`130` Mark some internal attributes as private, they were previously marked as public.
- {gh-pr}`128` Add the properties `z_line`, `y_shunt` and `with_shunt` to the `Line` class.
- {gh-pr}`125` Speed-up build of conda workflow using mamba.

## Version 0.5.0

- {gh-pr}`121` {gh-issue}`68` Improvements of the `LineParameters` constructor:
Expand Down
Loading

0 comments on commit 6eb6507

Please sign in to comment.