Skip to content

Commit 7f1d783

Browse files
authored
Improve config console logger: Allow stderr and improve multiline format (#395)
* Add some validation to config.py * Improve file Permission handling in config.py * Remove unwanted return * Improve Docstrings in config.py * Improve Docstrings in config.py * Typo * Use code block in docstring * Allow stderr for console logging * Make docstrings more compact * Make docstrings more compact * Updated to actually use stderr * Simplify format() * Improve format * Add extra validation * Update CHANGELOG.md
1 parent 968d7fe commit 7f1d783

3 files changed

Lines changed: 202 additions & 183 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ This replaces `specific_share_to_other_effects_*` parameters and inverts the dir
9696
- Improved Model Structure - Views and organisation is now divided into:
9797
- Model: The main Model (linopy.Model) that is used to create and store the variables and constraints for the flow_system.
9898
- Submodel: The base class for all submodels. Each is a subset of the Model, for simpler access and clearer code.
99+
- Made docstrings in `config.py` more compact and easier to read
100+
- Improved format handling in configuration module
101+
- Enhanced console output to support both `stdout` and `stderr` stream selection
102+
- Added `show_logger_name` parameter to `CONFIG.Logging` for displaying logger names in messages
99103
100104
### 🗑️ Deprecated
101105
@@ -133,6 +137,7 @@ This replaces `specific_share_to_other_effects_*` parameters and inverts the dir
133137
- Enhanced NetCDF I/O with proper attribute preservation for DataArrays
134138
- Improved error handling and validation in serialization processes
135139
- Better type consistency across all framework components
140+
- Added extra validation in `config.py` to improve error handling
136141
137142
### 📝 Docs
138143

flixopt/calculation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,8 @@ def solve(
250250

251251
# Log the formatted output
252252
if log_main_results:
253-
logger.info(f'{" Main Results ":#^80}')
254253
logger.info(
255-
'\n'
254+
f'{" Main Results ":#^80}\n'
256255
+ yaml.dump(
257256
utils.round_nested_floats(self.main_results),
258257
default_flow_style=False,

0 commit comments

Comments
 (0)