283 Commits

Author SHA1 Message Date
Andreas
a00f9593ce Gesamtlast does not work anymore. Wrong FastAPI Header. Swagger also wrong 2024-12-11 10:14:30 +01:00
Your Name
9ccc9d930f fix tests for fixed ac charge logic 2024-12-11 08:55:54 +01:00
celle1234
1b1fec444b fix AC charge efficiency not used for price calculation
Fix bug https://github.com/Akkudoktor-EOS/EOS/issues/215
2024-12-11 08:55:54 +01:00
Andreas
5c2bbb4de2 Bugfixes 2024-12-11 07:44:28 +01:00
Andreas
c115435ab3 Price Prediction failed, used Normanns fixes for the new code 2024-12-11 07:44:28 +01:00
Andreas
4fbfff2baf Update README.md
Windows Description
2024-12-11 06:35:43 +01:00
Andreas
1831de1270
Update README.md (#232)
Windows venv paths updated
2024-12-11 00:33:52 +01:00
dependabot[bot]
8585d875c8
Bump timezonefinder from 6.5.5 to 6.5.7 (#228)
Bumps [timezonefinder](https://github.com/jannikmi/timezonefinder) from 6.5.5 to 6.5.7.
- [Release notes](https://github.com/jannikmi/timezonefinder/releases)
- [Changelog](https://github.com/jannikmi/timezonefinder/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/jannikmi/timezonefinder/compare/6.5.5...6.5.7)

---
updated-dependencies:
- dependency-name: timezonefinder
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 00:29:58 +01:00
dependabot[bot]
a0ff85aa3f
Bump pydantic from 2.10.1 to 2.10.3 (#227)
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.10.1 to 2.10.3.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.10.1...v2.10.3)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 00:29:46 +01:00
dependabot[bot]
9655b8fd50
Bump pandas-stubs from 2.2.3.241009 to 2.2.3.241126 (#229)
Bumps [pandas-stubs](https://github.com/pandas-dev/pandas-stubs) from 2.2.3.241009 to 2.2.3.241126.
- [Changelog](https://github.com/pandas-dev/pandas-stubs/blob/main/docs/release_procedure.md)
- [Commits](https://github.com/pandas-dev/pandas-stubs/compare/v2.2.3.241009...v2.2.3.241126)

---
updated-dependencies:
- dependency-name: pandas-stubs
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 00:27:40 +01:00
dependabot[bot]
8c364878b7
Bump scikit-learn from 1.5.2 to 1.6.0 (#230)
Bumps [scikit-learn](https://github.com/scikit-learn/scikit-learn) from 1.5.2 to 1.6.0.
- [Release notes](https://github.com/scikit-learn/scikit-learn/releases)
- [Commits](https://github.com/scikit-learn/scikit-learn/compare/1.5.2...1.6.0)

---
updated-dependencies:
- dependency-name: scikit-learn
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 00:26:59 +01:00
dependabot[bot]
4a7ec0d55c
Bump numpy from 2.1.3 to 2.2.0 (#231)
Bumps [numpy](https://github.com/numpy/numpy) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](https://github.com/numpy/numpy/compare/v2.1.3...v2.2.0)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 00:25:44 +01:00
Dominique Lasserre
e4aa267390
pre-commit: Fix mypy hook (#233)
* Install missing deps. In the future we probably just want to reuse
   the dev environment (e.g. poetry shell) to have same result for hook
   and explicit execution in venv.
2024-12-11 00:21:07 +01:00
Dominique Lasserre
6e52c9bef2
Mypy (#217)
* Mypy: Initial support

 * Add to pre-commit (currently installs own deps, could maybe changed
   to poetry venv in the future to reuse environment and don't need
   duplicated types deps).
 * Add type hints.

* Mypy: Add missing annotations
2024-11-26 22:28:05 +01:00
Jürgen Eckel
595b73359c
renamed haushaltsgeräte to home appliance (#196)
* * rename Haushaltsgeraete to home appliance
* renamed strafe to penalty (optimization problem)

Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com>

* removed penalty renaming

Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com>

* renamed one variable

Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com>

* * renamed variable names and methods of the home appliance class

* renamed missed method names

* fixed renamed variable

* renamed object

* adjusted to latest repo changes

* renamed file to class_home_applianc.py

* renamed method

---------

Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-11-26 00:53:16 +01:00
dependabot[bot]
5b58e6375d
Bump timezonefinder from 6.5.4 to 6.5.5 (#223)
Bumps [timezonefinder](https://github.com/jannikmi/timezonefinder) from 6.5.4 to 6.5.5.
- [Release notes](https://github.com/jannikmi/timezonefinder/releases)
- [Changelog](https://github.com/jannikmi/timezonefinder/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/jannikmi/timezonefinder/compare/6.5.4...6.5.5)

---
updated-dependencies:
- dependency-name: timezonefinder
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 00:40:05 +01:00
dependabot[bot]
9274d16523
Bump pydantic from 2.9.2 to 2.10.1 (#222)
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.9.2 to 2.10.1.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.9.2...v2.10.1)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 00:39:24 +01:00
dependabot[bot]
c86f181d84
Bump uvicorn from 0.32.0 to 0.32.1 (#221)
Bumps [uvicorn](https://github.com/encode/uvicorn) from 0.32.0 to 0.32.1.
- [Release notes](https://github.com/encode/uvicorn/releases)
- [Changelog](https://github.com/encode/uvicorn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/encode/uvicorn/compare/0.32.0...0.32.1)

---
updated-dependencies:
- dependency-name: uvicorn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Normann <github@koldrack.com>
2024-11-26 00:33:58 +01:00
dependabot[bot]
cecea9adc6
Bump fastapi[standard] from 0.115.0 to 0.115.5 (#210)
Bumps [fastapi[standard]](https://github.com/fastapi/fastapi) from 0.115.0 to 0.115.5.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.115.0...0.115.5)

---
updated-dependencies:
- dependency-name: fastapi[standard]
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 00:31:09 +01:00
Dominique Lasserre
ab4cef4b0b
Fix docs creation Closes #218 (#219)
* Fix swagger link in sphynx docs.
2024-11-23 16:44:46 +01:00
Michael Osthege
5e2eae7331
Structure code in logically separated submodules (#188) 2024-11-19 21:47:43 +01:00
dependabot[bot]
345e78888f
Bump sphinx-rtd-theme from 3.0.1 to 3.0.2 (#209)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.1 to 3.0.2.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.1...3.0.2)

---
updated-dependencies:
- dependency-name: sphinx-rtd-theme
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 01:29:33 +01:00
dependabot[bot]
7da4bfc6b4
Bump uvicorn from 0.31.1 to 0.32.0 (#208)
Bumps [uvicorn](https://github.com/encode/uvicorn) from 0.31.1 to 0.32.0.
- [Release notes](https://github.com/encode/uvicorn/releases)
- [Changelog](https://github.com/encode/uvicorn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/encode/uvicorn/compare/0.31.1...0.32.0)

---
updated-dependencies:
- dependency-name: uvicorn
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 01:28:57 +01:00
Dominique Lasserre
c7eb3ec63b
optimize: Enforce start solution with at least two elements Closes #205 (#207)
* mate -> cxTwoPoints needs at least two elements.
2024-11-18 20:54:39 +01:00
Dominique Lasserre
e18201dcb3
Update README/CONTRIBUTING Closes #180 (#204)
* Update README/CONTRIBUTING Closes #180

 * Remove duplicated files in docs/develop and copy them from project
   root to there on documentation generation.

* Makefile: Use fastapi to start server, set port to 8503
2024-11-17 15:27:43 +01:00
Dominique Lasserre
e936aaf134
visualize: Keep shape of plots the same on dst change Closes #185 (#203)
* Currently prediction hours are relative from current hour and don't
   adjust on daylight saving change.
 * ist_dst_wechsel now unused.
2024-11-16 21:52:51 +01:00
Dominique Lasserre
fe9c8ecbbb
Update startup instructions. Closes #201 (#202) 2024-11-16 20:35:09 +01:00
Dominique Lasserre
2f5f844018
Migrate from Flask to FastAPI (#163)
* Migrate from Flask to FastAPI

 * FastAPI migration:
    - Use pydantic model classes as input parameters to the
      data/calculation classes.
    - Interface field names changed to constructor parameter names (for
      simplicity only during transition, should be updated in a followup
      PR).
    - Add basic interface requirements (e.g. some values > 0, etc.).
 * Update tests for new data format.
 * Python requirement down to 3.9 (TypeGuard no longer needed)
 * Makefile: Add helpful targets (e.g. development server with reload)

* Move API doc from README to pydantic model classes (swagger)

 * Link to swagger.io with own openapi.yml.
 * Commit openapi.json and check with pytest for changes so the
   documentation is always up-to-date.

* Streamline docker

* FastAPI: Run startup action on dev server

 * Fix config for /strompreis, endpoint still broken however.

* test_openapi: Compare against docs/.../openapi.json

* Move fastapi to server/ submodule

 * See #187 for new repository structure.
2024-11-15 22:27:25 +01:00
Chris
057f86d580
Json configuration (#141)
* Add json config
* Adjust code to new config

---------

Co-authored-by: Chris <git@nootch.de>
2024-11-11 21:38:13 +01:00
Bobby Noelte
f2ecb5a33f
Skip test for pv forecast timezone behaviour on Windows. (#195)
The 'other_timezone' fixture does not work on Windows. Skip the test case.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-11-11 21:28:53 +01:00
Bobby Noelte
a4c2358fc7
Round pv forecast report data. (#194)
Report data are floats.

The report is used for unit testing which may be affected by the float precision of the test environment.
Round to make the test result more robust without loosing the general test case.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-11-11 21:27:08 +01:00
Bobby Noelte
d2ba0adb5f
Add test to PVForecast (#174)
* Add documentation to class_pv_forecast.py.

Added documentation. Beware mostly generated by ChatGPT.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>

* Add CacheFileStore, datetime and logger utilities.

The `CacheFileStore` class is a singleton-based, thread-safe key-value store for managing
temporary file objects, allowing the creation, retrieval, and management of cache files.

The utility modules offer a flexible logging setup (`get_logger`) and utilities to handle
different date-time formats (`to_datetime`, `to_timestamp`) and timezone detection
(`to_timezone).

- Cache files are automatically valid for the the current date unless specified otherwise.
  This is to mimic the current behaviour used in several classes.
- The logger supports rotating log files to prevent excessive log file size.
- The `to_datetime` and `to_timestamp`functions support a wide variety of input types and formats.
  They provide the time conversion that is e.g. used in PVForecast.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>

* Improve testability of PVForecast

Improvements for testing of PVForecast
- Use common utility functions to allow for general testing at one spot.
  - to_datetime
  - CacheFileStore
- Use logging instead of print to easily capture in testing.
- Add validation of the json schema for Akkudoktor PV forecast data.
- Allow to create an empty PVForecast instance as base instance for testing.
- Make process_data() complete for filling a PVForecast instance for testing.
- Normalize forecast datetime to timezone of system given in loaded data.
- Do not print report but provide report for test checks.
- Get rid of cache file path using the CachFileStore to automate cache file usage.
- Improved module documentation.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>

* Add test for PVForecast and newly extracted utility modules.

- Add test for PVForecast
- Add test for CacheFileStore in the new cachefilestore module
- Add test for to_datetime, to_timestamp, to_timezone in the new
  datetimeutil module
- Add test for get_logger in the new logutil module

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>

---------

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Co-authored-by: Normann <github@koldrack.com>
2024-11-10 23:49:10 +01:00
dependabot[bot]
235ae87be5
Bump pytest-cov from 5.0.0 to 6.0.0 (#190)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 5.0.0 to 6.0.0.
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v5.0.0...v6.0.0)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-10 23:35:48 +01:00
dependabot[bot]
eeef472c5f
Bump numpy from 2.1.2 to 2.1.3 (#189)
Bumps [numpy](https://github.com/numpy/numpy) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](https://github.com/numpy/numpy/compare/v2.1.2...v2.1.3)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-10 23:34:10 +01:00
Bobby Noelte
6561793e3b
Add API documentation generation and use Markdown (#160)
* Add package API documentation generation

Add generation of the API documentation for akkudoktoreos
and akkudoktoreosserver packages.

The API documentation is generated by the Sphinx autosummary extension.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>

* Enable Google style source commenting and documentation generation.

Enable automatic documentation generation from Google style docstrings in the source.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>

* Check Google style source commenting.

Check Google style commenting by the appropriate ruff rules.

Commenting is _NOT_ enforced. Missing docstrings are ignored.

Minor commenting quirks of the code base are adapted.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>

* Improve Markdown handling and switch to Markdown documentation.

Switch to Markdown for the documentation files to improve the user and developer experience (see issue #181).

Keep files with special directives for automatic API documentation in RST format. The
directives expect RST.

Also add dummy handling for openai/ swagger server documentation. The openai interface definition is
for now taken from the fastapi PR as EOS will switch to fastAPI.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>

---------

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Co-authored-by: Normann <github@koldrack.com>
2024-11-10 23:27:52 +01:00
Dominique Lasserre
ef93574f87
Add more optimization tests (#171)
* Integrated single_test_optimization into pytest to run a basic optimization test with tolerance set to 1e-6, ensuring quick detection of deviations.
* Added a long-run test (400 generations, like single_test_optimization), which can be triggered using --full-run in pytest.
* Mocked PDF creation in optimization tests and added a new PDF generation test with image comparison validation.

Note: Current tolerance is set to 1e-6; feedback on whether this tolerance is tight enough is welcome.

---------

Co-authored-by: Normann <github@koldrack.com>
Co-authored-by: Michael Osthege <michael.osthege@outlook.com>
2024-11-10 23:22:30 +01:00
Chris
df202db242
Add settings and extension recommendations (#139)
- Added recommended settings for the Pylance and Pyright extensions
- Enabled pytest and debugging support in configuration
- Reformatted code with Prettier
---------
Co-authored-by: Chris <git@nootch.de>
2024-11-10 23:00:16 +01:00
Normann
81de14d90a
set min_soc_prozent 0 by default (#184)
#183 the current default value of "Null" is not compatible with the class_akku. A default value of 0 is more reasonable.
2024-11-10 17:37:24 +01:00
dependabot[bot]
dbc71dc158
Bump sphinx from 8.0.2 to 8.1.3 (#172)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.0.2 to 8.1.3.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v8.0.2...v8.1.3)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-31 11:57:51 +01:00
Dominique Lasserre
a0872deede
Cleanup: Fix violin chart labels, remove debug code (#167) 2024-10-31 11:17:45 +01:00
Andreas
cdf4d074e2 Hopefully the last precommit fix 2024-10-22 10:39:10 +02:00
Andreas
6848babef1 PreCommit Fixed 2024-10-22 10:39:10 +02:00
Andreas
bcdddd1d23 PreCommit Fixed 2024-10-22 10:39:10 +02:00
Andreas
55950a93eb PreCommit Fixed 2024-10-22 10:39:10 +02:00
Andreas
5d51d0a676 Tests fixed 2024-10-22 10:39:10 +02:00
Andreas
8d3eb96a0b Time problems in EMS / Optimization 2024-10-22 10:39:10 +02:00
Andreas
fca2338bd7 AC Charge Bug, Price Cache On/Off 2024-10-22 10:39:10 +02:00
Andreas
b925ef45cc AC /DC / Discharge optimzation - First try (not finished yet) 2024-10-22 10:39:10 +02:00
Andreas
e455e9a18a class_ems: AC / DC Charging
class_optimize: Timing Bugs fixed
class_numpy_encoder: JSON Encoder with Numpy support
visualize: AC / DC / Discharge
test_class_ems_2: New Test for AC / DC charging decision
2024-10-22 10:39:10 +02:00
Andreas
6238ba4daa EV Bugs 2024-10-22 10:39:10 +02:00