Skip to content

Commit

Permalink
Merge pull request #805 from GenXProject/release/0.4.2
Browse files Browse the repository at this point in the history
Release v0.4.2
  • Loading branch information
lbonaldo authored Jan 6, 2025
2 parents 73ab92d + 9f82165 commit 0efaff1
Show file tree
Hide file tree
Showing 102 changed files with 2,760 additions and 764 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/PR_checks.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Changelog Enforcer
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
# Enforces update of changelog file on every pull request
Changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: 'CHANGELOG.md'
skipLabels: 'Skip-Changelog, skip changelog'
token: ${{ secrets.GITHUB_TOKEN }}
missingUpdateErrorMessage: >
No update to CHANGELOG.md found! Please add an entry describing
your change and include the pull request tag. Note that we use
the keepachangelog format (https://keepachangelog.com). If your
change doesn’t require a changelog entry, please add the
'Skip-Changelog' or 'skip changelog' label to the pull request.
137 changes: 137 additions & 0 deletions .github/workflows/dev_version_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Dev Version Check and Update

on:
pull_request_review:
types: [submitted]

jobs:
check-version:
if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'develop'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

- name: Set up Julia
uses: julia-actions/setup-julia@latest
with:
version: '1.x'

- uses: julia-actions/cache@v2

- name: Configure Git
run: |
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
- name: Check and Update Version
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
# Get PR base branch and export it
export BASE_BRANCH=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$REPO/pulls/$PR_NUMBER" | \
jq -r .base.ref)
julia -e '
# Get base branch directly from environment variable
base_branch = ENV["BASE_BRANCH"]
# First ensure we have the base branch
run(`git fetch origin $(base_branch)`)
function parse_version(version_str)
# Extract M.m.p and optional dev number
base_pattern = r"^(\d+\.\d+\.\d+)(?:-dev\.(\d+))?$"
m = match(base_pattern, version_str)
if isnothing(m)
error("Invalid version format: $version_str")
end
version = m.captures[1]
dev_num = isnothing(m.captures[2]) ? nothing : parse(Int, m.captures[2])
return (version, dev_num)
end
function should_update_version(base_ver_str, current_ver_str)
base_ver, base_dev = parse_version(base_ver_str)
current_ver, current_dev = parse_version(current_ver_str)
# If versions differ, no update needed
if base_ver != current_ver
return false
end
# If base has dev number, we should increment from the base dev number
if !isnothing(base_dev)
return true
end
# If base has no dev number and current has none, add dev.1
if isnothing(base_dev) && isnothing(current_dev)
return true
end
return false
end
function get_new_version(base_ver_str, current_ver_str)
base_ver, base_dev = parse_version(base_ver_str)
current_ver, current_dev = parse_version(current_ver_str)
# If base has a dev number, increment from that
if !isnothing(base_dev)
return "$(base_ver)-dev.$(base_dev + 1)"
end
# If no dev numbers exist, start with dev.1
return "$(current_ver)-dev.1"
end
function check_and_update_version()
# Get the base branch version
base_content = read(pipeline(`git show origin/$(base_branch):Project.toml`), String)
# Get current branch version
current_content = read(joinpath(pwd(), "Project.toml"), String)
# Extract versions using regex
version_pattern = r"version = \"(.*?)\""
base_version = match(version_pattern, base_content).captures[1]
current_version = match(version_pattern, current_content).captures[1]
println("Base version: $base_version")
println("Current version: $current_version")
if should_update_version(base_version, current_version)
println("Version needs updating")
new_version = get_new_version(base_version, current_version)
# Update the file
new_content = replace(current_content,
"version = \"$current_version\"" =>
"version = \"$new_version\"")
write(joinpath(pwd(), "Project.toml"), new_content)
# Commit and push the change
run(`git add $(joinpath(pwd(), "Project.toml"))`)
run(`git commit -m "Bump version to $new_version"`)
run(`git push`)
println("Version updated to $new_version")
else
println("Version already updated")
end
end
check_and_update_version()'
14 changes: 0 additions & 14 deletions .github/workflows/format_suggestions.yml

This file was deleted.

29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.4.2] - 2024-12-23

### Added
- Fusion plant optional features for thermal plants (#743).
- Support for reusing the same Gurobi environment for multiple solves when
number of concurrent Gurobi uses is limited (#783).
- Additional long-duration storage constraints to bound state of charge in
non-representative periods (#781).
- New version of `add_similar_to_expression!` to support arrays of `Number`s. (#798)
- New settings flag `LDSAdditionalConstraints` to provide flexibility in
activating new long-duration storage constraints (#781). Can be set in the GenX
settings file (PR #801).

### Changed
- The `charge.csv` and `storage.csv` files now include only resources with
charge and storage variables (#760 and #763).
- Deduplicated docs on optimized scheduled maintenance for thermal resources (#745).
- Removed the `CapRes_*` columns from `Network.csv` since they were not being used (#784).

### Fixed
- Add constraint to ensure that electricity charged from the grid cannot exceed
the charging capacity of the storage component in VRE_STOR (#770).
- Update `getproperty` function for vectors of resources to ensure compatibility
with Julia v1.11 (#785).
- Fixed cost calculation in `write_costs.jl` when no resources are present in
a zone. (#796)
- Added `eTotalCMaxCapSlack` to calculation of `cUnmetPolicyPenalty` in
`write_costs.jl` (#806).

## [0.4.1] - 2024-08-20

### Added
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ authors:
given-names: "Qingyu"
orcid: "https://orcid.org/0000-0003-2692-5135"
title: "GenX"
version: 0.4.1
version: 0.4.2
doi: 10.5281/zenodo.10846070
date-released: 2024-04-26
url: "https://github.com/GenXProject/GenX.jl"
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GenX"
uuid = "5d317b1e-30ec-4ed6-a8ce-8d2d88d7cfac"
authors = ["Bonaldo, Luca", "Chakrabarti, Sambuddha", "Cheng, Fangwei", "Ding, Yifu", "Jenkins, Jesse D.", "Luo, Qian", "Macdonald, Ruaridh", "Mallapragada, Dharik", "Manocha, Aneesha", "Mantegna, Gabe ", "Morris, Jack", "Patankar, Neha", "Pecci, Filippo", "Schwartz, Aaron", "Schwartz, Jacob", "Schivley, Greg", "Sepulveda, Nestor", "Xu, Qingyu", "Zhou, Justin"]
version = "0.4.1"
version = "0.4.2"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ that incorporates several state-of-the-art practices in electricity system plann
The model was [originally developed](https://energy.mit.edu/publication/enhanced-decision-support-changing-electricity-landscape/) by
[Jesse D. Jenkins](https://mae.princeton.edu/people/faculty/jenkins) and
[Nestor A. Sepulveda](https://energy.mit.edu/profile/nestor-sepulveda/) at the Massachusetts Institute of Technology and is now jointly maintained by
[a team of contributors](https://github.com/GenXProject/GenX#genx-team) at the Princeton University ZERO Lab (led by Jenkins), MIT (led by [Ruaridh MacDonald](https://energy.mit.edu/profile/ruaridh-macdonald/)), and NYU (led by [Dharik Mallapragada](https://engineering.nyu.edu/faculty/dharik-mallapragada)).
[a team of contributors](https://github.com/GenXProject/GenX#genx-team) at the Princeton University ZERO Lab (led by Jenkins), MIT (led by [Ruaridh MacDonald](https://energy.mit.edu/profile/ruaridh-macdonald/)), NYU (led by [Dharik Mallapragada](https://engineering.nyu.edu/faculty/dharik-mallapragada)), and Binghamton University (led by [Neha Patankar](https://www.binghamton.edu/ssie/people/profile.html?id=npatankar)).

GenX is a constrained linear or mixed integer linear optimization model that determines the portfolio of electricity generation,
storage, transmission, and demand-side resource investments and operational decisions to meet electricity demand in one or more future planning years at lowest cost,
Expand All @@ -40,7 +40,7 @@ The 'main' branch is the current master branch of GenX. The various subdirectori

## Requirements

GenX (v0.4.1) runs on Julia v1.6 through v1.9, with a minimum version of the package JuMP v1.1.1. Julia v1.10 is also supported. However, we recently noticed a decline in performance with Julia v1.10, which is currently under investigation. Therefore, **we recommend using Julia v1.9**, particularly for very large cases.
GenX (v0.4.2) runs on Julia v1.6 through v1.9, with a minimum version of the package JuMP v1.1.1. Julia v1.10 and v1.11 are also supported. However, we recently noticed a decline in performance with Julia v1.10, which is currently under investigation. Therefore, **we recommend using Julia v1.9**, particularly for very large cases.
We recommend the users to either stick to a particular version of Julia to run GenX. If however, the users decide to switch between versions, it's very important to delete the old `Manifest.toml` file and do a fresh build of GenX when switching between Julia versions.

There is also an older version of GenX, which is also currently maintained and runs on Julia 1.3.x and 1.4.x series.
Expand Down
6 changes: 3 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ pages = OrderedDict(
"Thermal" => [
"Thermal" => "Model_Reference/Resources/thermal.md",
"Thermal Commit" => "Model_Reference/Resources/thermal_commit.md",
"Thermal No Commit" => "Model_Reference/Resources/thermal_no_commit.md"
"Thermal No Commit" => "Model_Reference/Resources/thermal_no_commit.md",
"Scheduled maintenance for Thermal Commit" => "Model_Reference/Resources/maintenance.md",
"Fusion" => "Model_Reference/Resources/fusion.md"
],
"Hydrogen Electrolyzers" => "Model_Reference/Resources/electrolyzers.md",
"Scheduled maintenance for various resources" => "Model_Reference/Resources/maintenance.md",
"Resource types" => "Model_Reference/Resources/resource.md"
],
"Maintenance" => "Model_Reference/maintenance_overview.md",
"Policies" => "Model_Reference/policies.md",
"Solver Configurations" => "Model_Reference/solver_configuration_api.md",
"Inputs Functions" => "Model_Reference/load_inputs.md",
Expand Down
6 changes: 3 additions & 3 deletions docs/src/Model_Concept_Overview/model_notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ $\mathcal{W} \subseteq \mathcal{G}$ | where $\mathcal{W}$ set of hydroelectric g
|$r^{ac,cha}_{y,z,t} \in \mathbb{R}_+$ | Upward spinning reserves contribution \[MW\] for the storage AC charge component from technology $y$ in zone $z$ at time $t$ - only applicable for co-located VRE and storage resources with a storage AC charge component, $y \in \mathcal{VS}^{sym,ac} \cup y \in \mathcal{VS}^{asym,ac,cha}$ |
|$\alpha^{Contingency,Aux}_{y,z} \in \{0,1\}$ | Binary variable that is set to be 1 if the total installed capacity $\Delta^{\text{total}}_{y,z} > 0$ for any generator $y \in \mathcal{UC}$ and zone $z$, and can be 0 otherwise |
|$\Phi_{l,t} \in \mathbb{R}_+$ | Power flow in line $l$ at time step $t$ \[MWh\]|
|$\theta_{z,t} \in \mathbb{R}$ | Volta phase angle in zone $z$ at time step $t$ \[radian\]|
|$v_{y,z,t}$ | Commitment state of the generation cluster $y$ in zone $z$ at time $t$|
|$\mathcal{X}_{y,z,t}$ | Number of startup decisions, of the generation cluster $y$ in zone $z$ at time $t$|
|$\theta_{z,t} \in \mathbb{R}$ | Voltage phase angle in zone $z$ at time step $t$ \[radian\]|
|$\nu_{y,z,t}$ | Commitment state of the generation cluster $y$ in zone $z$ at time $t$|
|$\chi_{y,z,t}$ | Number of startup decisions, of the generation cluster $y$ in zone $z$ at time $t$|
|$\zeta_{y,z,t}$ | Number of shutdown decisions, of the generation cluster $y$ in zone $z$ at time $t$|
|$\mathcal{Q}_{o,n} \in \mathbb{R}_+$ | Inventory of storage of type $o$ at the beginning of input period $n$ \[MWh]|
|$\Delta\mathcal{Q}_{o,m} \in \mathbb{R}$ | Excess storage inventory built up during representative period $m$ \[MWh]|
Expand Down
Loading

2 comments on commit 0efaff1

@lbonaldo
Copy link
Collaborator 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/122481

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.4.2 -m "<description of version>" 0efaff1b9de5529b001facd4f15aaeee960e33e2
git push origin v0.4.2

Please sign in to comment.