Skip to content

Commit 0efaff1

Browse files
authored
Merge pull request #805 from GenXProject/release/0.4.2
Release v0.4.2
2 parents 73ab92d + 9f82165 commit 0efaff1

File tree

102 files changed

+2760
-764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2760
-764
lines changed

.github/workflows/PR_checks.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/changelog.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Changelog Enforcer
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
5+
6+
jobs:
7+
# Enforces update of changelog file on every pull request
8+
Changelog:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: dangoslen/changelog-enforcer@v3
13+
with:
14+
changeLogPath: 'CHANGELOG.md'
15+
skipLabels: 'Skip-Changelog, skip changelog'
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
missingUpdateErrorMessage: >
18+
No update to CHANGELOG.md found! Please add an entry describing
19+
your change and include the pull request tag. Note that we use
20+
the keepachangelog format (https://keepachangelog.com). If your
21+
change doesn’t require a changelog entry, please add the
22+
'Skip-Changelog' or 'skip changelog' label to the pull request.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Dev Version Check and Update
2+
3+
on:
4+
pull_request_review:
5+
types: [submitted]
6+
7+
jobs:
8+
check-version:
9+
if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'develop'
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
ref: ${{ github.event.pull_request.head.ref }}
20+
21+
- name: Set up Julia
22+
uses: julia-actions/setup-julia@latest
23+
with:
24+
version: '1.x'
25+
26+
- uses: julia-actions/cache@v2
27+
28+
- name: Configure Git
29+
run: |
30+
git config user.name "GitHub Actions Bot"
31+
git config user.email "[email protected]"
32+
33+
- name: Check and Update Version
34+
env:
35+
PR_NUMBER: ${{ github.event.pull_request.number }}
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
REPO: ${{ github.repository }}
38+
run: |
39+
# Get PR base branch and export it
40+
export BASE_BRANCH=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
41+
"https://api.github.com/repos/$REPO/pulls/$PR_NUMBER" | \
42+
jq -r .base.ref)
43+
44+
julia -e '
45+
46+
# Get base branch directly from environment variable
47+
base_branch = ENV["BASE_BRANCH"]
48+
49+
# First ensure we have the base branch
50+
run(`git fetch origin $(base_branch)`)
51+
52+
function parse_version(version_str)
53+
# Extract M.m.p and optional dev number
54+
base_pattern = r"^(\d+\.\d+\.\d+)(?:-dev\.(\d+))?$"
55+
m = match(base_pattern, version_str)
56+
if isnothing(m)
57+
error("Invalid version format: $version_str")
58+
end
59+
60+
version = m.captures[1]
61+
dev_num = isnothing(m.captures[2]) ? nothing : parse(Int, m.captures[2])
62+
return (version, dev_num)
63+
end
64+
65+
function should_update_version(base_ver_str, current_ver_str)
66+
base_ver, base_dev = parse_version(base_ver_str)
67+
current_ver, current_dev = parse_version(current_ver_str)
68+
69+
# If versions differ, no update needed
70+
if base_ver != current_ver
71+
return false
72+
end
73+
74+
# If base has dev number, we should increment from the base dev number
75+
if !isnothing(base_dev)
76+
return true
77+
end
78+
79+
# If base has no dev number and current has none, add dev.1
80+
if isnothing(base_dev) && isnothing(current_dev)
81+
return true
82+
end
83+
84+
return false
85+
end
86+
87+
function get_new_version(base_ver_str, current_ver_str)
88+
base_ver, base_dev = parse_version(base_ver_str)
89+
current_ver, current_dev = parse_version(current_ver_str)
90+
91+
# If base has a dev number, increment from that
92+
if !isnothing(base_dev)
93+
return "$(base_ver)-dev.$(base_dev + 1)"
94+
end
95+
96+
# If no dev numbers exist, start with dev.1
97+
return "$(current_ver)-dev.1"
98+
end
99+
100+
function check_and_update_version()
101+
# Get the base branch version
102+
base_content = read(pipeline(`git show origin/$(base_branch):Project.toml`), String)
103+
# Get current branch version
104+
current_content = read(joinpath(pwd(), "Project.toml"), String)
105+
106+
# Extract versions using regex
107+
version_pattern = r"version = \"(.*?)\""
108+
base_version = match(version_pattern, base_content).captures[1]
109+
current_version = match(version_pattern, current_content).captures[1]
110+
111+
println("Base version: $base_version")
112+
println("Current version: $current_version")
113+
114+
if should_update_version(base_version, current_version)
115+
println("Version needs updating")
116+
117+
new_version = get_new_version(base_version, current_version)
118+
119+
# Update the file
120+
new_content = replace(current_content,
121+
"version = \"$current_version\"" =>
122+
"version = \"$new_version\"")
123+
124+
write(joinpath(pwd(), "Project.toml"), new_content)
125+
126+
# Commit and push the change
127+
run(`git add $(joinpath(pwd(), "Project.toml"))`)
128+
run(`git commit -m "Bump version to $new_version"`)
129+
run(`git push`)
130+
131+
println("Version updated to $new_version")
132+
else
133+
println("Version already updated")
134+
end
135+
end
136+
137+
check_and_update_version()'

