Skip to content

Update Julia Solver Dependencies and NLR API Key Environment Variables - #729

Open
Bill-Becker wants to merge 5 commits into
masterfrom
update-julia-deps-aug26
Open

Update Julia Solver Dependencies and NLR API Key Environment Variables#729
Bill-Becker wants to merge 5 commits into
masterfrom
update-julia-deps-aug26

Conversation

@Bill-Becker

Copy link
Copy Markdown
Collaborator

This pull request makes two unrelated updates:

  1. Upgrades several dependencies in the Julia environment (julia_src folder) for the optimization solver stack (HiGHS, JuMP, MathOptInterface). We had found peculiar optimization results for a scenario with tiered rates where it was solving with a negative NPV of larger magnitude than the tolerance. The solver stack upgrade fixed it. It also removes some unused dependencies.
  2. Environment variable names related to the NREL/NLR developer API key and email. The changes help align the API codebase with new naming conventions of REopt.jl API key environment variable names.

Environment variable renaming:

  • Changed all references of NREL_DEVELOPER_API_KEY and NREL_DEVELOPER_EMAIL to NLR_DEVELOPER_API_KEY and NLR_DEVELOPER_EMAIL in the julia_src dirctory .env file and http.jl which uses that. This affects how API keys and emails are loaded and set for requests. [1] [2] [3] [4]

Dependency updates and removals:

  • Upgraded key dependencies in Manifest.toml, including HiGHS (from 1.15.0 to 1.24.1), HiGHS_jll, JuMP (from 1.25.0 to 1.31.1), and MathOptInterface (from 1.39.0 to 1.52.0), and added new dependencies such as MathOptIIS. [1] [2] [3]
  • Removed unused dependencies: BenchmarkTools, JSON3, Profile, and StructTypes from Manifest.toml, cleaning up the dependency tree. [1] [2] [3] [4]

@Bill-Becker
Bill-Becker marked this pull request as ready for review August 14, 2026 15:56
@Bill-Becker
Bill-Becker requested review from hdunham and a lite review from Copilot August 14, 2026 15:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Julia-side solver environment to newer versions (HiGHS/JuMP/MathOptInterface stack) and renames internally-used developer credential environment variables from NREL_* to NLR_* within julia_src, aligning with updated REopt.jl conventions.

Changes:

  • Upgrade Julia solver stack dependencies and adjust the dependency graph in julia_src/Manifest.toml (including adding MathOptIIS and removing some previously-used packages).
  • Rename internal developer key/email environment variables used by the Julia HTTP server (julia_src/http.jl) and its .env.
  • Record the changes in CHANGELOG.md under v3.22.1.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
julia_src/Manifest.toml Upgrades solver stack packages (HiGHS/JuMP/MOI) and updates dependency resolution.
julia_src/http.jl Renames env var usage for developer key/email and continues request-time key handling logic.
julia_src/.env Renames env vars for local/default Julia server configuration.
CHANGELOG.md Adds a v3.22.1 entry documenting the solver/env-var updates.
Suppressed comments (1)

julia_src/http.jl:916

  • Same concurrency issue as /reopt: mutating global ENV["NLR_DEVELOPER_API_KEY"] inside the request handler can leak keys across concurrent requests. Prefer passing request-specific credentials explicitly (or otherwise isolating them) rather than relying on a process-global env var.
        if !isempty(get(d, "api_key", ""))
            ENV["NLR_DEVELOPER_API_KEY"] = pop!(d, "api_key")
        else
            ENV["NLR_DEVELOPER_API_KEY"] = test_nlr_developer_api_key
            delete!(d, "api_key")
        end

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread julia_src/http.jl
Comment on lines +8 to +10
const test_nlr_developer_api_key = ENV["NLR_DEVELOPER_API_KEY"]

ENV["NREL_DEVELOPER_EMAIL"] = "reopt@nlr.gov"
ENV["NLR_DEVELOPER_EMAIL"] = "reopt@nlr.gov"
Comment thread julia_src/.env
Comment on lines +1 to +2
NLR_DEVELOPER_API_KEY="gAfosXcQ9Ldfw3qXqvKVb7PxMEkYigozmC9R3mXQ"
NLR_DEVELOPER_EMAIL="reopt@nlr.gov" No newline at end of file
Comment thread julia_src/http.jl
Comment on lines 63 to 67
if !isempty(get(d, "api_key", ""))
ENV["NREL_DEVELOPER_API_KEY"] = pop!(d, "api_key")
ENV["NLR_DEVELOPER_API_KEY"] = pop!(d, "api_key")
else
ENV["NREL_DEVELOPER_API_KEY"] = test_nrel_developer_api_key
ENV["NLR_DEVELOPER_API_KEY"] = test_nlr_developer_api_key
delete!(d, "api_key")
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