Prediction providers can now individually set the minimum historic prediction hours
to be kept in the data records. This setting supersedes any lower setting given by the
configuration `prediction_historic_hours`.
As a help for the future change of ElecPriceAkkudoktor, the minimum historic hours for
this provider is set to 5 * 7 * 24 hours.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Use documentation generation tools that are available for Windows and Linux.
Use python instead of shell scripts to generate documentation.
For ReadTheDocs make generated documentation content static to avoid
running scripts outside of the docs/ path which is the default path for ReadTheDOcs.
Add tests that check if generated content does go out of sync with latest source.
Use tabs to show commands for Windows and Linux to improve user experience.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Add documentation that covers:
- configuration
- prediction
Add Python scripts that support automatic documentation generation for
configuration data defined with pydantic.
Adapt EOS configuration to provide more methods for REST API and
automatic documentation generation.
Adapt REST API to allow for EOS configuration file load and save.
Sort REST API on generation of openapi markdown for docs.
Move logutil to core/logging to allow configuration of logging by standard config.
Make Akkudoktor predictions always start extraction of prediction data at start of day.
Previously extraction started at actual hour. This is to support the code that assumes
prediction data to start at start of day.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
* workflow: docker-build upload to DockerHub
- Upload on release, tag, push to main.
- Build on pr to main (amd64 only).
* docker: temporarily disable read-only container Closes#278
- Update documentation.
- Temporarily set akkudoktor/eos:main in compose.yml (with
releases/tags it should be replaced by latest again)
Add documentation that covers:
- Prediction
- Measuremnt
- REST API
Add Python scripts that support automatic documentation generation using the Sphinx
sphinxcontrib.eval extension.
Add automatic update/ test for REST API documentation.
Filter proxy endpoints from REST API documentation.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Detect active PV planes by pvforecast_surface_tilt and pvforecast_surface_azimuth to be non None. Assure by default these configuration values are None.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
* Provide /v1/prediction/update and
/v1/prediction/update/{provider_id} as POST endpoints to update
provider data.
* Update description for deprecated endpoints how to use new API.
Normalize electricity price prediction to €/Wh.
Provide electricity price prediction by €/kWh for convenience.
Allow to configure electricity price charges by €/kWh.
Also added error page to fastapi rest server to get rid of annoying
unrelated fault messages during testing.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
* Add EOS_CONFIG_DIR to set config dir (relative path to EOS_DIR or
absolute path).
- config_folder_path read-only
- config_file_path read-only
* Default values to support app start with empty config:
- latitude/longitude (Berlin)
- optimization_ev_available_charge_rates_percent (null, so model
default value is used)
- Enable Akkudoktor electricity price forecast (docker-compose).
* Fix some endpoints (empty data, remove unused params, fix types).
* cacheutil: Use cache dir. Closes#240
* Support EOS_LOGGING_LEVEL environment variable to set log level.
* tests: All tests use separate temporary config
- Add pytest switch --check-config-side-effect to check user
config file existence after each test. Will also fail if user config
existed before test execution (but will only check after the test has
run).
Enable flag in github workflow.
- Globally mock platformdirs in config module. Now no longer required
to patch individually.
Function calls to config instance (e.g. merge_settings_from_dict)
were unaffected previously.
* Set Berlin as default location (default config/docker-compose).
* Discharge Mask Bug, Tests updated, simple Price Forecast with linear weighting
* Price Forecast with linear weighting, last value = highest weighting Discharge enforce when soc = 0 -> mask bug
* Inverter: Self consumption interpolator for better discharge_hour results
* Small penalty when EV 100% and charge >0
* Price Forceast (use mean of last 7 days instead of repeat)
* Price Prediction as JSON simulation output, config fixed electricty fees configurable + MyPy & Ruff
The electricity price prediction provided prices in Eurocent/ kWh despite claiming
the price to be in €/ kWh. Also the addition of charges was not possible.
Now prices are provided in €/kWh. Charges can be configured by the `elecprice_charges`
configuration option.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
measurement:
- Add new measurement class to hold real world measurements.
- Handles load meter readings, grid import and export meter readings.
- Aggregates load meter readings aka. measurements to total load.
- Can import measurements from files, pandas datetime series,
pandas datetime dataframes, simple daetime arrays and
programmatically.
- Maybe expanded to other measurement values.
- Should be used for load prediction adaptions by real world
measurements.
core/coreabc:
- Add mixin class to access measurements
core/pydantic:
- Add pydantic models for pandas datetime series and dataframes.
- Add pydantic models for simple datetime array
core/dataabc:
- Provide DataImport mixin class for generic import handling.
Imports from JSON string and files. Imports from pandas datetime dataframes
and simple datetime arrays. Signature of import method changed to
allow import datetimes to be given programmatically and by data content.
- Use pydantic models for datetime series, dataframes, arrays
- Validate generic imports by pydantic models
- Provide new attributes min_datetime and max_datetime for DataSequence.
- Add parameter dropna to drop NAN/ None values when creating lists, pandas series
or numpy array from DataSequence.
config/config:
- Add common settings for the measurement module.
predictions/elecpriceakkudoktor:
- Use mean values of last 7 days to fill prediction values not provided by
akkudoktor.net (only provides 24 values).
prediction/loadabc:
- Extend the generic prediction keys by 'load_total_adjusted' for load predictions
that adjust the predicted total load by measured load values.
prediction/loadakkudoktor:
- Extend the Akkudoktor load prediction by load adjustment using measured load
values.
prediction/load_aggregator:
- Module removed. Load aggregation is now handled by the measurement module.
prediction/load_corrector:
- Module removed. Load correction (aka. adjustment of load prediction by
measured load energy) is handled by the LoadAkkudoktor prediction and
the generic 'load_mean_adjusted' prediction key.
prediction/load_forecast:
- Module removed. Functionality now completely handled by the LoadAkkudoktor
prediction.
utils/cacheutil:
- Use pydantic.
- Fix potential bug in ttl (time to live) duration handling.
utils/datetimeutil:
- Added missing handling of pendulum.DateTime and pendulum.Duration instances
as input. Handled before as datetime.datetime and datetime.timedelta.
utils/visualize:
- Move main to generate_example_report() for better testing support.
server/server:
- Added new configuration option server_fastapi_startup_server_fasthtml
to make startup of FastHTML server by FastAPI server conditional.
server/fastapi_server:
- Add APIs for measurements
- Improve APIs to provide or take pandas datetime series and
datetime dataframes controlled by pydantic model.
- Improve APIs to provide or take simple datetime data arrays
controlled by pydantic model.
- Move fastAPI server API to v1 for new APIs.
- Update pre v1 endpoints to use new prediction and measurement capabilities.
- Only start FastHTML server if 'server_fastapi_startup_server_fasthtml'
config option is set.
tests:
- Adapt import tests to changed import method signature
- Adapt server test to use the v1 API
- Extend the dataabc test to test for array generation from data
with several data interval scenarios.
- Extend the datetimeutil test to also test for correct handling
of to_datetime() providing now().
- Adapt LoadAkkudoktor test for new adjustment calculation.
- Adapt visualization test to use example report function instead of visualize.py
run as process.
- Removed test_load_aggregator. Functionality is now tested in test_measurement.
- Added tests for measurement module
docs:
- Remove sphinxcontrib-openapi as it prevents build of documentation.
"site-packages/sphinxcontrib/openapi/openapi31.py", line 305, in _get_type_from_schema
for t in schema["anyOf"]: KeyError: 'anyOf'"
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>