Release v2.0.0
Release Date: March 29, 2025
🚀 Major Framework Changes
- Migration from Pyomo to Linopy: Completely rebuilt the optimization foundation to use Linopy instead of Pyomo
- Significant performance improvements, especially for large models
- Internal useage of linopys mathematical modeling language
- xarray-Based Data Architecture: Redesigned data handling to rely on xarray.Dataset throughout the package for:
- Improved solution representation and analysis
- Enhanced time series management
- Consistent serialization across all elements
- Reduced file size and improved performance
- Saving and restoring unsolved Models: The FlowSystem is now fully serializable and can be saved to a file.
- Share your work with others by saving the FlowSystem to a file
- Load a FlowSystem from a file to extend or modify your work
🔧 Key Improvements
Model Handling
- Extend every flixopt model with the linopy language: Add any additional constraint or variable to your flixopt model by using the linopy language.
- Full Model Export/Import: As a result of the migration to Linopy, the linopy.Model can be exported before or after the solve.
- Improved Infeasible Model Handling: Added better detection and reporting for infeasible optimization models
- Improved Model Documentation: Every model can be documented in a .yaml file, containing human readable mathematical formulations of all variables and constraints. THis is used to document every Calculation.
Calculation Results and documentation:
The CalculationResults
class has been completely redesigned to provide a more streamlined and intuitive interface.
Accessing the results of a Calculation is now as simple as:
fx.FullCalculation('Sim1', flow_system)
calculation.solve(fx.solvers.HighsSolver())
calculation.results # This object can be entirely saved and reloaded to file without any information loss
- Improved Documentation: The FlowSystem as well as a model Documentation is created for every model run.
- Results without saving to file: The results of a Calculation can now be properly accessed without saving the results to a file first.
- Unified Solution exploration: Every
Calculation
has aCalculation.results
attribute, which accesses the solution. This can be saved and reloaded without any information loss. - Improved Calculation Results: The results of a Calculation are now more intuitive and easier to access. The
CalculationResults
class has been completely redesigned to provide a more streamlined and intuitive interface.
Data Management & I/O
- Unified Serialization: Standardized serialization and deserialization across all elements
- Compression Support: Added data compression when saving results to reduce file size
- to_netcdf/from_netcdf Methods: Added for FlowSystem and other core components
Details
TimeSeries Enhancements
- xarray Integration: Redesigned TimeSeries to depend on xr.DataArray
- datatypes: Added support for more datatypes, with methods for conversion to TimeSeries
- Improved TimeSeriesCollection: Enhanced indexing, representation, and dataset conversion
- Simplified Time Management: Removed period concepts and focused on timesteps for more intuitive time handling
📚 Documentation
- Improved documentation of the FlixOpt API and mathematical formulations
- Google Style Docstrings: Updated all docstrings to Google style format
🔄 Dependencies
- Linopy: Added as the core dependency replacing Pyomo
- xarray: Now a critical dependency for data handling and file I/O
- netcdf4: Dependency for fast and efficient file I/O
Dropped Dependencies
- pyomo: Replaced by linopy as the modeling language
📋 Migration Notes
This version represents a significant architecture change. If you're upgrading:
- Code that directly accessed Pyomo models will need to be updated to work with Linopy
- Data handling now uses xarray.Dataset throughout, which may require changes in how you interact with results
- The way labels are constructed has changed throughout the system
- The results of calculations are now handled differently, and may require changes in how you access results
- The framework was renamed from flixOpt to flixopt. Use
import flixopt as fx
.
For complete details, please refer to the full commit history.