Skip to content

Extend resource-specific functionality for geography features#50

Merged
JulStraus merged 16 commits intomainfrom
enhance/complex_resource_flow
Apr 16, 2026
Merged

Extend resource-specific functionality for geography features#50
JulStraus merged 16 commits intomainfrom
enhance/complex_resource_flow

Conversation

@espenbodal
Copy link
Copy Markdown
Contributor

@espenbodal espenbodal commented Apr 14, 2026

Description

This pull request implements resource-specific extension functionality for EnergyModelsGeography, following the pattern established in EnergyModelsBase#61.

What's included

Feature Implementation

  • New dispatch hooks variables_flow_resource and constraints_couple_resource for transmission modes and areas
  • Support for custom resource types with geography-specific variables and coupling constraints
  • Example implementation with PotentialPower resource tracking potential and enforcing transmission losses

Documentation

  • Comprehensive how-to guide: docs/src/how-to/extend-resource-functionality.md
  • Practical example demonstrating:
    1. Custom resource type definition with bounds
    2. Resource-specific variable creation at mode and area levels
    3. Transmission mode constraint implementation with loss factors
    4. Area-to-transmission coupling of new resource variables

Tests

  • Full test suite in test/test_resource_flow.jl with PotentialPower example
  • Verification of variables and constraint satisfaction
  • Integration tests with optimization

Applications

The extension pattern enables modeling of:

  • District heating networks: Temperature tracking (supply/return quality)
  • Natural gas networks: Pressure-related transport limits and gas mixture composition (e.g., hydrogen blending)
  • General: Quality attributes, concentrations, purities, state-of-charge properties

Related Issues

Relates to: #61 (resource-extension functionality in EnergyModelsBase)

Branch

Development on: enhance/complex_resource_flow

* removed constraint_resource in create_node GeoAvailability
…ansmission test

- document new resource-segment extension points for flow variables and coupling constraints
- expand how-to guidance with user-facing migration notes for resource-specific dispatch
- improve model docstrings to clarify fallback hook behavior for extension packages
- add a dedicated resource-flow test module with:
  - custom PotentialPower resource
  - custom PotentialLossMode transmission mode
  - two-area transmission corridor case validating potential loss behavior
- include the new resource-flow test in the test runner
- align project and test environments with EnergyModelsBase 0.10 and EnergyModelsInvestments 0.9
…-flow example

* add an unversioned release note for EMB v0.10 resource dispatch changes
* add a how-to guide for extending geography models with resource-specific flow variables
* align docs terminology from hooks to extension functions and fix cross-references
* update public docs pages with module metadata so Documenter resolves bindings correctly
* relax EMB compat and adjust EMI investment constraints to use the full time structure
@espenbodal espenbodal linked an issue Apr 14, 2026 that may be closed by this pull request
@espenbodal espenbodal requested a review from JulStraus April 14, 2026 12:07
@JulStraus JulStraus added the enhancement New feature or request label Apr 14, 2026
@espenbodal espenbodal changed the title Extend resource-specific functionality for geographic transmission Extend resource-specific functionality for geography features Apr 14, 2026
Copy link
Copy Markdown
Member

@JulStraus JulStraus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented a few things which I also adjusted myself in commits. If you agree with my comments and the implementation, you can resolve them. I will merge the PR at that point and register the version.

Comment thread docs/src/how-to/update-models.md
Comment thread docs/src/index.md
Comment thread docs/make.jl
Comment thread src/constraint_functions.jl
Comment thread src/model.jl Outdated
Comment thread NEWS.md Outdated
Comment thread src/model.jl
Copy link
Copy Markdown
Member

@JulStraus JulStraus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Due to simplicity, my additional commits were approved by @espenbodal who could not as PR creator approve them directly.

@JulStraus JulStraus merged commit 761fd1b into main Apr 16, 2026
5 checks passed
@JulStraus JulStraus deleted the enhance/complex_resource_flow branch April 16, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend resource-specific functionality for geographic transmission

2 participants