Uh oh!
There was an error while loading. Please reload this page.
- 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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
6d9bccad4a2e742c6d923be39e59c79c8a525880f593cdbeebd25e911fac0cfb78ad53a6d8434b9ee3e0c7c8af696d830f424a290fb3517848eacaea149fafd933036File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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 fromflixoptimportCalculation# orimportflixoptasfx; 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', | ||
Uh oh!
There was an error while loading. Please reload this page.
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