Skip to content

Conversation

@FBumann
Copy link
Member

@FBumann FBumann commented Sep 30, 2025

Description

Remove all warnings from tests AND from user code

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring

Related Issues

Closes #(issue number)

Testing

  • I have tested my changes
  • Existing tests still pass

Checklist

  • My code follows the project style
  • I have updated documentation if needed
  • I have added tests for new functionality (if applicable)

Summary by CodeRabbit

  • Refactor
    • Breaking API: Sinks now use inputs=[Flow(...)] instead of sink=..., Sources use outputs=[Flow(...)] instead of source=....
    • Renamed CO2 parameter maximum_operation_per_hour to maximum_per_hour.
  • Bug Fixes
    • More reliable figure export/display; prevents lingering sockets and ensures figures are closed after save/show.
    • Results assembly more robust when components have mismatched dimensions (outer join).
  • Chores
    • Reduced warning noise by filtering selected third‑party warnings; pytest warning policies added.
  • Tests
    • Non‑interactive plotting and automatic figure cleanup to improve test stability.

…`inputs`/`outputs` in component definitions.
… `xr.concat` in `results.py` to use `join='outer'` for safer merging.
…les, and close figures to prevent memory leaks.
…add cleanup with `tearDown`, and ensure compatibility with non-interactive Matplotlib backends.
…cific third-party warnings, and display all warnings from internal code.
…nore specific third-party warnings, and display all warnings from internal code."

This reverts commit 0928b26.
…ling, and add test fixtures for cleanup and non-interactive configurations.
… specific third-party warnings, and display all internal warnings.
…ert treating most third-party warnings as errors.
… and add detailed context for `__init__.py` filters.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Updates examples and tests to new Sink/Source APIs (inputs/outputs lists), and renames an effect parameter to maximum_per_hour. Adds warning filters, safer plotting export/cleanup, and changes results concatenation to join='outer'. Test infrastructure sets non-interactive plotting backends and closes figures. Minor dataset frequency string tweak.

Changes

Cohort / File(s) Summary
Examples: API migration to inputs/outputs and effect rename
examples/00_Minmal/minimal_example.py, examples/01_Simple/simple_example.py, examples/02_Complex/complex_example.py, examples/03_Calculation_types/example_calculation_types.py, examples/04_Scenarios/scenario_example.py, examples/05_Two-stage-optimization/two_stage_optimization.py
Replace Sink(sink=Flow) → Sink(inputs=[Flow]) and Source(source=Flow) → Source(outputs=[Flow]); update CO2 parameter maximum_operation_per_hour → maximum_per_hour where present.
Core: warning filters
flixopt/__init__.py
Add warnings import and filterwarnings for tsam, linopy, numpy after CONFIG.load_config. No public API change.
Core: plotting export/cleanup
flixopt/plotting.py
Safer export_figure: try/finally, clear Plotly renderer; only show Matplotlib in interactive backends; close figures after save; add os and matplotlib imports.
Core: results concatenation
flixopt/results.py
xr.concat for effects uses join='outer' when combining along component dimension.
Config: pytest warning filters
pyproject.toml
Add pytest filterwarnings: elevate flixopt warnings to errors; ignore specific third-party warnings.
Tests: API migration and fixtures
tests/conftest.py, tests/test_bus.py, tests/test_component.py, tests/test_flow.py, tests/test_functional.py, tests/test_scenarios.py
Migrate to Sink(inputs=[...]) and Source(outputs=[...]); update attribute accesses (e.g., inputs[0]); add autouse fixtures to close figures and set non-interactive backend.
Tests: plotting behavior
tests/test_plots.py
Use non-interactive Matplotlib (Agg) and Plotly json renderer; save to files, close figures, GC.
Tests: minor dataset tweak
tests/test_dataconverter.py
Change pd.date_range frequency from "H" to "h" in a test.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant SRC as Source
  participant BUS as Bus
  participant SNK as Sink

  note over SRC,SNK: New wiring via list-based connections
  SRC->>BUS: outputs[0]: Flow (supply)
  BUS->>SNK: inputs[0]: Flow (demand)
  note right of SNK: Effects and limits (e.g., maximum_per_hour) apply per Flow
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • baumbude
  • PStange

Poem

I hop through flows, now neat in rows,
With inputs, outputs, tidy goes.
The CO2 cap’s per-hour clear,
Plots close softly, no sockets here.
Warnings hush, results align—
A carrot-click, the build is fine. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title “Feature/v3/feature/no warnings in tests” closely reflects the branch naming convention rather than providing a clear, concise summary of the change; it includes redundant path-like segments and does not succinctly describe the removal of warnings in tests and user code. Rename the pull request title to a short, single-sentence description of the primary change, for example “Suppress warnings in tests and user code,” removing branch prefixes and redundant tokens.
Description Check ⚠️ Warning The description includes all template sections but still uses a placeholder for the related issue number and leaves both testing checkboxes unchecked, so it lacks concrete issue linkage and confirmation that the changes have been tested and existing tests pass. Replace “#(issue number)” with an actual issue reference if applicable, and update the Testing section to confirm that you have tested the changes and that existing tests still pass.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

