Merged
Conversation
- CompoundResource is a super type for ResourcePotential - Any CompoundResource creates new varaibles potential_in and potential_out on nodes and links. - In junctions the pontentials are transferred by equality rather than summation (as for flow_in, link_in etc.) - This allows for transfers of voltages and pressures, along with a quantity (e.g. energy or material flows)
- added function `variables_flow_resource` to create new variables by dispatching on resource types, it is called inside `variables_flow` - added function `constraints_link_resource` to create new constraints by dispatching on resource types, it is called inside `create_link` - added function `res_types` to extract an array of unique resource types from an array of resources
- Added function for resouce type constratints on node-link coupling
that dispatch on resouce type
- Removed old functions on potential variables and constratints
- Resource vector is segmented into sub-vectors based on resource type - Constraint functions for flows can be dispatched on these sub-vectors - New function are created to say if EMB flow-variables should be added, which can be dispatched on resource type, default is true - Function is available for adding new variables that are specific for a resource type
- Avioids repeating constraints that are not dependent on resources (doesnt have resouce in the constraint index)
- Moved the constraint-function for special
resource constraint to create_element function
…ase.jl into enhance/transfer_energy_potentials
* Updated `res_types` and `res_types_seg` to take `Vector{<:Resource}` instead of `Array{<:Resource}` as input.
* Added missing tests for new resource functions
…ase.jl into enhance/transfer_energy_potentials
JulStraus
requested changes
Mar 23, 2026
Member
JulStraus
left a comment
There was a problem hiding this comment.
These two comments are related to potential breaking changes which should be revised.
* Revert changes for create_link * `total_duration` is added to SimpleTimes, and the docstring is updated to reflect this.
Contributor
Author
|
Resolves #61 |
JulStraus
requested changes
Mar 24, 2026
Member
JulStraus
left a comment
There was a problem hiding this comment.
It looks in general quite well, but there must be the following changes:
- a description regarding how one can incorporate the new feature. This should be included within the how-to section and
- a proper test set in which we check that the specific functions are called and can be worked on.
We also have to discuss whether we want to have it breaking or not. There is a potential to avoid breaking changes, as outlined by me.
- add resource-type dispatch integration in `model.jl` for variable creation and coupling constraints - add resource type helpers in `resource.jl` - extend functional docs index and internals references in `make.jl`, `index.md`, and `functions.md` - add/expand end-to-end resource dispatch tests, including node/resource unpacking and bound constraints, in `test_resource.jl` - add release note update in `NEWS.md` - add new how-to page `extend-resource-functionality.md`
- Changes in documentation - Changed argument order in fallback method - Rearranged tests
fd5b7ea to
9113b56
Compare
JulStraus
approved these changes
Mar 25, 2026
Member
JulStraus
left a comment
There was a problem hiding this comment.
Looks good to me. It should be a squash and merge as most loc changed are in the documentation and the test set.
hellemo
approved these changes
Mar 25, 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.
Create new functions that enable dispatch on resource types in extension packages. This allows for new variables and constraints on existing elements when they are combined with specific resource types. New variables must have a unique name for each combination of element and resource. Couple functions must also be defined for the coupling between two elements for each resource.