Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions .github/workflows/github_test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
# Reminder: when removing support of an old python version here, then don't forget to remove
# it also in pyproject.toml 'requires-python'
steps:
Expand Down Expand Up @@ -113,20 +113,14 @@ jobs:
PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE python -m pytest -W error --nbmake -n=auto --nbmake-timeout=900 "./tutorials"

docs_check:
needs: build
name: Sphinx docs check
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Check docs for Python ${{ matrix.python-version }}
uses: e2nIEE/sphinx-action@master
- name: Check sphinx build
uses: ammaraskar/sphinx-action@7.4.7
with:
pre-build-command: "python -m pip install --upgrade pip;
python -m pip install .[docs];"
pre-build-command: "python -m pip install uv && uv pip install .[docs] --system --link-mode=copy"
build-command: "sphinx-build -b html . _build -W"
docs-folder: "doc/"
6 changes: 3 additions & 3 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]

steps:
Expand All @@ -40,14 +40,14 @@ jobs:
run: |
if ( '${{ matrix.python-version }}' -eq '3.9' ) { python -m pip install pypower }
if ( '${{ matrix.python-version }}' -ne '3.9' ) { python -m pip install numba }
if ( '${{ matrix.python-version }}' -eq '3.8' -or '${{ matrix.python-version }}' -eq '3.10' ) { python -m pip install lightsim2grid }
if ( '${{ matrix.python-version }}' -eq '3.10' ) { python -m pip install lightsim2grid }

- name: Install specific dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
if ${{ matrix.python-version == '3.9' }}; then python -m pip install pypower; fi
if ${{ matrix.python-version != '3.9' }}; then python -m pip install numba; fi
if ${{ matrix.python-version == '3.8' || matrix.python-version == '3.10' }}; then python -m pip install lightsim2grid; fi
if ${{ matrix.python-version == '3.10' }}; then python -m pip install lightsim2grid; fi

- name: List all installed packages
run: |
Expand Down
33 changes: 30 additions & 3 deletions .github/workflows/upload_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ name: upload
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
push:
branches:
- master
workflow_dispatch:
inputs:
upload_server:
description: 'upload server'
required: true
default: 'testpypi'
type: choice
options:
- 'testpypi'
- 'pypi'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -19,17 +26,32 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Sets up python3
- uses: actions/setup-python@v5
with:
python-version: '3.10'

# Installs and upgrades pip, installs other dependencies and installs the package from setup.py
- name: Install dependencies
run: |
# Upgrade pip
python3 -m pip install --upgrade pip
# Install twine
python3 -m pip install build setuptools wheel twine

# Upload to TestPyPI
- name: Build and Upload to TestPyPI
if: ${{ inputs.upload_server == 'testpypi' }}
run: |
python3 -m build
python3 -m twine check dist/* --strict
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI }}
TWINE_REPOSITORY: testpypi

# Upload to PyPI
- name: Build and Upload to PyPI
run: |
Expand All @@ -40,10 +62,15 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI }}
TWINE_REPOSITORY: pypi

# Wait some time
- name: Sleep for 300s to make release available
if: ${{ inputs.upload_server == 'pypi' }}
uses: juliangruber/sleep-action@v2
with:
time: 300s

# Run an installation for testing
- name: Install simbench from PyPI
run: |
python3 -m pip install simbench
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
Change Log
=============

[1.6.0] - 2024-04-09
----------------------
- [CHANGED] support pandapower geojson, released with pandapower version 3.0.0
- [ADDED] support pandapower parameters step_dependency_table and tap_dependency_table, released with pandapower version 3.0.0
- [CHANGED] drop python 3.8 support
- [FIXED] fix ValueError raise according to GitHub issue #56
- [CHANGED] rename parameter csv2pp parameter `no_generic_coord` by `fill_bus_geo_by_generic_data`

[1.5.3] - 2024-04-23
----------------------
- [FIXED] Bringing together develop and master with all changes of the release process
- [ADDED] generalization and test for auxiliary function :code:`to_numeric_ignored_errors()`

[1.5.2] - 2024-04-09
----------------------
- [CHANGED] readded copyright notice to setup.py and updated date
- [CHANGED] added prune to MANIFEST.in to exclude doc and tutorials from wheel builds
- [CHANGED] removed gitlab ci files from MANIFEST.in to keep them out of wheel builds
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ global-include *.csv
global-include *.json
global-include *.txt

prune .git*
prune doc*
prune tutorials*
22 changes: 8 additions & 14 deletions doc/about/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Installation Guide
Installing Python
----------------------------

simbench is tested with Python 3.5, 3.6 and 3.7. We recommend the Anaconda Distribution, which provides a Python distribution that already includes a lot of modules for scientific computing that are needed. Of course it is also possible to use simbench with other distributions besides Anaconda. Anyway, it is important that the following package is included:
simbench is tested with multiple up-to-date Python versions. We recommend the Miniconda Distribution, which provides a Python distribution that already includes a lot of modules for scientific computing that are needed. Of course it is also possible to use simbench with other distributions besides Anaconda. Anyway, it is important that the following package is included:

- pandapower

Expand All @@ -20,23 +20,15 @@ The easiest way to install simbench is through pip:

1. Open a command prompt (e.g. start–>cmd on windows systems)

2. If you already work with the pandapower development version from GitHub, but did not yet register it to pip:

a. Navigate your command prompt into your pandapower folder (with the command cd <folder>).

b. Register pandapower to pip, to not install pandapower a second time, via typing:

:code:`pip install -e .`

3. Install simbench by running:
2. Install simbench by running:

:code:`pip install simbench`


Installing simbench without pip
Installing simbench without internet connection
--------------------------------------------------------

If you don't have internet access on your system or don't want to use pip for some other reason, simbench can also be installed without using pip:
If you don't have internet access on your system and already downloaded the repository (step 1), simbench can also be installed without from local files:

1. Download and unzip the current simbench distribution from PyPi under "Download files".

Expand All @@ -46,7 +38,9 @@ If you don't have internet access on your system or don't want to use pip for so

3. Install simbench by running :

:code:`python setup.py install`
:code:`pip install -e .`

This registers your local pandapower installation with pip, the option -e ensures the edits in the files have a direct impact on the pandapower installation.


Development Version
Expand All @@ -66,7 +60,7 @@ To install the latest version of simbench from github, simply follow these steps

:code:`pip install -e .`

This registers your local simbench installation with pip.
This registers your local pandapower installation with pip, the option -e ensures the edits in the files have a direct impact on the pandapower installation.


Test your installation
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ More information about pandapower can be found on `www.pandapower.org <https://w

|br|

pandapower is a joint development of the research group Energy Management and Power System Operation (e2n), University of Kassel and the Department for Distribution System
pandapower is a joint development of the Department for Sustainable Electrical Energy Systems (e2n), University of Kassel and the Department for Distribution System
Operation at the Fraunhofer Institute for Energy Economics and Energy System Technology (IEE), Kassel.

.. image:: /pics/iee.png
Expand Down
Binary file modified doc/pics/e2n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "simbench"
version = "1.5.3"
version = "1.6.0"
authors = [
{ name = "Steffen Meinecke", email = "steffen.meinecke@uni-kassel.de" }
]
Expand All @@ -14,7 +14,7 @@ maintainers = [
description = "Electrical Power System Benchmark Models."
readme = "README.rst"
license = { file = "LICENSE" }
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand All @@ -27,14 +27,13 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
# Add the specific Python versions supported here, e.g.:
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
]
dependencies = [
"pandapower>=2.12.1"
"pandapower>=3.0.0"
]
keywords = [
"benchmark grid", "power system", "network", "grid planning", "grid operation", "grid generation methodology", "comparability", "reproducibility", "electricity", "energy", "engineering", "simulation", "simbench", "time series", "future scenarios"
Expand Down Expand Up @@ -72,4 +71,4 @@ find = {}
addopts = ["--strict-markers"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"'), e.g. in run_fast_tests"
]
]
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

3 changes: 3 additions & 0 deletions simbench/converter/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def to_numeric_ignored_errors(data, **kwargs):
"""Wrapper function for pandas.to_numeric(). Needed to emulate previous behavior with deprecated
errors="ignore".

The issue covered by this function is discussed at https://github.com/pandas-dev/pandas/issues/54467.
`df2 = df1.apply(pd.to_numeric, errors='coerce')` and `df2=df2.fillna(df1)` is an alternative way.

Parameters
----------
data : Series|DataFrame
Expand Down
10 changes: 6 additions & 4 deletions simbench/converter/csv_data_manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,12 @@ def _add_phys_type_and_vm_va_setpoints_to_element_tables(csv_data):
def _extend_coordinates_to_node_shape(csv_data):
""" Extends the Coordinates table to the shape of Nodes to enable copying simply to bus_geodata.
"""
bus_geodata = pd.DataFrame([], index=csv_data["Node"].index, columns=["x", "y"])
geo = pd.Series(None, index=csv_data["Node"].index, name="geo", dtype=object)
with_coord = ~csv_data["Node"]["coordID"].isnull()
idx_in_coordID = idx_in_2nd_array(csv_data["Node"]["coordID"].loc[with_coord].values,
csv_data["Coordinates"]["id"].values)
bus_geodata.loc[with_coord, ["x", "y"]] = csv_data["Coordinates"].loc[idx_in_coordID,
["x", "y"]].values
csv_data["Coordinates"] = bus_geodata
geo.loc[with_coord] = [f'{{"type":"Point", "coordinates":[{x}, {y}]}}' for x, y in zip(
csv_data["Coordinates"].loc[idx_in_coordID, "x"].values,
csv_data["Coordinates"].loc[idx_in_coordID, "y"].values,
)]
csv_data["Node"]["geo"] = geo
Loading
Loading