266 Commits

Author SHA1 Message Date
Andreas
38a457a3dc Ruff 2024-10-09 16:59:50 +02:00
Andreas
004e1f3dc7 [BUG]: class_ems nd_array not JSON serializable
Big Bugfix - not sure if everything works
2024-10-09 16:59:50 +02:00
Andreas
e72008471f JSON Response fixed 2024-10-09 16:59:50 +02:00
Bobby Noelte
65044b6c6c Add test for server
A test fixture to start the server and a first test case is added.

The fixture tries to assure that the server is installed and running.
If it is not installed the fixture uses pip to install it.

The server and the installation by pip is run bei the same Python
executable that also runs pytest.

The github workflow for pytest is adapted to install akkudoktor-eos.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-10-08 19:22:16 +02:00
Normann
1e78abb074 convert np arrys to lists before changing 2024-10-08 18:55:51 +02:00
Normann
dc8f2f94b8 revert check in test for ems 2024-10-08 18:55:51 +02:00
Normann
62339a0e6c set current hour value None in class_ems.py 2024-10-08 18:55:51 +02:00
Normann
3050320607 remove unused function
replace_nan_with_none(data) is not needed anymore since we don't have any NaN values. Another 13% speed increase.
2024-10-08 18:55:51 +02:00
dependabot[bot]
0e81241fdc Bump numpy from 1.26.4 to 2.1.2
Bumps [numpy](https://github.com/numpy/numpy) from 1.26.4 to 2.1.2.
- [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/v1.26.4...v2.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-08 18:54:11 +02:00
Normann
03efff52d9 TypeGuard[float] added to isfloat 2024-10-08 07:53:07 +02:00
Normann
56587305e0 README-DE Python req. pushed to 3.10 2024-10-08 07:53:07 +02:00
Normann
4e0e363ba5 README.md Python req. pushed to 3.10 2024-10-08 07:53:07 +02:00
Normann
76be16b06a empty line added 2024-10-08 07:53:07 +02:00
Normann
cbfd7c45c7 import sort#2 2024-10-08 07:53:07 +02:00
Normann
b54b4f8228 sort imports 2024-10-08 07:53:07 +02:00
Normann
290e6293f2 moved isfloat(num)
improved isfloat for case "None" and strings with surrounding whitespace and special types like +-inf.
2024-10-08 07:53:07 +02:00
Normann
2613e71bda remove isfloat()
function is not used here
2024-10-08 07:53:07 +02:00
Bobby Noelte
b9f65ef7db Adapt data to package directory structure.
Move static data to server package directory.
Assure data/*.npz data is included in the server package.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-10-07 17:51:44 +02:00
Bobby Noelte
7c13cb6e1c Adapt Dockerfile to package directory structure.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-10-07 08:12:33 +02:00
Bobby Noelte
2c5c612cab Add packaging and use it.
Add packaging information and make it usable by Makefile.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-10-07 08:12:33 +02:00
Bobby Noelte
9f78966c89 Adapt tests to package directory structure.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-10-07 08:12:33 +02:00
Bobby Noelte
7d25194585 Adapt python sources to new package directory structure.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-10-07 08:12:33 +02:00
Bobby Noelte
36e1bb649a Move Python package files to new package directories
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2024-10-07 08:12:33 +02:00
Jakob Moecke
6823aeaaee date fix line 110 README-DE.md 2024-10-07 07:52:04 +02:00
Andreas
89b95edb88 Delete battery_model.pkl 2024-10-06 22:40:42 +02:00
Andreas
05c0f74b09 min_soc (was killed by someone else, pls dont force push!) 2024-10-06 16:00:07 +02:00
Normann
a16490523d fixed optimize test
fixed first our values for optimize test
2024-10-06 15:20:37 +02:00
Normann
fb59c9dd14 fixed_seed for single_test_optimization
sets the seed for random to a fixed value to be able to compare results.
Value chosen for obvious reason. Same value is used in the test case.
2024-10-06 15:20:37 +02:00
Andreas
738a4da455 MariaDB removed 2024-10-06 15:20:10 +02:00
Andreas
e61a89cff6 Pre Commit 2024-10-06 14:35:11 +02:00
Andreas
9b7817e3dc - Home Appliances fixed
- Unittest with Home Appliances
2024-10-06 14:35:11 +02:00
Andreas
0a0c3eed87 Unittest includes Home Appliances 2024-10-06 14:35:11 +02:00
Normann
27bab20606 Update test_class_ems.py 2024-10-06 14:35:11 +02:00
Normann
a80d4c1901 cleanup class_ems.py
- type hints added
- translated to English
- reduced not needed function calls 

improves optimization time by 50%
2024-10-06 14:35:11 +02:00
Andreas
d8c726e833 Delete data/mariadb directory
Not needed
2024-10-06 07:40:19 +02:00
Andreas
e99d1ae84b Delete test_data directory
Dead Files
2024-10-06 07:39:42 +02:00
fortrieb
66d101fb50 Heat pump: Tests, Translation, Docstrings, Relocation (#89)
* Add first unit test for heatpump COP calculation

* Translate to english,

add type hints, improve unit tests.

* Run pre-commit

* Apply suggestions from code review

Co-authored-by: Michael Osthege <michael.osthege@outlook.com>

* Remove conftest file

---------

Co-authored-by: Michael Osthege <michael.osthege@outlook.com>
2024-10-06 01:06:08 +02:00
Normann
dd3363b714 test for class_optimize in PR #88
Test meant for class_optimize.
Will only work with PR #88 since the old class has no way to use a fixed random seed.
2024-10-05 23:54:05 +02:00
Andreas
9471ad7abc Pre Commit Fixes 2024-10-05 09:22:10 +02:00
Andreas
ee3f94a3e2 deleted dead File server_load_profile.py now in flask_server
test.py -> single_test_optimization.py
2024-10-05 09:22:10 +02:00
Andreas
cd0d134408 Moved load_profile db to data
removed comments
fixed Bug in visualize.py (extra data empty)
removed dead cp
2024-10-05 09:22:10 +02:00
Andreas
c047b0c7dc Moves Load_Profiles
deleted comments
flask_server path with os lib
2024-10-05 09:22:10 +02:00
Sebastian Struß
3fb564d2db Add docker multi-arch build with github package push and cleaned up Dockerfile for smaller builds 2024-10-05 08:53:14 +02:00
Andreas
7f97bbb7bc Pre Commit Fix 2024-10-05 08:50:23 +02:00
Andreas
c7140f6da5 datetime bug 2024-10-05 08:50:23 +02:00
Normann
fb1aa06ddd Refactored class_optimize.py
- Optimized Imports: Removed unused imports and organized them.
- Refactored Code: Introduced split_individual function for clarity.
- Improved Efficiency: Enhanced penalty calculation and streamlined loops.
- Updated Evaluation Logic: Better handling of penalties in evaluate.
- Type Hints added
- fixed seed option added for automated tests
- verbose comment added, default False

Notes:
- isfloat is only used in flask_server.py
- start_hour is not used in this class
2024-10-05 08:50:23 +02:00
Normann
1eed420131 bugfix visualize module
datetime.datetime.now() is incorrectly accessing the datetime class
2024-10-04 16:16:03 +02:00
Michael Osthege
7abee4a8e8 Add contribution guide and issue templates 2024-10-04 11:51:10 +02:00
Michael Osthege
2fce372029 Fix code style 2024-10-04 11:51:10 +02:00
Andreas
4458b9f841 English + Ruff 2024-10-04 11:04:50 +02:00