Files
EOS/tests/testdata/docs/_generated/configelecprice.md
Bobby Noelte eb9e966de9 fix: move data management to async (#1015)
FAstAPI is an async framework. Data may be imported and exported, load and save, set and get
asynchronously. Prevent interleaving data operations to corrupt the data. In the previous design
sync and async data access was intermixed leading to data corruption.

The basic data classes DataSequence and DataContainer and the derived classes like Provider and
Measurement now are async. Data access is protected by several async locks.

To support the async design of the data classes the database interface became async.

The energy management is also adapted to the new async design. Optimization is still off-loaded
to another thread, but the prepration for the optimization and the post optimization actions now
follow the async design.

Adapter operations are now also protected by async locks.

Tests were adapted to the async design and new tests were created.

Besides this major fix several other improvements and fixes are included in this PR.

* fix: key_to_dict/list/array only regard data records with key value set.

  Before the exclusion of no value data records was only done if the dropna flag was set.

* fix: test for visual result pdf generation

  Due to updates in the library the generated charts text was a little bit different.
  Adapt the test to create the comaprison pdf in the test data durectory and
  update the reference pdf.

* chore: Remove MutableMapping from DataSequence and DataContainer.

  Mutable Mapping does not fit to the now async design.

* chore: Add NoDB database backend

  This backend implements the full database backend interface but performs
  no actual persistence. It is intended for configurations where database
  persistence is disabled (`provider=None`).

* chore: Improve measurement data import testing with real world scenarios.

  Added two new endpoints to support testing.

* chore: Add mermaid to supported documentation tools

* chore: Add documentation about async design

* chore: Add documentation about generic data handling

  Covers the basics of measurement and prediction time series data handling.

* chore: Add empty lines around markdown lists.

* chore: sync pre-commit config to updated package versions

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2026-07-15 16:38:53 +02:00

9.4 KiB

Electricity Price Prediction Configuration

:::{table} elecprice :widths: 10 20 10 5 5 30 :align: left

Name Environment Variable Type Read-Only Default Description
charges_kwh EOS_ELECPRICE__CHARGES_KWH Optional[float] rw None Electricity price charges [€/kWh]. Will be added to variable market price.
elecpricefixed EOS_ELECPRICE__ELECPRICEFIXED ElecPriceFixedCommonSettings rw required Fixed electricity price provider settings.
elecpriceimport EOS_ELECPRICE__ELECPRICEIMPORT ElecPriceImportCommonSettings rw required Import provider settings.
energycharts EOS_ELECPRICE__ENERGYCHARTS ElecPriceEnergyChartsCommonSettings rw required Energy Charts provider settings.
provider EOS_ELECPRICE__PROVIDER Optional[str] rw None Electricity price provider id of provider to be used.
providers list[str] ro N/A Available electricity price provider ids.
vat_rate EOS_ELECPRICE__VAT_RATE Optional[float] rw 1.19 VAT rate factor applied to electricity price when charges are used.
:::

Example Input

   {
       "elecprice": {
           "provider": "ElecPriceAkkudoktor",
           "charges_kwh": 0.21,
           "vat_rate": 1.19,
           "elecpricefixed": {
               "time_windows": {
                   "windows": []
               }
           },
           "elecpriceimport": {
               "import_file_path": null,
               "import_json": null
           },
           "energycharts": {
               "bidding_zone": "DE-LU"
           }
       }
   }

Example Output

   {
       "elecprice": {
           "provider": "ElecPriceAkkudoktor",
           "charges_kwh": 0.21,
           "vat_rate": 1.19,
           "elecpricefixed": {
               "time_windows": {
                   "windows": []
               }
           },
           "elecpriceimport": {
               "import_file_path": null,
               "import_json": null
           },
           "energycharts": {
               "bidding_zone": "DE-LU"
           },
           "providers": [
               "ElecPriceAkkudoktor",
               "ElecPriceEnergyCharts",
               "ElecPriceFixed",
               "ElecPriceImport"
           ]
       }
   }

Common settings for Energy Charts electricity price provider

:::{table} elecprice::energycharts :widths: 10 10 5 5 30 :align: left

Name Type Read-Only Default Description
bidding_zone <enum 'EnergyChartsBiddingZones'> rw DE-LU Bidding Zone: 'AT', 'BE', 'CH', 'CZ', 'DE-LU', 'DE-AT-LU', 'DK1', 'DK2', 'FR', 'HU', 'IT-NORTH', 'NL', 'NO2', 'PL', 'SE4' or 'SI'
:::

Example Input/Output

   {
       "elecprice": {
           "energycharts": {
               "bidding_zone": "AT"
           }
       }
   }

Common settings for elecprice data import from file or JSON String

:::{table} elecprice::elecpriceimport :widths: 10 10 5 5 30 :align: left

Name Type Read-Only Default Description
import_file_path Union[str, pathlib.Path, NoneType] rw None Path to the file to import elecprice data from.
import_json Optional[str] rw None JSON string, dictionary of electricity price forecast value lists.
:::

Example Input/Output

   {
       "elecprice": {
           "elecpriceimport": {
               "import_file_path": null,
               "import_json": "{\"elecprice_marketprice_wh\": [0.0003384, 0.0003318, 0.0003284]}"
           }
       }
   }

Value applicable during a specific time window

This model extends TimeWindow by associating a value with the defined time interval.

:::{table} elecprice::elecpricefixed::time_windows::windows::list :widths: 10 10 5 5 30 :align: left

Name Type Read-Only Default Description
date Optional[pydantic_extra_types.pendulum_dt.Date] rw None Optional specific calendar date for the time window. Naive — matched against the local date of the datetime passed to contains(). Overrides day_of_week if set.
day_of_week Union[int, str, NoneType] rw None Optional day of the week restriction. Can be specified as integer (0=Monday to 6=Sunday) or localized weekday name. If None, applies every day unless date is set.
duration Duration rw required Duration of the time window starting from start_time.
locale Optional[str] rw None Locale used to parse weekday names in day_of_week when given as string. If not set, Pendulum's default locale is used. Examples: 'en', 'de', 'fr', etc.
start_time Time rw required Naive start time of the time window (time of day, no timezone). Interpreted in the timezone of the datetime passed to contains() or earliest_start_time().
value Optional[float] rw None Value applicable during this time window.
:::

Example Input/Output

   {
       "elecprice": {
           "elecpricefixed": {
               "time_windows": {
                   "windows": [
                       {
                           "start_time": "00:00:00.000000",
                           "duration": "2 hours",
                           "day_of_week": null,
                           "date": null,
                           "locale": null,
                           "value": 0.288
                       }
                   ]
               }
           }
       }
   }

Sequence of value time windows

This model specializes TimeWindowSequence to ensure that all contained windows are instances of ValueTimeWindow. It provides the full set of sequence operations (containment checks, availability, start time calculations) for value windows.

:::{table} elecprice::elecpricefixed::time_windows :widths: 10 10 5 5 30 :align: left

Name Type Read-Only Default Description
windows list[akkudoktoreos.config.configabc.ValueTimeWindow] rw required Ordered list of value time windows. Each window defines a time interval and an associated value.
:::

Example Input/Output

   {
       "elecprice": {
           "elecpricefixed": {
               "time_windows": {
                   "windows": []
               }
           }
       }
   }

Common configuration settings for fixed electricity pricing

This model defines a fixed electricity price schedule using a sequence of time windows. Each window specifies a time interval and the electricity price applicable during that interval.

:::{table} elecprice::elecpricefixed :widths: 10 10 5 5 30 :align: left

Name Type Read-Only Default Description
time_windows ValueTimeWindowSequence rw required Sequence of time windows defining the fixed price schedule. If not provided, no fixed pricing is applied.
:::

Example Input/Output

   {
       "elecprice": {
           "elecpricefixed": {
               "time_windows": {
                   "windows": [
                       {
                           "start_time": "00:00:00.000000",
                           "duration": "8 hours",
                           "day_of_week": null,
                           "date": null,
                           "locale": null,
                           "value": 0.288
                       },
                       {
                           "start_time": "08:00:00.000000",
                           "duration": "16 hours",
                           "day_of_week": null,
                           "date": null,
                           "locale": null,
                           "value": 0.34
                       }
                   ]
               }
           }
       }
   }