Refactoring repo and restructuring temoa initialize and rules#158
Merged
ParticularlyPythonicBS merged 24 commits intotemoa_davey_codefrom Oct 10, 2025
Merged
Conversation
…rmalism instead of the type structure used
WalkthroughReorganizes the codebase into a library-centric layout: introduces Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant CLI as main.py
participant Conf as temoa.core.config.TemoaConfig
participant Loader as temoa._internal.hybrid_loader.HybridLoader
participant Builder as temoa._internal.build_instance
participant Solver as temoa._internal.solve_instance
participant Checker as temoa._internal.check_solve_status
participant Results as temoa._internal.handle_results
participant Writer as temoa._internal.TableWriter
User->>CLI: run CLI / python -m temoa
CLI->>Conf: instantiate config
CLI->>Loader: load data
Loader-->>CLI: data payload
CLI->>Builder: build model instance (uses temoa.core.TemoaModel & components)
Builder-->>CLI: Pyomo model instance
CLI->>Solver: solve model
Solver->>Checker: verify status
alt solve success
CLI->>Results: process outputs
Results->>Writer: write tables
else solve failure
Checker-->>CLI: error/status
CLI-->>User: exit / log
end
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120+ minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closed
This was referenced Oct 13, 2025
Closed
This was referenced Oct 22, 2025
This was referenced Nov 3, 2025
This was referenced Nov 11, 2025
Merged
This was referenced Nov 18, 2025
This was referenced Nov 26, 2025
Closed
This was referenced Jan 5, 2026
This was referenced Mar 6, 2026
Merged
This was referenced Mar 16, 2026
Closed
This was referenced Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restructuring temoa_initialize and temoa_rules into a component structure where items are organized based on categories like capacity and storage instead of their action like intialization or rule. This makes the files smaller and more cohesive and removes the star imports in temoa model (now just model for api restructure)
All functions in initlaiize and rules are distributed to files in the component modules. Large functions like create sparse dicts are logically chunked and moved to related component files.
Where a function has been moved is a logical best guess based on code cohearance but happy to move things around if it makes more sense somewhere else
Summary by CodeRabbit
New Features
Documentation
Refactor
Tests
Chores