Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
uv pip install --system .[dev]

- name: Run tests
run: pytest -v -p no:warnings --numprocesses=auto
run: pytest -v --numprocesses=auto

test-examples:
runs-on: ubuntu-24.04
Expand Down
12 changes: 7 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ This replaces `specific_share_to_other_effects_*` parameters and inverts the dir
- FlowSystem manipulation: `sel()`, `isel()`, `resample()`, `copy()`, `__eq__()` methods
- Direct access to FlowSystem from results without manual restoring (lazily loaded)
- New `FlowResults` class and precomputed DataArrays for sizes/flow_rates/flow_hours
- `effects_per_component()` dataset for component impact evaluation, including all indirect effects through effect shares
- `effects_per_component` dataset for component impact evaluation, including all indirect effects through effect shares

**Other additions:**

Expand All @@ -124,7 +124,7 @@ This replaces `specific_share_to_other_effects_*` parameters and inverts the dir
- Type system overhaul - added clear separation between temporal and non-temporal data throughout codebase for better clarity
- Enhanced FlowSystem interface with improved `__repr__()` and `__str__()` methods
- Improved Model Structure - Views and organisation is now divided into:
- Model: The main Model (linopy.Model) that is used to create and store the variables and constraints for the flow_system.
- Model: The main Model (linopy.Model) that is used to create and store the variables and constraints for the FlowSystem.
- Submodel: The base class for all submodels. Each is a subset of the Model, for simpler access and clearer code.
- Made docstrings in `config.py` more compact and easier to read
- Improved format handling in configuration module
Expand Down Expand Up @@ -188,7 +188,7 @@ This replaces `specific_share_to_other_effects_*` parameters and inverts the dir
- **Centralized deprecation pattern**: Added `_handle_deprecated_kwarg()` helper method to `Interface` base class that provides reusable deprecation handling with consistent warnings, conflict detection, and optional value transformation. Applied across 5 classes (InvestParameters, Source, Sink, SourceAndSink, Effect) reducing deprecation boilerplate by 72%.
- FlowSystem data management simplified - removed `time_series_collection` pattern in favor of direct timestep properties
- Change modeling hierarchy to allow for more flexibility in future development. This leads to minimal changes in the access and creation of Submodels and their variables.
- Added new module `.modeling` that contains Modelling primitives and utilities
- Added new module `.modeling` that contains modeling primitives and utilities
- Clearer separation between the main Model and "Submodels"
- Improved access to the Submodels and their variables, constraints and submodels
- Added `__repr__()` for Submodels to easily inspect its content
Expand Down Expand Up @@ -218,10 +218,12 @@ This replaces `specific_share_to_other_effects_*` parameters and inverts the dir
- All examples now enable console logging to demonstrate proper logging usage
- Console logging now outputs to `sys.stdout` instead of `sys.stderr` for better compatibility with output redirection

### 💥 Breaking Changes
- Console logging is now disabled by default (`CONFIG.Logging.console = False`). Enable it explicitly in your scripts with `CONFIG.Logging.console = True` and `CONFIG.apply()`
- File logging is now disabled by default (`CONFIG.Logging.file = None`). Set a file path to enable file logging

### ♻️ Changed
- Logging and Configuration management changed
- **Breaking**: Console logging is now disabled by default (`CONFIG.Logging.console = False`). Enable it explicitly in your scripts with `CONFIG.Logging.console = True` and `CONFIG.apply()`
- **Breaking**: File logging is now disabled by default (`CONFIG.Logging.file = None`). Set a file path to enable file logging
- Improved default logging colors: DEBUG is now gray (`\033[90m`) for de-emphasized messages, INFO uses terminal default color (`\033[0m`) for clean output

### 🗑️ Deprecated
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ We believe that optimization modeling should be **approachable for beginners** y

**Short-term goals:**

- **Multi-dimensional modeling**: Full support for multi-period investments and scenario-based stochastic optimization (periods and scenarios are in active development)
- **Multi-dimensional modeling**: Multi-period investments and scenario-based stochastic optimization are available (periods and scenarios are in active development for enhanced features)
- **Enhanced component library**: More pre-built, domain-specific components (sector coupling, hydrogen systems, thermal networks, demand-side management)

