You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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).
"description": "Sub-path for the EOS cache data directory.",
2988
2960
"default": "cache"
2989
2961
},
2990
-
"config_folder_path": {
2991
-
"anyOf": [
2992
-
{
2993
-
"type": "string",
2994
-
"format": "path"
2995
-
},
2996
-
{
2997
-
"type": "null"
2998
-
}
2999
-
],
3000
-
"title": "Config Folder Path",
3001
-
"description": "Path to EOS configuration directory."
3002
-
},
3003
-
"config_file_path": {
3004
-
"anyOf": [
3005
-
{
3006
-
"type": "string",
3007
-
"format": "path"
3008
-
},
3009
-
{
3010
-
"type": "null"
3011
-
}
3012
-
],
3013
-
"title": "Config File Path",
3014
-
"description": "Path to EOS configuration file."
3015
-
},
3016
2962
"pvforecast_planes": {
3017
2963
"items": {
3018
2964
"type": "string"
@@ -3100,6 +3046,34 @@
3100
3046
"description": "Compute data_cache_path based on data_folder_path.",
3101
3047
"readOnly": true
3102
3048
},
3049
+
"config_folder_path": {
3050
+
"anyOf": [
3051
+
{
3052
+
"type": "string",
3053
+
"format": "path"
3054
+
},
3055
+
{
3056
+
"type": "null"
3057
+
}
3058
+
],
3059
+
"title": "Config Folder Path",
3060
+
"description": "Path to EOS configuration directory.",
3061
+
"readOnly": true
3062
+
},
3063
+
"config_file_path": {
3064
+
"anyOf": [
3065
+
{
3066
+
"type": "string",
3067
+
"format": "path"
3068
+
},
3069
+
{
3070
+
"type": "null"
3071
+
}
3072
+
],
3073
+
"title": "Config File Path",
3074
+
"description": "Path to EOS configuration file.",
3075
+
"readOnly": true
3076
+
},
3103
3077
"config_default_file_path": {
3104
3078
"type": "string",
3105
3079
"format": "path",
@@ -3128,11 +3102,13 @@
3128
3102
"timezone",
3129
3103
"data_output_path",
3130
3104
"data_cache_path",
3105
+
"config_folder_path",
3106
+
"config_file_path",
3131
3107
"config_default_file_path",
3132
3108
"config_keys"
3133
3109
],
3134
3110
"title": "ConfigEOS",
3135
-
"description": "Singleton configuration handler for the EOS application.\n\nConfigEOS extends `SettingsEOS` with support for default configuration paths and automatic\ninitialization.\n\n`ConfigEOS` ensures that only one instance of the class is created throughout the application,\nallowing consistent access to EOS configuration settings. This singleton instance loads\nconfiguration data from a predefined set of directories or creates a default configuration if\nnone is found.\n\nInitialization Process:\n - Upon instantiation, the singleton instance attempts to load a configuration file in this order:\n 1. The directory specified by the `EOS_DIR` environment variable.\n 2. A platform specific default directory for EOS.\n 3. The current working directory.\n - The first available configuration file found in these directories is loaded.\n - If no configuration file is found, a default configuration file is created in the platform\n specific default directory, and default settings are loaded into it.\n\nAttributes from the loaded configuration are accessible directly as instance attributes of\n`ConfigEOS`, providing a centralized, shared configuration object for EOS.\n\nSingleton Behavior:\n - This class uses the `SingletonMixin` to ensure that all requests for `ConfigEOS` return\n the same instance, which contains the most up-to-date configuration. Modifying the configuration\n in one part of the application reflects across all references to this class.\n\nAttributes:\n _settings (ClassVar[SettingsEOS]): Holds application-wide settings.\n _file_settings (ClassVar[SettingsEOS]): Stores configuration loaded from file.\n config_folder_path (Optional[Path]): Path to the configuration directory.\n config_file_path (Optional[Path]): Path to the configuration file.\n\nRaises:\n FileNotFoundError: If no configuration file is found, and creating a default configuration fails.\n\nExample:\n To initialize and access configuration attributes (only one instance is created):\n ```python\n config_eos = ConfigEOS() # Always returns the same instance\n print(config_eos.prediction_hours) # Access a setting from the loaded configuration\n ```"
3111
+
"description": "Singleton configuration handler for the EOS application.\n\nConfigEOS extends `SettingsEOS` with support for default configuration paths and automatic\ninitialization.\n\n`ConfigEOS` ensures that only one instance of the class is created throughout the application,\nallowing consistent access to EOS configuration settings. This singleton instance loads\nconfiguration data from a predefined set of directories or creates a default configuration if\nnone is found.\n\nInitialization Process:\n - Upon instantiation, the singleton instance attempts to load a configuration file in this order:\n 1. The directory specified by the `EOS_CONFIG_DIR` environment variable\n 2. The directory specified by the `EOS_DIR` environment variable.\n 3. A platform specific default directory for EOS.\n 4. The current working directory.\n - The first available configuration file found in these directories is loaded.\n - If no configuration file is found, a default configuration file is created in the platform\n specific default directory, and default settings are loaded into it.\n\nAttributes from the loaded configuration are accessible directly as instance attributes of\n`ConfigEOS`, providing a centralized, shared configuration object for EOS.\n\nSingleton Behavior:\n - This class uses the `SingletonMixin` to ensure that all requests for `ConfigEOS` return\n the same instance, which contains the most up-to-date configuration. Modifying the configuration\n in one part of the application reflects across all references to this class.\n\nAttributes:\n _settings (ClassVar[SettingsEOS]): Holds application-wide settings.\n _file_settings (ClassVar[SettingsEOS]): Stores configuration loaded from file.\n config_folder_path (Optional[Path]): Path to the configuration directory.\n config_file_path (Optional[Path]): Path to the configuration file.\n\nRaises:\n FileNotFoundError: If no configuration file is found, and creating a default configuration fails.\n\nExample:\n To initialize and access configuration attributes (only one instance is created):\n ```python\n config_eos = ConfigEOS() # Always returns the same instance\n print(config_eos.prediction_hours) # Access a setting from the loaded configuration\n ```"
0 commit comments