.github/workflows/format_suggestions.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
## [0.4.2] - 2024-12-23
11+
12+
### Added
13+
- Fusion plant optional features for thermal plants (#743).
14+
- Support for reusing the same Gurobi environment for multiple solves when
15+
number of concurrent Gurobi uses is limited (#783).
16+
- Additional long-duration storage constraints to bound state of charge in
17+
non-representative periods (#781).
18+
- New version of `add_similar_to_expression!` to support arrays of `Number`s. (#798)
19+
- New settings flag `LDSAdditionalConstraints` to provide flexibility in
20+
activating new long-duration storage constraints (#781). Can be set in the GenX
21+
settings file (PR #801).
22+
23+
### Changed
24+
- The `charge.csv` and `storage.csv` files now include only resources with
25+
charge and storage variables (#760 and #763).
26+
- Deduplicated docs on optimized scheduled maintenance for thermal resources (#745).
27+
- Removed the `CapRes_*` columns from `Network.csv` since they were not being used (#784).
28+
29+
### Fixed
30+
- Add constraint to ensure that electricity charged from the grid cannot exceed
31+
the charging capacity of the storage component in VRE_STOR (#770).
32+
- Update `getproperty` function for vectors of resources to ensure compatibility
33+
with Julia v1.11 (#785).
34+
- Fixed cost calculation in `write_costs.jl` when no resources are present in
35+
a zone. (#796)
36+
- Added `eTotalCMaxCapSlack` to calculation of `cUnmetPolicyPenalty` in
37+
`write_costs.jl` (#806).
38+
1039
## [0.4.1] - 2024-08-20
1140

1241
### Added

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ authors:
5454
given-names: "Qingyu"
5555
orcid: "https://orcid.org/0000-0003-2692-5135"
5656
title: "GenX"
57-
version: 0.4.1
57+
version: 0.4.2
5858
doi: 10.5281/zenodo.10846070
5959
date-released: 2024-04-26
6060
url: "https://github.com/GenXProject/GenX.jl"

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GenX"
22
uuid = "5d317b1e-30ec-4ed6-a8ce-8d2d88d7cfac"
33
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"]
4-
version = "0.4.1"
4+
version = "0.4.2"
55

66
[deps]
77
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ that incorporates several state-of-the-art practices in electricity system plann
1313
The model was [originally developed](https://energy.mit.edu/publication/enhanced-decision-support-changing-electricity-landscape/) by
1414
[Jesse D. Jenkins](https://mae.princeton.edu/people/faculty/jenkins) and
1515
[Nestor A. Sepulveda](https://energy.mit.edu/profile/nestor-sepulveda/) at the Massachusetts Institute of Technology and is now jointly maintained by
16-
[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)).
16+
[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)).
1717

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

4141
## Requirements
4242

43-
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.
43+
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.
4444
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.
4545

4646
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.

docs/make.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ pages = OrderedDict(
7272
"Thermal" => [
7373
"Thermal" => "Model_Reference/Resources/thermal.md",
7474
"Thermal Commit" => "Model_Reference/Resources/thermal_commit.md",
75-
"Thermal No Commit" => "Model_Reference/Resources/thermal_no_commit.md"
75+
"Thermal No Commit" => "Model_Reference/Resources/thermal_no_commit.md",
76+
"Scheduled maintenance for Thermal Commit" => "Model_Reference/Resources/maintenance.md",
77+
"Fusion" => "Model_Reference/Resources/fusion.md"
7678
],
7779
"Hydrogen Electrolyzers" => "Model_Reference/Resources/electrolyzers.md",
78-
"Scheduled maintenance for various resources" => "Model_Reference/Resources/maintenance.md",
7980
"Resource types" => "Model_Reference/Resources/resource.md"
8081
],
81-
"Maintenance" => "Model_Reference/maintenance_overview.md",
8282
"Policies" => "Model_Reference/policies.md",
8383
"Solver Configurations" => "Model_Reference/solver_configuration_api.md",
8484
"Inputs Functions" => "Model_Reference/load_inputs.md",

docs/src/Model_Concept_Overview/model_notation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ $\mathcal{W} \subseteq \mathcal{G}$ | where $\mathcal{W}$ set of hydroelectric g
135135
|$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}$ |
136136
|$\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 |
137137
|$\Phi_{l,t} \in \mathbb{R}_+$ | Power flow in line $l$ at time step $t$ \[MWh\]|
138-
|$\theta_{z,t} \in \mathbb{R}$ | Volta phase angle in zone $z$ at time step $t$ \[radian\]|
139-
|$v_{y,z,t}$ | Commitment state of the generation cluster $y$ in zone $z$ at time $t$|
140-
|$\mathcal{X}_{y,z,t}$ | Number of startup decisions, of the generation cluster $y$ in zone $z$ at time $t$|
138+
|$\theta_{z,t} \in \mathbb{R}$ | Voltage phase angle in zone $z$ at time step $t$ \[radian\]|
139+
|$\nu_{y,z,t}$ | Commitment state of the generation cluster $y$ in zone $z$ at time $t$|
140+
|$\chi_{y,z,t}$ | Number of startup decisions, of the generation cluster $y$ in zone $z$ at time $t$|
141141
|$\zeta_{y,z,t}$ | Number of shutdown decisions, of the generation cluster $y$ in zone $z$ at time $t$|
142142
|$\mathcal{Q}_{o,n} \in \mathbb{R}_+$ | Inventory of storage of type $o$ at the beginning of input period $n$ \[MWh]|
143143
|$\Delta\mathcal{Q}_{o,m} \in \mathbb{R}$ | Excess storage inventory built up during representative period $m$ \[MWh]|

0 commit comments

Comments
 (0)