Skip to content
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

🐛 Fix order of prices in new 'INDEXED' composed sensor #72

Merged
merged 3 commits into from
Mar 25, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
name: CI
name: Publish package on pypi

on:
pull_request:
push:
branches: [master]

jobs:
test-and-publish-flow:
publish-flow:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -30,13 +27,7 @@ jobs:
run: poetry install --no-interaction

- name: Run tests
run: poetry run pytest --cov-report xml:coverage.xml

- name: Get Cover
uses: orgoro/coverage@v3.1
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
run: poetry run pytest

# publish version only when pyproject.toml is changed in master
- name: Filter changes in pyproject
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Tests on PRs

on:
pull_request:

jobs:
test-flow:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Run Poetry image
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.7.1

- name: Install library
run: poetry install --no-interaction

- name: Run tests
run: poetry run pytest --cov-report xml:coverage.xml

- name: Get Cover
uses: orgoro/coverage@v3.1
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [v4.3.1](https://github.com/azogue/aiopvpc/tree/v4.3.1) - 🐛 Fix unsorted prices in composed sensor 'INDEXED' (2024-03-25)

[Full Changelog](https://github.com/azogue/aiopvpc/compare/v4.3.0...v4.3.1)

- 🐛 Fix unsorted prices in composed sensor 'INDEXED' (#72)
- 👷 ci: Split actions for tests on PRs and publish package on main
- 👷 Remove codecov integration and produce reports instead (#71)

## [v4.3.0](https://github.com/azogue/aiopvpc/tree/v4.3.0) - ✨ Add new _composed_ sensor for Indexed tariff (2024-03-10)

[Full Changelog](https://github.com/azogue/aiopvpc/compare/v4.2.2...v4.3.0)
Expand Down
2 changes: 1 addition & 1 deletion aiopvpc/prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ def add_composed_price_sensors(data: EsiosApiData):
adjustment = data.sensors[KEY_ADJUSTMENT]
data.sensors[KEY_INDEXED] = {
ts_hour: round(pvpc[ts_hour] - adjustment[ts_hour], 5)
for ts_hour in common_ts_prices
for ts_hour in sorted(common_ts_prices)
}
data.availability[KEY_INDEXED] = True
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ markers = [

[tool.poetry]
name = "aiopvpc"
version = "4.3.0"
version = "4.3.1"
description = "Retrieval of Spanish Electricity hourly prices (PVPC)"
authors = ["Eugenio Panadero <eugenio.panadero@gmail.com>"]
license = "MIT"
Expand Down
Loading