**Medium-term vision:**

- **Modeling to generate alternatives (MGA)**: Built-in support for exploring near-optimal solution spaces to produce more robust, diverse solutions under uncertainty
- **Interactive tutorials**: Browser-based, reactive tutorials for learning FlixOpt without local installation (marimo)
- **Interactive tutorials**: Browser-based, reactive tutorials for learning FlixOpt without local installation ([marimo](https://marimo.io))
- **Standardized cost calculations**: Align with industry standards (VDI 2067) for CAPEX/OPEX calculations
- **Advanced result analysis**: Time-series aggregation, automated reporting, and rich visualization options
- **Recipe collection**: Community-driven library of common modeling patterns, data manipulation techniques, and optimization strategies (see [Recipes](user-guide/recipes/index.md) - help wanted!)
Expand Down
47 changes: 47 additions & 0 deletions docs/user-guide/recipes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Recipes

**Coming Soon!** 🚧

This section will contain quick, copy-paste ready code snippets for common FlixOpt patterns.

---

## What Will Be Here?

Short, focused code snippets showing **how to do specific things** in FlixOpt:

- Common modeling patterns
- Integration with other tools
- Performance optimizations
- Domain-specific solutions
- Data analysis shortcuts

Unlike full examples, recipes will be focused snippets showing a single concept.

---

## Planned Topics

- **Storage Patterns** - Batteries, thermal storage, seasonal storage
- **Multi-Criteria Optimization** - Balance multiple objectives
- **Data I/O** - Loading time series from CSV, databases, APIs
- **Data Manipulation** - Common xarray operations for parameterization and analysis
- **Investment Optimization** - Size optimization strategies
- **Renewable Integration** - Solar, wind capacity optimization
- **On/Off Constraints** - Minimum runtime, startup costs
- **Large-Scale Problems** - Segmented and aggregated calculations
- **Custom Constraints** - Extend models with linopy
- **Domain-Specific Patterns** - District heating, microgrids, industrial processes

---

## Want to Contribute?

**We need your help!** If you have recurring modeling patterns or clever solutions to share, please contribute via [GitHub issues](https://github.com/flixopt/flixopt/issues) or pull requests.

Guidelines:
1. Keep it short (< 100 lines of code)
2. Focus on one specific technique
3. Add brief explanation and when to use it

Check the [contribution guide](../../contribute.md) for details.
5 changes: 4 additions & 1 deletion examples/02_Complex/complex_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@
flow_system.add_elements(bhkw_2) if use_chp_with_piecewise_conversion else flow_system.add_elements(bhkw)

pprint(flow_system) # Get a string representation of the FlowSystem
flow_system.start_network_app() # Start the network app. Does only work with extra dependencies installed
try:
flow_system.start_network_app() # Start the network app
except ImportError as e:
print(f'Network app requires extra dependencies: {e}')

# --- Solve FlowSystem ---
calculation = fx.FullCalculation('complex example', flow_system, time_indices)
Expand Down
4 changes: 1 addition & 3 deletions flixopt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
# These filters match the test configuration in pyproject.toml for consistency.

# tsam: Time series aggregation library
# - FutureWarning: Upcoming API changes in tsam (will be fixed in future tsam releases)
warnings.filterwarnings('ignore', category=FutureWarning, module='tsam')
# - UserWarning: Informational message about minimal value constraints
# - UserWarning: Informational message about minimal value constraints during clustering.
warnings.filterwarnings('ignore', category=UserWarning, message='.*minimal value.*exceeds.*', module='tsam')
# TODO: Might be able to fix it in flixopt?

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ filterwarnings = [
"error::UserWarning:flixopt",

# === Third-party warnings (mirrored from __init__.py) ===
"ignore::FutureWarning:tsam",
"ignore:.*minimal value.*exceeds.*:UserWarning:tsam",
"ignore:Coordinates across variables not equal:UserWarning:linopy",
"ignore:.*join will change from join='outer' to join='exact'.*:FutureWarning:linopy",
Expand Down