… `pyproject.toml` to suppress runtime noise effectively.
…pyproject.toml` for improved runtime consistency and reduced noise.
@FBumann
Copy link
Member Author

FBumann commented Sep 30, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
pyproject.toml (1)

187-207: Remove redundant join-default warning filter

The explicit use of join='outer' in flixopt/results.py (line 668) prevents the FutureWarning about the join default changing, so you can drop the filter
ignore:default value for join will change from join='outer' to join='exact':FutureWarning:linopy
All other warning filters are intentional and can remain.

flixopt/__init__.py (1)

42-70: Suppressing runtime warnings is reasonable; refine TSAM integration

  • flixopt/init.py:53—replace the TODO by configuring AggregationParameters (time_series_for_low_peaks and/or time_series_for_high_peaks) or passing TSAM’s addPeakMin/addPeakMax options to preserve extremes and eliminate the “minimal value exceeds” warning.
  • Continue suppressing the linopy join FutureWarning—flixopt doesn’t invoke xarray’s join directly, so no change is needed here.
flixopt/plotting.py (1)

473-487: Consider simplifying the test environment detection.

The backend and test environment detection logic is sound, but the implementation can be streamlined:

  1. The imports of os and matplotlib at lines 474-476 are redundant since both are already imported at the module level (lines 30, 34).
  2. The interactive backend check could be more maintainable by using a set or tuple for the non-interactive backends.

Apply this diff to remove redundant imports and improve readability:

         if show:
-            # Only show if using interactive backend and not in test environment
-            import os
-
-            import matplotlib
-
             backend = matplotlib.get_backend().lower()
-            is_interactive = backend not in ['agg', 'pdf', 'ps', 'svg', 'template']
+            NON_INTERACTIVE_BACKENDS = {'agg', 'pdf', 'ps', 'svg', 'template'}
+            is_interactive = backend not in NON_INTERACTIVE_BACKENDS
             is_test_env = 'PYTEST_CURRENT_TEST' in os.environ
 
             if is_interactive and not is_test_env:
                 plt.show()
tests/conftest.py (1)

806-824: Consider moving Plotly renderer config to session fixture.

The cleanup_figures fixture correctly closes matplotlib figures after each test. However, setting pio.renderers.default = 'json' after every test is redundant.

Consider moving the Plotly renderer configuration to the set_test_environment session fixture for efficiency:

 @pytest.fixture(autouse=True)
 def cleanup_figures():
     """
     Cleanup matplotlib and plotly figures after each test.
 
     This fixture runs automatically after every test to:
     - Close all matplotlib figures to prevent memory leaks
-    - Reset plotly renderer to non-interactive mode
     """
     yield
     # Close all matplotlib figures
     import matplotlib.pyplot as plt
 
     plt.close('all')
-    # Set plotly to non-interactive renderer for tests
-    import plotly.io as pio
-
-    pio.renderers.default = 'json'

And add to set_test_environment:

 @pytest.fixture(scope='session', autouse=True)
 def set_test_environment():
     """
     Configure plotting for test environment.
 
     This fixture runs once per test session to:
     - Set matplotlib to use non-interactive 'Agg' backend
+    - Set plotly to use non-interactive 'json' renderer
     - Prevent GUI windows from opening during tests
     """
     import matplotlib
 
     matplotlib.use('Agg')  # Use non-interactive backend
+    
+    import plotly.io as pio
+    pio.renderers.default = 'json'
+    
     yield
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af57316 and d0648fb.

📒 Files selected for processing (18)
  • examples/00_Minmal/minimal_example.py (1 hunks)
  • examples/01_Simple/simple_example.py (2 hunks)
  • examples/02_Complex/complex_example.py (1 hunks)
  • examples/03_Calculation_types/example_calculation_types.py (1 hunks)
  • examples/04_Scenarios/scenario_example.py (2 hunks)
  • examples/05_Two-stage-optimization/two_stage_optimization.py (1 hunks)
  • flixopt/__init__.py (2 hunks)
  • flixopt/plotting.py (2 hunks)
  • flixopt/results.py (1 hunks)
  • pyproject.toml (1 hunks)
  • tests/conftest.py (6 hunks)
  • tests/test_bus.py (3 hunks)
  • tests/test_component.py (2 hunks)
  • tests/test_dataconverter.py (1 hunks)
  • tests/test_flow.py (22 hunks)
  • tests/test_functional.py (4 hunks)
  • tests/test_plots.py (4 hunks)
  • tests/test_scenarios.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test (3.11)
  • GitHub Check: test (3.13)
  • GitHub Check: test (3.10)
  • GitHub Check: test (3.12)
🔇 Additional comments (44)
tests/test_dataconverter.py (1)

913-913: LGTM! Frequency string updated to suppress pandas FutureWarning.

The change from "H" (uppercase) to "h" (lowercase) aligns with pandas ≥ 2.2.0, which deprecated uppercase frequency aliases in favor of lowercase. This properly addresses the PR objective to remove warnings from tests.

flixopt/results.py (1)

668-668: Approve use of join='outer'.

The join='outer' parameter correctly handles component arrays with differing coordinate sets, and existing tests already verify component‐wise sums across ‘temporal’, ‘periodic’, and ‘total’ modes without errors or warnings.

examples/00_Minmal/minimal_example.py (2)

38-42: LGTM! Clean migration to list-based inputs.

The Sink API migration correctly wraps the Flow in a list using the new inputs parameter.


46-48: LGTM! Clean migration to list-based outputs.

The Source API migration correctly wraps the Flow in a list using the new outputs parameter.

flixopt/__init__.py (1)

5-5: LGTM! Required import for warning suppression.

examples/03_Calculation_types/example_calculation_types.py (6)

110-111: LGTM! Sink API migration is correct.


115-116: LGTM! Sink API migration is correct.


120-124: LGTM! Source API migration is correct.


128-130: LGTM! Source API migration is correct.


134-135: LGTM! Sink API migration is correct.


138-147: LGTM! Source API migration is correct.

examples/05_Two-stage-optimization/two_stage_optimization.py (5)

87-89: LGTM! Sink API migration is correct.


90-93: LGTM! Source API migration is correct.


94-97: LGTM! Source API migration is correct.


106-109: LGTM! Sink API migration is correct.


110-115: LGTM! Source API migration is correct.

flixopt/plotting.py (2)

30-30: LGTM! Imports support environment detection.

The new imports (os and matplotlib) enable the backend and environment checks added to export_figure for conditional display behavior.

Also applies to: 34-34


456-467: Acknowledge internal cleanup necessity
The try/finally block clearing fig._renderer is required—there’s no public Plotly API to close or clean up Figures, and standard objects are only freed by GC (FigureWidgets can be cleared via fig.data=[] and fig.layout={}). Keep the private cleanup, but add an inline comment referencing Plotly’s renderer docs/community guidance so future maintainers understand why we’re touching this internal attribute.

tests/test_flow.py (1)

19-19: LGTM! Consistent API migration to list-based inputs.

All Sink instantiations have been correctly updated from the legacy sink=flow pattern to the new inputs=[flow] API. The changes are consistent across the entire test file.

Also applies to: 57-57, 115-115, 157-157, 220-220, 295-295, 370-370, 428-428, 467-467, 504-504, 531-531, 598-598, 658-658, 741-741, 821-821, 904-904, 986-986, 1048-1048, 1084-1084, 1185-1185, 1284-1284, 1311-1311

examples/01_Simple/simple_example.py (4)

40-40: LGTM! Effect parameter renamed for clarity.

The parameter rename from maximum_operation_per_hour to maximum_per_hour is clearer and more concise.


80-80: LGTM! Sink updated to use inputs list.

The heat demand sink correctly uses the new inputs=[...] API pattern.


86-89: LGTM! Source updated to use outputs list.

The gas source correctly uses the new outputs=[...] API pattern.


93-93: LGTM! Power sink updated to use inputs list.

The power sink (electricity export) correctly uses the new inputs=[...] API pattern.

tests/test_functional.py (2)

76-78: LGTM! Base flow system updated to new API.

Both Sink and Source correctly use the new inputs=[...] and outputs=[...] API patterns in the test fixture.


554-556: LGTM! Access pattern updated for inputs list.

The access pattern correctly changed from .sink.fixed_relative_profile to .inputs[0].fixed_relative_profile to reflect the new list-based API structure.

Also applies to: 623-623, 685-687

tests/test_component.py (1)

465-473: LGTM! Consistent API migration in component tests.

The Sink definitions correctly use the new inputs=[...] API, and the access to another component's profile via .inputs[0].fixed_relative_profile is correct.

Also applies to: 535-543

tests/test_plots.py (4)

7-10: LGTM! Non-interactive backend configured correctly.

Setting the Agg backend before importing pyplot is the correct approach for headless test environments. This prevents GUI-related warnings and ensures tests can run in CI environments without display servers.


18-21: LGTM! Plotly renderer configuration prevents socket warnings.

Using the 'json' renderer for Plotly in tests is an appropriate choice to avoid ResourceWarnings from open browser connections. This aligns with the PR objective of eliminating warnings in tests.


29-35: LGTM! Proper resource cleanup in tearDown.

The tearDown method correctly closes all matplotlib figures and forces garbage collection to prevent resource leaks. This is essential for avoiding ResourceWarnings in test suites.


70-74: LGTM! Consistent pattern: capture Plotly output, save and close matplotlib figures.

The pattern of capturing the Plotly figure return value (line 71) and explicitly closing matplotlib figures (line 74) after saving prevents resource warnings. This is consistently applied throughout the test methods.

tests/test_bus.py (1)

15-16: LGTM! API migration to list-based inputs/outputs.

The migration from Sink(sink=Flow(...)) to Sink(inputs=[Flow(...)]) and Source(source=Flow(...)) to Source(outputs=[Flow(...)]) correctly reflects the new container-based API. The test assertions (lines 20, 25) correctly reference the flow names, confirming the migration is complete.

examples/02_Complex/complex_example.py (3)

150-157: LGTM! Example updated to new Sink API.

The heat demand sink correctly migrates to the list-based inputs parameter. The Flow configuration remains unchanged, ensuring the example continues to demonstrate the same functionality with the updated API.


163-170: LGTM! Example updated to new Source API.

The gas source correctly migrates to the list-based outputs parameter. The Flow definition with effects_per_flow_hour remains properly configured.


176-182: LGTM! Feed-in sink updated to new API.

The electricity feed-in sink correctly uses the list-based inputs parameter with the negative price array for feed-in tariffs.

examples/04_Scenarios/scenario_example.py (4)

46-46: LGTM! Effect parameter renamed for clarity.

The parameter rename from maximum_operation_per_hour to maximum_per_hour improves API consistency and clarity. This change is consistent with the PR's refactoring objectives.


93-93: LGTM! Scenario example updated to new Sink API.

The heat sink correctly migrates to the list-based inputs parameter with the scenario-dependent demand profile DataFrame.


99-101: LGTM! Gas source updated to new API.

The gas source correctly uses the list-based outputs parameter while maintaining the effects configuration for costs and CO2.


106-106: LGTM! Power export sink updated to new API.

The electricity feed-in sink correctly uses the list-based inputs parameter with the period-dependent price array.

tests/test_scenarios.py (1)

133-137: LGTM! Test fixture updated to new Sink/Source API.

The flow_system_complex_scenarios fixture correctly migrates all Sink and Source instantiations to use the list-based inputs and outputs parameters. The Flow configurations remain unchanged, ensuring test scenarios continue to validate the same functionality.

tests/conftest.py (5)

354-354: LGTM: Sink API migration.

The Sink constructors correctly use the new inputs=[...] API, replacing the deprecated sink= parameter pattern.

Also applies to: 361-361, 368-368


379-379: LGTM: Source API migration.

The Source constructors and attribute access correctly use the new outputs=[...] API. Line 379 appropriately changes from source.source to source.outputs[0] to access the flow.

Also applies to: 386-386


573-590: LGTM: Consistent API migration in flow_system_long.

All Sink and Source constructors in the flow_system_long fixture correctly use the new inputs=[...] and outputs=[...] API patterns.


826-838: LGTM: Matplotlib backend configuration.

The set_test_environment fixture correctly sets the non-interactive 'Agg' backend at session scope, ensuring it's applied before any pyplot imports. This prevents GUI windows during test execution.


408-408: Approve maximum_per_hour rename; consistency verified.

No remaining references to the old parameter name were found, and maximum_per_hour is used uniformly across the codebase.

Comment on lines 98 to 105
fx.Source(
'Einspeisung',
source=fx.Flow(
'P_el', bus='Strom', size=1000, effects_per_flow_hour={'costs': electricity_price + 0.5, 'CO2': 0.3}
),
outputs=[
fx.Flow(
'P_el', bus='Strom', size=1000, effects_per_flow_hour={'costs': electricity_price + 0.5, 'CO2': 0.3}
)
],
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify 'Einspeisung' (feed-in) semantics are correct.

The API migration syntax is correct. However, verify that modeling 'Einspeisung' (typically meaning electricity feed-in/selling to grid) as a Source with positive effects_per_flow_hour is semantically correct for your system.

In energy system modeling:

  • Sink typically represents consuming from the system (e.g., selling to grid = demand on system)
  • Source typically represents supplying to the system (e.g., buying from grid = supply to system)

The positive price (electricity_price + 0.5) suggests this represents a cost, which would align with buying from the grid (Source). However, the German term "Einspeisung" usually refers to selling/feed-in.


🏁 Script executed:

#!/bin/bash
# Description: Check usage pattern of Einspeisung and other electricity sources/sinks
# Expected: Clarify whether Einspeisung represents buying or selling electricity

# Find all electricity-related Sources and Sinks with their effects
rg -n --type=py -B2 -A5 "(Source|Sink)\(" examples/ | rg -A5 -B2 "Strom|Einspeisung"

Length of output: 6185


… for consistency in handling non-interactive backends.
…e unused Plotly configuration, and improve figure cleanup in tests.
…n-tests' into feature/v3/feature/no-warnings-in-tests

# Conflicts:
#	flixopt/plotting.py
@FBumann FBumann added this to the v3.0.0 milestone Oct 8, 2025
@FBumann FBumann merged commit 5c50c1b into feature/v3/main Oct 8, 2025
12 checks passed
@FBumann FBumann deleted the feature/v3/feature/no-warnings-in-tests branch October 8, 2025 15:24
FBumann added a commit that referenced this pull request Oct 13, 2025
* V3.0.0/main (#284)

* Bugfix plot_node_balance_pie()

* Scenarios/fixes (#252)

* BUGFIX missing conversion to TimeSeries

* BUGFIX missing conversion to TimeSeries

* Bugfix node_balance with flow_hours: Negate correctly

* Scenarios/filter (#253)

* Add containts and startswith to filter_solution

* Scenarios/drop suffix (#251)

Drop suffixes in plots and add the option to drop suffixes to sanitize_dataset()

* Scenarios/bar plot (#254)

* Add stacked bar style to plotting methods
* Rename mode to style  (line, bar, area, ...)

* Bugfix plotting

* Fix example_calculation_types.py

* Scenarios/fixes (#255)

* Fix indexing issue with only one scenario

* Bugfix Cooling Tower

* Add option for balanced Storage Flows (equalize size of charging and discharging)

* Add option for balanced Storage Flows

* Change error to warning (non-fixed size with piecewise conversion AND fixed_flow_rate with OnOff)

* Bugfix in DataConverter

* BUGFIX: Typo (total_max/total_min in Effect)

* Bugfix in node_balance() (negating did not work when using flow_hours mode

* Scenarios/effects (#256)

* Add methods to track effect shares of components and Flows

* Add option to include flows when retrieving effects

* Add properties and methods to store effect results in a dataset

* Reorder methods

* Rename and improve docs

* Bugfix test class name

* Fix the Network algorithm to calculate the sum of parallel paths, and be independent on nr of nodes and complexity of the network

* Add tests for the newtork chaining and the results of effect shares

* Add methods to check for circular references

* Add test to check for circular references

* Update cycle checker to return the found cycles

* Add checks in results to confirm effects are computed correctly

* BUGFIX: Remove +1 from prior testing

* Add option for grouped bars to plotting.with_plotly() and make lines of stacked bar plots invisible

* Reconstruct FlowSystem in CalculationResults on demand. DEPRECATION in CalculationResults

* ruff check

* Bugfix: save flow_system data, not the flow_system

* Update tests

* Scenarios/datasets results (#257)

* Use dataarray instead of dataset

* Change effects dataset to dataarray and use nan when no share was found

* Add method for flow_rates dataset

* Add methods to get flow_rates and flow_hours as datasets

* Rename the dataarrays to the flow

* Preserve index order

* Improve filter_edges_dataset()

* Simplify _create_flow_rates_dataarray()

* Add dataset for sizes of Flows

* Extend results structure to contain flows AND start/end infos

* Add FlowResults Object

* BUGFIX:Typo in _ElementResults.constraints

* Add flows to results of Nodes

* Simplify dataarray creation and improve FlowResults

* Add nice docstrings

* Improve filtering of flow results

* Improve filtering of flow results. Add attribute of component

* Add big dataarray with all variables but indexed

* Revert "Add big dataarray with all variables but indexed"

This reverts commit 08cd8a1.

* Improve filtering method for coords filter and add error handling for restoring the flow system

* Remove unnecessary methods in results .from_json()

* Ensure consistent coord ordering in Effects dataarray

* Rename get_effects_per_component()

* Make effects_per_component() a dataset instead of a dataarray

* Improve backwards compatability

* ruff check

* ruff check

* Scenarios/deprecation (#258)

* Deprecate .active_timesteps

* Improve logger warning

* Starting release notes

* Bugfix in plausibility_check: Index 0

* Set bargap to 0 in stacked bars

* Ensure the size is always properly indexed in results.

* ruff check

* BUGFIX in extract data, that causes coords in linopy to be incorrect (scalar xarray.DataArrays)

* Improve yaml formatting for model documentation (#259)

* Make the size/capacity a TimeSeries (#260)

* Scenarios/plot network (#262)

* Catch bug in plot_network with 2D arrays

* Add plot_network() to test_io.py

* Update deploy-docs.yaml:
Run on Release publishing instead of creation
and
only run for stable releases (vx.y.z)

* Bugfix DataConverter and add tests (#263)

* Fix doc deployment to not publish on non stable releases

* Remove unused code

* Remove legend placing for better auto placing in plotly

* Fix plotly dependency

* Improve validation when adding new effects

* Moved release notes to CHANGELOG.md

* Try to add to_dataset to Elements

* Remove TimeSeries

* Remove TimeSeries

* Rename conversion method to pattern: to_...

* Move methods to FlowSystem

* Drop nan values across time dimension if present

* Allow lists of values to create DataArray

* Update resolving of FlowSystem

* Simplify TimeSeriesData

* Move TImeSeriesData to Structure and simplyfy to inherrit from xarray.DataArray

* Adjust IO

* Move TimeSeriesData back to core.py and fix Conversion

* Adjust IO to account for attrs of DataArrays in a Dataset

* Rename transforming and connection methods in FlowSystem

* Compacted IO methods

* Remove infos()

* remove from_dict() and to_dict()

* Update __str__ of Interface

* Improve str and repr

* Improve str and repr

* Add docstring

* Unify IO stuff in Interface class

* Improve test tu utilize __eq__ method

* Make Interface class more robust and improve exceptions

* Add option to copy Interfaces (And the FlowSystem)

* Make a copy of a FLowSytsem that gets reused in a second Calculation

* Remove test_timeseries.py

* Reorganizing Datatypes

* Remove TImeSeries and TimeSeriesCollection entirely

* Remove old method

* Add option to get structure with stats of dataarrays

* Change __str__ method

* Remove old methods

* remove old imports

* Add isel, sel and resample methods to FlowSystem

* Remove need for timeseries with extra timestep

* Simplify IO of FLowSystem

* Remove parameter timesteps from IO

* Improve Exceptions and Docstrings

* Improve isel sel and resample methods

* Change test

* Bugfix

* Improve

* Improve

* Add test for Storage Bounds

* Add test for Storage Bounds

* CHANGELOG.md

* ruff check

* Improve types

* CHANGELOG.md

* Bugfix in Storage

* Revert changes in example_calculation_types.py

* Revert changes in simple_example.py

* Add convenient access to Elements in FlowSystem

* Get Aggregated Calculation Working

* Segmented running with wrong results

* Use new persistent FLowSystem to create Calculations upfront

* Improve SegmentedCalcualtion

* Improve SegmentedCalcualtion

* Fix SegmentedResults IO

* ruff check

* Update example

* Updated logger essages to use .label_full instead of .label

* Re-add parameters. Use deprecation warning instead

* Update changelog

* Improve warning message

* Merge

* Merge

* Fit scenario weights to model coords when transforming

* Merge

* Removing logic between minimum, maximum and fixed size from InvestParameters

* Remove selected_timesteps

* Improve TypeHints

* New property on InvestParameters for min/max/fixed size

* Move logic for InvestParameters in Transmission to from Model to Interface

* Make transformation of data more hierarchical (Flows after Components)

* Add scenario validation

* Change Transmission to have a "balanced" attribute. Change Tests accordingly

* Improve index validations

* rename method in tests

* Update DataConverter

* Add DataFrame Support back

* Add copy() to DataConverter

* Update fit_to_model_coords to take a list of coords

* Make the DataConverter more universal by accepting a list of coords/dims

* Update DataConverter for n-d arrays

* Update DataConverter for n-d arrays

* Add extra tests for 3-dims

* Add FLowSystemDimension Type

* Revert some logic about the fit_to_model coords

* Adjust FLowSystem IO for scenarios

* BUGFIX: Raise Exception instead of logging

* Change usage of TimeSeriesData

* Adjust logic to handle non scalars

* Adjust logic to _resolve_dataarray_reference into separate method

* Update IO of FlowSystem

* Improve get_coords()

* Adjust FlowSystem init for correct IO

* Add scenario to sel and isel methods, and dont normalize scenario weights

* Improve scenario_weights_handling

* Add warning for not scaled weights

* Update test_scenarios.py

* Improve util method

* Add objective to solution dataset.

* Update handling of scenario_weights update tests

* Ruff check. Fix type hints

* Fix type hints and improve None handling

* Fix coords in AggregatedCalculation

* Improve Error Messages of DataConversion

* Allow multi dim data conversion and broadcasting by length

* Improve DataConverter to handle multi-dim arrays

* Rename methods and remove unused code

* Improve DataConverter by better splitting handling per datatype. Series only matches index (for one dim). Numpy matches shape

* Add test for error handling

* Update scenario example

* Fix Handling of TimeSeriesData

* Improve DataConverter

* Fix resampling of the FlowSystem

* Improve Warning Message

* Add example that leverages resampling

* Add example that leverages resampling adn fixing of Investments

* Add flag to Calculation if its modeled

* Make flag for connected_and_transformed FLowSystem public

* Make Calcualtion Methods return themselfes to make them chainable

* Improve example

* Improve Unreleased CHANGELOG.md

* Add year coord to FlowSystem

* Improve dimension handling

* Change plotting to use an indexer instead

* Change plotting to use an indexer instead

* Use tuples to set dimensions in Models

* Bugfix in validation logic and test

* Improve Errors

* Improve weights handling and rescaling if None

* Fix typehint

* Update Broadcasting in Storage Bounds and improve type hints

* Make .get_model_coords() return an actual xr.Coordinates Object

* Improve get_coords()

* Rename SystemModel to FlowSystemModel

* First steps

* Improve Feature Patterns

* Improve acess to variables via short names

* Improve

* Add naming options to big_m_binary_bounds()

* Fix and improve FLowModeling with Investment

* Improve

* Tyring to improve the Methods for bounding variables in different scenarios

* Improve BoundingPatterns

* Improve BoundingPatterns

* Improve BoundingPatterns

* Fix duration Modeling

* Fix On + Size

* Fix InvestmentModel

* Fix Models

* Update constraint names in test

* Fix OnOffModel for multiple Flows

* Update constraint names in tests

* Simplify

* Improve handling of vars/cons and models

* Revising the basic structure of a class Model

* Revising the basic structure of a class Model

* Simplify and focus more on own Model class

* Update tests

* Improve state computation in ModelingUtilities

* Improve handling of previous flowrates

* Imropove repr and submodel acess

* Update access pattern in tests

* Fix PiecewiseEffects and StorageModel

* Fix StorageModel and Remove PreventSimultaniousUseModel

* Fix Aggregation and SegmentedCalculation

* Update tests

* Loosen precision in tests

* Update test_on_hours_computation.py and some types

* Rename class Model to Submodel

* rename sub_model to submodel everywhere

* rename self.model to self.submodel everywhere

* Rename .model with .submodel if its only a submodel

* Rename .sub_models with .submodels

* Improve repr

* Improve repr

* Include def  do_modeling() into __init__() of models

* Make properties private

* Improve Inheritance of Models

* V3.0.0/plotting (#285)

* Use indexer to reliably plot solutions with and wihtout scenarios/years

* ruff check

* Improve typehints

* Update CHANGELOG.md

* Bugfix from renaming to .submodel

* Bugfix from renaming to .submodel

* Improve indexer in results plotting

* rename register_submodel() to .add_submodels() adn add SUbmodels collection class

* Add nice repr to FlowSystemModel and Submodel

* Bugfix .variables and .constraints

* Add type checks to modeling.py

* Improve assertion in tests

* Improve docstrings and register ElementModels directly in FlowSystemModel

* Improve __repr__()

* ruff check

* Use new method to compare sets in tests

* ruff check

* Update Contribute.md, some dependencies and add pre-commit

* Pre commit hook

* Run Pre-Commit Hook for the first time

* Fix link in README.md

* Update Effect name in tests to be 'costs' instead of 'Costs' Everywhere
Simplify testing by creating a Element Library

* Improve some of the modeling and coord handling

* Add tests with years and scenarios

* Update tests to run with multiple coords

* Fix Effects dataset computation in case of empty effects

* Update Test for multiple dims
Fix Dim order in scaled_bounds_with_state
Bugfix logic in .use_switch_on

* Fix test with multiple dims

* Fix test with multiple dims

* New test

* New test for previous flow_rates

* V3.0.0/main fit to model coords improve (#295)

* Change fit_to_model_coords to work with a Collection of dims

* Improve fit_to_model_coords

* Improve CHANGELOG.md

* Update pyproject.toml

* new ruff check

* Merge branch 'main' into dev

# Conflicts:
#	CHANGELOG.md
#	flixopt/network_app.py

* Update CHANGELOG.md

* Fix Error message

* Revert changes

* Feature/v3/update (#352)

* Remove need for timeseries with extra timestep

* Simplify IO of FLowSystem

* Remove parameter timesteps from IO

* Improve Exceptions and Docstrings

* Improve isel sel and resample methods

* Change test

* Bugfix

* Improve

* Improve

* Add test for Storage Bounds

* Add test for Storage Bounds

* CHANGELOG.md

* ruff check

* Improve types

* CHANGELOG.md

* Bugfix in Storage

* Revert changes in example_calculation_types.py

* Revert changes in simple_example.py

* Add convenient access to Elements in FlowSystem

* Get Aggregated Calculation Working

* Segmented running with wrong results

* Use new persistent FLowSystem to create Calculations upfront

* Improve SegmentedCalcualtion

* Improve SegmentedCalcualtion

* Fix SegmentedResults IO

* ruff check

* Update example

* Updated logger essages to use .label_full instead of .label

* Re-add parameters. Use deprecation warning instead

* Update changelog

* Improve warning message

* Merge

* Merge

* Fit scenario weights to model coords when transforming

* Merge

* Removing logic between minimum, maximum and fixed size from InvestParameters

* Remove selected_timesteps

* Improve TypeHints

* New property on InvestParameters for min/max/fixed size

* Move logic for InvestParameters in Transmission to from Model to Interface

* Make transformation of data more hierarchical (Flows after Components)

* Add scenario validation

* Change Transmission to have a "balanced" attribute. Change Tests accordingly

* Improve index validations

* rename method in tests

* Update DataConverter

* Add DataFrame Support back

* Add copy() to DataConverter

* Update fit_to_model_coords to take a list of coords

* Make the DataConverter more universal by accepting a list of coords/dims

* Update DataConverter for n-d arrays

* Update DataConverter for n-d arrays

* Add extra tests for 3-dims

* Add FLowSystemDimension Type

* Revert some logic about the fit_to_model coords

* Adjust FLowSystem IO for scenarios

* BUGFIX: Raise Exception instead of logging

* Change usage of TimeSeriesData

* Adjust logic to handle non scalars

* Adjust logic to _resolve_dataarray_reference into separate method

* Update IO of FlowSystem

* Improve get_coords()

* Adjust FlowSystem init for correct IO

* Add scenario to sel and isel methods, and dont normalize scenario weights

* Improve scenario_weights_handling

* Add warning for not scaled weights

* Update test_scenarios.py

* Improve util method

* Add objective to solution dataset.

* Update handling of scenario_weights update tests

* Ruff check. Fix type hints

* Fix type hints and improve None handling

* Fix coords in AggregatedCalculation

* Improve Error Messages of DataConversion

* Allow multi dim data conversion and broadcasting by length

* Improve DataConverter to handle multi-dim arrays

* Rename methods and remove unused code

* Improve DataConverter by better splitting handling per datatype. Series only matches index (for one dim). Numpy matches shape

* Add test for error handling

* Update scenario example

* Fix Handling of TimeSeriesData

* Improve DataConverter

* Fix resampling of the FlowSystem

* Improve Warning Message

* Add example that leverages resampling

* Add example that leverages resampling adn fixing of Investments

* Add flag to Calculation if its modeled

* Make flag for connected_and_transformed FLowSystem public

* Make Calcualtion Methods return themselfes to make them chainable

* Improve example

* Improve Unreleased CHANGELOG.md

* Add year coord to FlowSystem

* Improve dimension handling

* Change plotting to use an indexer instead

* Change plotting to use an indexer instead

* Use tuples to set dimensions in Models

* Bugfix in validation logic and test

* Improve Errors

* Improve weights handling and rescaling if None

* Fix typehint

* Update Broadcasting in Storage Bounds and improve type hints

* Make .get_model_coords() return an actual xr.Coordinates Object

* Improve get_coords()

* Rename SystemModel to FlowSystemModel

* First steps

* Improve Feature Patterns

* Improve acess to variables via short names

* Improve

* Add naming options to big_m_binary_bounds()

* Fix and improve FLowModeling with Investment

* Improve

* Tyring to improve the Methods for bounding variables in different scenarios

* Improve BoundingPatterns

* Improve BoundingPatterns

* Improve BoundingPatterns

* Fix duration Modeling

* Fix On + Size

* Fix InvestmentModel

* Fix Models

* Update constraint names in test

* Fix OnOffModel for multiple Flows

* Update constraint names in tests

* Simplify

* Improve handling of vars/cons and models

* Revising the basic structure of a class Model

* Revising the basic structure of a class Model

* Simplify and focus more on own Model class

* Update tests

* Improve state computation in ModelingUtilities

* Improve handling of previous flowrates

* Imropove repr and submodel acess

* Update access pattern in tests

* Fix PiecewiseEffects and StorageModel

* Fix StorageModel and Remove PreventSimultaniousUseModel

* Fix Aggregation and SegmentedCalculation

* Update tests

* Loosen precision in tests

* Update test_on_hours_computation.py and some types

* Rename class Model to Submodel

* rename sub_model to submodel everywhere

* rename self.model to self.submodel everywhere

* Rename .model with .submodel if its only a submodel

* Rename .sub_models with .submodels

* Improve repr

* Improve repr

* Include def  do_modeling() into __init__() of models

* Make properties private

* Improve Inheritance of Models

* V3.0.0/plotting (#285)

* Use indexer to reliably plot solutions with and wihtout scenarios/years

* ruff check

* Improve typehints

* Update CHANGELOG.md

* Bugfix from renaming to .submodel

* Bugfix from renaming to .submodel

* Improve indexer in results plotting

* rename register_submodel() to .add_submodels() adn add SUbmodels collection class

* Add nice repr to FlowSystemModel and Submodel

* Bugfix .variables and .constraints

* Add type checks to modeling.py

* Improve assertion in tests

* Improve docstrings and register ElementModels directly in FlowSystemModel

* Improve __repr__()

* ruff check

* Use new method to compare sets in tests

* ruff check

* Update Contribute.md, some dependencies and add pre-commit

* Pre commit hook

* Run Pre-Commit Hook for the first time

* Fix link in README.md

* Update Effect name in tests to be 'costs' instead of 'Costs' Everywhere
Simplify testing by creating a Element Library

* Improve some of the modeling and coord handling

* Add tests with years and scenarios

* Update tests to run with multiple coords

* Fix Effects dataset computation in case of empty effects

* Update Test for multiple dims
Fix Dim order in scaled_bounds_with_state
Bugfix logic in .use_switch_on

* Fix test with multiple dims

* Fix test with multiple dims

* New test

* New test for previous flow_rates

* Add Model for YearAwareInvestments

* Add FlowSystem.years_per_year attribute and "years_of_last_year" parameter to FlowSystem()

* Add YearAwareInvestmentModel

* Add new Interface

* Improve YearAwareInvestmentModel

* Rename and improve

* Move piecewise_effects

* COmbine TImingInvestment into a single interface

* Add model tests for investment

* Add size_changes variables

* Add size_changes variables

* Improve InvestmentModel

* Improve InvestmentModel

* Rename parameters

* remove old code

* Add a duration_in_years to the InvestTimingParameters

* Improve handling of fixed_duration

* Improve validation and make Investment/divestment optional by default

* Rename some vars and improve previous handling

* Add validation for previous size

* Change fit_to_model_coords to work with a Collection of dims

* Improve fit_to_model_coords

* Improve test

* Update transform_data()

* Add new "year of investment" coord to FlowSystem

* Add 'year_of_investment' dimension to FlowSystem

* Improve InvestmentTiming

* Improve InvestmentTiming

* Add specific_effect back

* add effects_by_investment_year back

* Add year_of_investment to FLowSystem.sel()

* Improve Interface

* Handle selection of years properly again

* Temp

* Make ModelingPrimitives.consecutive_duration_tracking() dim-agnostic

* Use new lifetime variable and constraining methods

* Improve Plausibility check

* Improve InvestmentTImingParameters

* Improve weights

* Adjust test

* Remove old classes

* V3.0.0/main fit to model coords improve (#295)

* Change fit_to_model_coords to work with a Collection of dims

* Improve fit_to_model_coords

* ruff format

* Revert changes

* Update type hints

* Revert changes introduced by new Multiperiod Invest parameters

* Improve CHnagelog and docstring of Storage

* Improve Changelog

* Improve InvestmentModel

* Improve InvestmentModel to have 2 cases. One without years and one with

* Improve InvestmentModel to have 2 cases. One without years and one with years. Further, remove investment_scenarios parameter

* Revert some changes regarding Investments

* Typo

* Remove Investment test file (only local testing)

* More reverted changes

* More reverted changes

* Add years_of_last_year to docstring

* Revert change from Investment

* Revert change from Investment

* Remove old todos.txt file

* Fix typos in CHANGELOG.md

* Improve usage of name_prefix to intelligently join with the label

* Ensure IO of years_of_last_year

* Typo

* Typo

* activat tests on pulls to feature/v3

* activat tests on pulls to feature/v3/main

* Feature/v3/low-impact-improvements (#355)

* Fix typo

* Prefer robust scalar extraction for timestep sizes in aggregation

* Improve docs and error messages

* Update examples

* Use validated timesteps

* Remove unnessesary import

* Use FlowSystem.model instead of FlowSystem.submodel

* Fix Error message

* Improve CHANGELOG.md

* Use self.standard_effect instead of provate self._standard_effect and update docstring

* in calculate_all_conversion_paths, use `collections.deque` for efficiency on large graphs

* Make aggregation_parameters.hours_per_period more robust by using rounding

* Improve import and typos

* Improve docstring

* Use validated timesteps

* Improve error

* Improve warning

* Improve type hint

* Improve CHANGELOG.md: typos, wording and duplicate entries

* Improve CI (#357)

Separate example testing from other tests by marking them. By default, purest doesn't run the example tests

* Feature/v3/data converter (#356)

* Update DataConverter

* Update tests of error messages

* Update tests of error messages

* Update Dataconverter to allow bool values

* fix tests

* Improve code order of prefix in transform_data()

* Move pytest-xdist to dev deps

* Fix transform_data to not pass a prefix to flow

* Move to unreleased

Add emojis to CHANGELOG.md

* Feature/v3/feature/308 rename effect domains (#365)

* Rename effect domains

* Rename effect domains

* Ensure backwards compatability

* Improve

* Improve

* Bugfix IO with deprectaed params

* Add guards for extra kwargs

* Add guards for extra kwargs

* centralize logic for deprectaed params

* Move handlign from centralized back to classes in a dedicated method

* Improce property handling

* Move handling to Interface class

* Getting lost

* Revert "Getting lost"

This reverts commit 3c0db76.

* Revert "Move handling to Interface class"

This reverts commit 09bdeec.

* Revert "Improce property handling"

This reverts commit 5fe2c64.

* Revert "Move handlign from centralized back to classes in a dedicated method"

This reverts commit 9f4c1f6.

* Revert "centralize logic for deprectaed params"

This reverts commit 4a82574.

* Add "" to warnings

* Revert change in examples

* Improve BackwardsCompatibleDataset

* Add unit tests for backwards compatability

* Remove backwards compatible dataset

* Renamed maximum_temporal_per_hour to maximum_per_hour and minimum_temporal_per_hour to minimum_per_hour

* Add entires to CHANGELOG.md

* Remove backwards compatible dataset

* Remove unused imports

* Move to unreleased

* Catch up on missed renamings from merge

* Catch up on missed renamings from merge

* Typo

* Typo

* Several small improvements or potential future bug preventions

* Feature/v3/feature/305 rename specific share to other effects  to specific share from effect (#366)

* Step 1

* Bugfix

* Make fit_effects_to_model_coords() more flexible

* Fix dims

* Update conftest.py

* Typos

* Improve Effect examples

* Add extra validation for Effect Shares

* Feature/v3/feature/367 rename year dimension to period (#370)

* The framework now uses "period" instead of "year" as the dimension name and "periodic" instead of "nontemporal" for the effect domain

* Update CHANGELOG.md

* Remove periods_of_last_period parameter and adjust weights calculation

* Bugfix

* Bugfix

* Switch from "as_time_series": bool to "dims": [time, period, scenario] arguments

* Improve normalization of weights

* Update tests

* Typos in docs

* Improve docstrings

* Improve docstrings

* Update CHANGELOG.md

* Improved tests: added extra time+scenarios combination

* Add rename and improve CHANGELOG.md

* Made CHANGELOG.md more concise

* Simplify array summation and improve `np.isclose` usage in `modeling` and `aggregation` modules.

* Make storage and load profile methods flexible by introducing `timesteps_length` parameter; update test configurations accordingly.

* Refine error messages in `ModelingPrimitives` to correctly reference updated method names.

* Enhance test fixtures by adding `ids` for parameterized tests, improve input flexibility with dynamic timestep length, and refine error message sorting logic.

* Refactor variable selection and constraint logic in `aggregation.py` for handling more than only a time dimension

* Adjust constraint in `aggregation.py` to enforce stricter summation limit (1 instead of 1.1)

* Reverse transition constraint inequality for consistency in `modeling.py`.

* Update dependency to use h5netcdf instead of netcdf4

* Feature/v3/several improvements (#372)

* Update deprecated properties to use new aggregation attributes in `core.py`.

* Refactor `drop_constant_arrays` in `core.py` to improve clarity, add type hints, and enhance logging for dropped variables.

* Bugfix example_calculation_types.py and two_stage_optimization.py

* Use time selection more explicitly

* Refactor plausibility checks in `components.py` to handle string-based `initial_charge_state` more robustly and simplify capacity bounds retrieval using `InvestParameters`.

* Refactor `create_transmission_equation` in `components.py` to handle `relative_losses` gracefully when unset and simplify the constraint definition.

* Update pytest `addopts` formatting in `pyproject.toml` to work with both unix and windows

* Refine null value handling when resolving dataarrays` to check for 'time' dimension before dropping all-null values.

* Refactor flow system restoration to improve exception handling and ensure logger state resets.

* Refactor imports in `elements.py` to remove unused `ModelingPrimitives` from `features` and include it from `modeling` instead.

* Refactor `count_consecutive_states` in `modeling.py` to enhance documentation, improve edge case handling, and simplify array processing.

* Refactor `drop_constant_arrays` to handle NaN cases with `skipna` and sort dropped variables for better logging; streamline logger state restoration in `results.py`.

* Temp

* Improve NAN handling in count_consecutive_states()

* Refactor plausibility checks in `components.py` to prevent initial capacity from constraining investment decisions and improve error messaging.

* Feature/v3/feature/no warnings in tests (#373)

* Refactor examples to not use deprectaed patterns

* Refactor tests to replace deprecated `sink`/`source` properties with `inputs`/`outputs` in component definitions.

* Use 'h' instead of deprectaed 'H' in coordinate freq in tests; adjust `xr.concat` in `results.py` to use `join='outer'` for safer merging.

* Refactor plot tests to use non-interactive backends, save plots as files, and close figures to prevent memory leaks.

* Refactor plot tests to use non-interactive Plotly renderer (`json`), add cleanup with `tearDown`, and ensure compatibility with non-interactive Matplotlib backends.

* Configure pytest filters to treat most warnings as errors, ignore specific third-party warnings, and display all warnings from internal code.

* Revert "Configure pytest filters to treat most warnings as errors, ignore specific third-party warnings, and display all warnings from internal code."

This reverts commit 0928b26.

* Refactor plotting logic to prevent memory leaks, improve backend handling, and add test fixtures for cleanup and non-interactive configurations.

* Update pytest filterwarnings to treat most warnings as errors, ignore specific third-party warnings, and display all internal warnings.

* Suppress specific third-party warnings in `__init__.py` to reduce noise for end users.

* Update pytest warning filters: treat internal warnings as errors, revert treating most third-party warnings as errors.

* Suppress additional third-party warnings in `__init__.py` to minimize runtime noise.

* Update pytest warning filters: suppress specific third-party warnings and add detailed context for `__init__.py` filters.

* Sync and consolidate third-party warning filters in `__init__.py` and `pyproject.toml` to suppress runtime noise effectively.

* Expand and clarify third-party warning filters in `__init__.py` and `pyproject.toml` for improved runtime consistency and reduced noise.

* Update deprecated code in tests

* Refactor backend checks in `plotting.py` and streamline test fixtures for consistency in handling non-interactive backends.

* Refactor plotting logic to handle test environments explicitly, remove unused Plotly configuration, and improve figure cleanup in tests.

* Add entry to CHANGELOG.md

* Typos in example

* Reogranize Docs (#377)

* Improve effects parameter naming in InvestParameters (#389)

* FIrst Try

* Improve deprecation

* Update usage of deprectated parameters

* Improve None handling

* Add extra kwargs handling

* Improve deprecation

* Use custom method for kwargs

* Add deprecation method

* Apply deprecation method to other classes

* Apply to effects.py as well

* Update usage of deprectaed parameters

* Update CHANGELOG.md

* Update Docs

* Feature/v3/feature/test examples dependent (#390)

* Update example test to run dependent examples in order

* Update example test to run dependent examples in order

* Update CHANGELOG.md

* Improve test directory handling

* Improve test directory handling

* Typo

* Feature/v3/feature/rename investparameter optional to mandatory (#392)

* Change .optional to .mandatory

* Change .optional to .mandatory

* Remove not needed properties

* Improve deprectation warnings

* Improve deprectation of "optional"

* Remove all usages of old "optional" parameter in code

* Typo

* Imrpove readability

* Adjust some logging levels

* Add scenarios and periods to repr and str of FlowSystem

* Feature/v3/feature/386 use better default logging colors and dont log to file by default (#394)

* Fix `charge_state` Constraint in `Storage` leading to incorrect losses in discharge and therefore incorrect charge states and discharge values (#347)

* Fix equation in Storage

* Fix test for equation in Storage

* Update CHANGELOG.md

* Improve Changelog Message

* Fix CHANGELOG.md

* Simplify changes from next release

* Update CHANGELOG.md

* Fix CHANGELOG.md

* chore(deps): update dependency mkdocs-material to v9.6.20 (#369)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Improve renovate.json to automerge ruff despite 0.x version

* chore(deps): update dependency tsam to v2.3.9 (#379)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency ruff to v0.13.2 (#378)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Feature/Improve Configuration options and handling (#385)

* Refactor configuration management: remove dataclass-based schema and simplify CONFIG structure.

* Refactor configuration loading: switch from `os` to `pathlib`, streamline YAML loading logic.

* Refactor logging setup: split handler creation into dedicated functions, simplify configuration logic.

* Improve logging configurability and safety

- Add support for `RotatingFileHandler` to prevent large log files.
- Introduce `console` flag for optional console logging.
- Default to `NullHandler` when no handlers are configured for better library behavior.

* Temp

* Temp

* Temp

* Temp

* Temp

* Temp

* Refactor configuration and logging: remove unused `merge_configs` function, streamline logging setup, and encapsulate `_setup_logging` as an internal function.

* Remove unused `change_logging_level` import and export.

* Add tests for config.py

* Expand `config.py` test coverage: add tests for custom config loading, logging setup, dict roundtrip, and attribute modification.

* Expand `test_config.py` coverage: add modeling config persistence test, refine logging reset, and improve partial config load assertions.

* Expand `test_config.py` coverage: add teardown for state cleanup and reset modeling config in setup.

* Add `CONFIG.reset()` method and expand test coverage to verify default restoration

* Refactor `CONFIG` to centralize defaults in `_DEFAULTS` and ensure `reset()` aligns with them; add test to verify consistency.

* Refactor `_DEFAULTS` to use `MappingProxyType` for immutability, restructure config hierarchy, and simplify `reset()` implementation for maintainability; update tests accordingly.

* Mark `TestConfigModule` tests to run in a single worker with `@pytest.mark.xdist_group` to prevent global config interference.

* Add default log file

* Update CHANGELOG.md

* Readd change_logging_level() for backwards compatability

* Add more options to config.py

* Add a docstring to config.y

* Add a docstring to config.y

* rename parameter message_format

* Improve color config

* Improve color config

* Update CHANGELOG.md

* Improve color handling

* Improve color handling

* Remove console Logging explicityl from examples

* Make log to console the default

* Make log to console the default

* Add individual level parameters for console and file

* Add extra Handler section

* Use dedicated levels for both handlers

* Switch back to not use Handlers

* Revert "Switch back to not use Handlers"

This reverts commit 05bbccb.

* Revert "Use dedicated levels for both handlers"

This reverts commit ed0542b.

* Revert "Add extra Handler section"

This reverts commit a133cc8.

* Revert "Add individual level parameters for console and file"

This reverts commit 19f81c9.

* Fix CHANGELOG.md

* Update CHANGELOG.md

* Fix CHANGELOG.md

* Allow blank issues

* Change default logging behaviour to other colors and no file logging

* Use white for INFO

* Use terminal default for INFO

* Explicitly use stdout for StreamHandler

* Use terminal default for Logging color

* Add option for loggger name

* Update CHANGELOG.md

* Ensure custom formats are being applied

* Catch empty config files

* Update test to match new defaults

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix warnings filter

* Remove config file (#391)

* Remove config file

* Remove yaml in MANIFEST.in

* 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

* Feature/v3/feature/381 feature equalize sizes and or flow rates between scenarios (#396)

* First try

* Centralize in FlowSystem

* Add centralized handling

* Logical Bug

* Add to IO

* Add test

* Add some error handling and logging

* Rename variable

* Change parameter naming

* Remove not needed method

* Refactor to reduce duplication

* Change defaults

* Change defaults

* Change defaults

* Update docs

* Update docs

* Update docs

* Update docs

* Feature/v3/feature/Linked investments over multiple periods

* Reorganize InvestmentParameters to always create the binary investment variable

* Add new variable that indicates wether investment was taken, independent of period and allow linked periods

* Improve Handling of linked periods

* Improve Handling of linked periods

* Add examples

* Typos

* Fix: reference invested only after it exists

* Improve readbility of equation

* Update from Merge

* Improve InvestmentModel

* Improve readability

* Improve readability and reorder methods

* Improve logging

* Improve InvestmentModel

* Rename to "invested"

* Update CHANGELOG.md

* Bugfix

* Improve docstring

* Improve InvestmentModel to be more inline with the previous Version

* Improve Exceptions and add a meaningfull comment in InvestParameters

* Typo

* Feature/v3/feature/common resources in examples (#401)

* Typo

* Typos in scenario_example.py

* Improve data files in examples

* Improve data files in examples

* Handle local install more gracefully with __version__

* Remove bad example

* Increase timeout in examples

* Improve test_examples.py

* Improve example

* Fixx Error message in test

* Fix: Dependecy issue with python 3.10

* run ci on more branches if there are prs

* Minor improvements and Update to the CHANGELOG.md

* Feature/v3/feature/last minute improvements (#403)

* Typos oin CHANGELOG.md

* Add error handling in exmaple

* Surface warnings during tests (avoid hiding deprecations)

* Add missing docs file

* Imrpve Releasnotes of v2.2.0

* Improve docs

* Remove some filterwarnings from tsam

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants