Commit 2b2e835
authored
Feature/containers-and-reprs-for-better-element-organization (#443)
* Improve __str__ of FlowSystem
* Use ElementContainer class
* Inherrit from dict
* Improve repr
* Assign flow.componet right away after the flow is passed to a Component
* Add FLowContainer
* Improve Error Message
* Improve repr of FlowSystem
* Use ElementContainer in results.py
* Use a Mixin instead and use in results as well
* Improve Results container usage
* Simplify display
* Make CalculationResults iterable over sub containers
* Create CompositeContainerMixin and use in FLowSystem and CalcualtionResults
* Remove from commons.py
* Re-add status
* Remove redundant stuff and add deprecation
* Add type annotation to CompositeContainerMixin
* Use ContainerMixin in EffectsCollection
* Optimize acess patterns
* Remove unneded method
* Iterate group containers to collect values and pairs in one pass.
* Add sorting to containers
* Reorder container groups
* Add guardfs for flow results
* Rename _set_flow_labels and validate that the FLow is not already connected to another Component
* Add reprs
* Add reprs to results classes
* Improve the reprs
* Remove code duplication
* Improve repr of ELements
* Improve Error message
* Remove redundant sum('time')
* Pre compile re pattern
* Make code more concise
* Synchronise order of Containers in both FlowSystem and CalculationResults
* Add note about caching
* Update CHANGELOG.md
* Changed from O(n) element in self.values() to O(1) label-based checking, avoiding expensive container merges.
* Added early validation to ensure flows in prevent_simultaneous_flows belong to the component, preventing modeling order issues.
* Import Statement Fix (structure.py:10, 916)
* Flow repr Improvement
* Optimized Uniqueness Check
* Fixed separator mangling that produced strings like "(kg)objective" instead of "(kg) | objective"
* Flows Property Caching
* Fixed __iter__ method (effects.py:591-592)
Updated all code that relied on old behavior
* Deterministic Ordering for Effects
* Removed Redundant Import
* Deterministic Ordering for Flows
* Deduplicate prevent_simultaneous_flows
* Improved DataArray Handling in repr
* Enhanced Bus repr
* Enhanced Component repr
* Update CHANGELOG.md
* Simplify reprs
* Simplify reprs
* Simplify repr formating of numbers
* Reformat reprs
* Reformat reprs
* Reformat reprs
* Reformat reprs
* Reformat reprs
* Reformat reprs
* Reformat reprs
* Reformat reprs
* Reformat reprs
* Reformat reprs
* Use helper formats to create the reprs
* Remove str from Interface class
* Improve FlowSystem repr
* Improve Reprs of Containers
* Numeric formatter handles NaN/Inf/empty inputs
* Effect repr shows constraints for both min and max bounds
* Improve repr code
* Improve detection of defaults
* Removed the unused _format_size method (dead code with no call sites
* Simplified flows container construction by passing the list directly instead of converting to dict first
* Moved ResultsContainer import to module level for consistency
* prevents mutation of the original self.solution.attrs
* Fix return type annotation to match base class.
* Extract _format_value_for_repr() as dedicated method
* FIx type hint
* Improve Error message
* Typo in docs
* Fix indents in docs and CHANGELOG.md
* Improve documentation of the FLowSystem access1 parent 98db5e4 commit 2b2e835
12 files changed
Lines changed: 1062 additions & 247 deletions
File tree
- docs/user-guide
- flixopt
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
| 73 | + | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
| |||
105 | 114 | | |
106 | 115 | | |
107 | 116 | | |
108 | | - | |
109 | | - | |
110 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
111 | 120 | | |
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| |||
286 | 295 | | |
287 | 296 | | |
288 | 297 | | |
289 | | - | |
290 | | - | |
| 298 | + | |
| 299 | + | |
291 | 300 | | |
292 | 301 | | |
293 | | - | |
294 | | - | |
| 302 | + | |
| 303 | + | |
295 | 304 | | |
296 | 305 | | |
297 | 306 | | |
| |||
305 | 314 | | |
306 | 315 | | |
307 | 316 | | |
308 | | - | |
309 | | - | |
310 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
311 | 320 | | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
316 | 325 | | |
317 | 326 | | |
318 | 327 | | |
| |||
533 | 542 | | |
534 | 543 | | |
535 | 544 | | |
536 | | - | |
| 545 | + | |
537 | 546 | | |
538 | 547 | | |
539 | 548 | | |
| |||
575 | 584 | | |
576 | 585 | | |
577 | 586 | | |
578 | | - | |
579 | | - | |
| 587 | + | |
| 588 | + | |
580 | 589 | | |
581 | 590 | | |
582 | 591 | | |
| |||
601 | 610 | | |
602 | 611 | | |
603 | 612 | | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
608 | 617 | | |
609 | 618 | | |
610 | 619 | | |
| |||
650 | 659 | | |
651 | 660 | | |
652 | 661 | | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
657 | 666 | | |
658 | 667 | | |
659 | 668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
22 | | - | |
23 | | - | |
| 29 | + | |
| 30 | + | |
24 | 31 | | |
25 | 32 | | |
26 | | - | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
108 | | - | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
531 | 541 | | |
532 | 542 | | |
533 | 543 | | |
| |||
0 commit comments