Skip to content

Commit

Permalink
Name emissions constraints to allow for emissions extensions (#36)
Browse files Browse the repository at this point in the history
* Give name to emission constraint

---------

Co-authored-by: Truls Flatberg <[email protected]>
  • Loading branch information
JulStraus and trulsf authored Aug 20, 2024
1 parent f275047 commit 5ed7c6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

* Updated minor issues in the documentation (docstrings, indices, and quick start).
* Use dev version of EMB for examples when running as part of tests, solving [Issue #17](https://github.com/EnergyModelsX/EnergyModelsBase.jl/issues/17).
* Naming of the total emission constraint to allow for updates in the coefficients in other packages.

## Version 0.7.0 (2024-05-24)

Expand Down
5 changes: 3 additions & 2 deletions src/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ function constraints_emissions(m, 𝒩, 𝒯, 𝒫, modeltype::EnergyModel)
𝒯ᴡⁿᡛ = strategic_periods(𝒯)

# Creation of the individual constraints.
@constraint(m, [t ∈ 𝒯, p ∈ 𝒫ᡉᡐ],
m[:emissions_total][t, p] == sum(m[:emissions_node][n, t, p] for n ∈ 𝒩ᡉᡐ)
@constraint(m, con_em_tot[t ∈ 𝒯, p ∈ 𝒫ᡉᡐ],
m[:emissions_total][t, p] ==
sum(m[:emissions_node][n, t, p] for n ∈ 𝒩ᡉᡐ)
)
@constraint(m, [t_inv ∈ 𝒯ᴡⁿᡛ, p ∈ 𝒫ᡉᡐ],
m[:emissions_strategic][t_inv, p] ==
Expand Down

2 comments on commit 5ed7c6d

@JulStraus
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/113486

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.0 -m "<description of version>" 5ed7c6d641f333adcc6dd89310a22e3343300101
git push origin v0.8.0

Please sign in to comment.