Skip to content

Refactor technology-requirement association: replace services with requirements field#92

Draft
Copilot wants to merge 1 commit intojp/update_requirementsfrom
copilot/sub-pr-91
Draft

Refactor technology-requirement association: replace services with requirements field#92
Copilot wants to merge 1 commit intojp/update_requirementsfrom
copilot/sub-pr-91

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 23, 2026

Thanks for opening a PR to PowerSystemsInvestmentsPortfolios.jl, please take note of the following when making a PR:

Check the contributor guidelines

Description

Inverts the technology-requirement association model: instead of requirements tracking which technologies/regions are eligible, technologies now hold a requirements field listing the requirements they contribute to. Removes bidirectional coupling in favor of a single source of truth on the technology side.

Technology structs (SupplyTechnology, StorageTechnology, DemandSideTechnology, DemandRequirement, AggregateTransportTechnology, NodalACTransportTechnology, NodalHVDCTransportTechnology, ColocatedSupplyStorageTechnology)

  • Replaced services::Vector{PSY.Service} with requirements::Vector{Requirements}
  • Added get_requirements / set_requirements! accessors

Requirement structs (CapacityReserveMargin, CarbonCaps, CarbonTax, EnergyShareRequirements, HourlyMatching, MaximumCapacityRequirements, MinimumCapacityRequirements)

  • Removed eligible_technologies::Vector{Technology} and eligible_regions::Vector{RegionTopology} fields

New utility API (exported)

  • has_requirement(technology, requirement) — checks if a requirement is attached to a technology
  • get_contributing_technologies(portfolio, requirement) — returns all technologies contributing to a given requirement
# Attach a requirement to a technology
tech = first(get_technologies(SupplyTechnology, port))
req = CarbonTax(; name="co2_cap", id=1, target_year=2030, tax_dollars_per_ton=50.0)
set_requirements!(tech, [req])

# Query from the portfolio side
has_requirement(tech, req)                        # true
get_contributing_technologies(port, req)          # [tech]

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI mentioned this pull request Feb 23, 2026
Copilot AI changed the title [WIP] Update requirements for issue tracking Refactor technology-requirement association: replace services with requirements field Feb 23, 2026
Copilot AI requested a review from rodrigomha February 23, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants