-
Notifications
You must be signed in to change notification settings - Fork 9
Feature/rename calculation #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6d9bcca
d4a2e74
2c6d923
be39e59
c79c8a5
25880f5
93cdbee
bd25e91
1fac0cf
b78ad53
a6d8434
b9ee3e0
c7c8af6
96d830f
424a290
fb35178
48eacae
a149faf
d933036
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,8 +14,10 @@ | |
|
|
||
| # Import commonly used classes and functions | ||
| from . import linear_converters, plotting, results, solvers | ||
| from .aggregation import AggregationParameters | ||
|
|
||
| # Import old Calculation classes for backwards compatibility (deprecated) | ||
| from .calculation import AggregatedCalculation, FullCalculation, SegmentedCalculation | ||
| from .clustering import AggregationParameters, ClusteringParameters # AggregationParameters is deprecated | ||
| from .components import ( | ||
|
Comment on lines
+18
to
21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This module promises that legacy from flixopt import Calculation
# or
import flixopt as fx; fx.Calculation(...)will now fail, even though To keep the public API backward compatible, consider: -from .calculation import AggregatedCalculation, FullCalculation, SegmentedCalculation
+from .calculation import AggregatedCalculation, Calculation, FullCalculation, SegmentedCalculation
...
- # Old Calculation classes (deprecated, for backwards compatibility)
- 'FullCalculation',
- 'AggregatedCalculation',
- 'SegmentedCalculation',
+ # Old Calculation classes (deprecated, for backwards compatibility)
+ 'Calculation',
+ 'FullCalculation',
+ 'AggregatedCalculation',
+ 'SegmentedCalculation',This aligns the package surface with the deprecation story in Also applies to: 52-60, 66-67 🤖 Prompt for AI Agents |
||
| LinearConverter, | ||
| Sink, | ||
|
|
@@ -31,6 +33,9 @@ | |
| from .flow_system import FlowSystem | ||
| from .interface import InvestParameters, OnOffParameters, Piece, Piecewise, PiecewiseConversion, PiecewiseEffects | ||
|
|
||
| # Import new Optimization classes | ||
| from .optimization import ClusteredOptimization, Optimization, SegmentedOptimization | ||
|
|
||
| __all__ = [ | ||
| 'TimeSeriesData', | ||
| 'CONFIG', | ||
|
|
@@ -45,16 +50,22 @@ | |
| 'LinearConverter', | ||
| 'Transmission', | ||
| 'FlowSystem', | ||
| # New Optimization classes (preferred) | ||
| 'Optimization', | ||
| 'ClusteredOptimization', | ||
| 'SegmentedOptimization', | ||
| # Old Calculation classes (deprecated, for backwards compatibility) | ||
| 'FullCalculation', | ||
| 'SegmentedCalculation', | ||
| 'AggregatedCalculation', | ||
| 'SegmentedCalculation', | ||
| 'InvestParameters', | ||
| 'OnOffParameters', | ||
| 'Piece', | ||
| 'Piecewise', | ||
| 'PiecewiseConversion', | ||
| 'PiecewiseEffects', | ||
| 'AggregationParameters', | ||
| 'ClusteringParameters', | ||
| 'AggregationParameters', # Deprecated, use ClusteringParameters | ||
| 'plotting', | ||
| 'results', | ||
| 'linear_converters', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename list matches implementation; consider also documenting
Calculation → Optimization.The class/module rename bullets now line up with the new API (
AggregatedCalculation → ClusteredOptimization,FullCalculation → Optimization, results and aggregation/clustering mappings) and the deprecation behavior in code.For completeness of the migration notes, consider adding an entry for the plain
Calculation → Optimizationrename as well, sinceflixopt/calculation.pystill exposesCalculationas a deprecated wrapper.🤖 Prompt for AI Agents