Skip to content

Comments

Fix Stale Python OS Environment when EWTS runs with ngen.#96

Merged
cmaynard-ngwpc merged 1 commit intodevelopmentfrom
cmaynard_NGWPC-9804_fix_missing_os_env_var
Feb 18, 2026
Merged

Fix Stale Python OS Environment when EWTS runs with ngen.#96
cmaynard-ngwpc merged 1 commit intodevelopmentfrom
cmaynard_NGWPC-9804_fix_missing_os_env_var

Conversation

@cmaynard-ngwpc
Copy link

@cmaynard-ngwpc cmaynard-ngwpc commented Feb 12, 2026

ngen ( C++ ) is calling setenv() after Python has already initialized os.environ, and Python’s os.environ mapping is not automatically refreshed when the environment is mutated from C/C++ to run python code with ngen.

Python keeps an internal view of the environment that includes things set before Python started (like NGEN_RESULTS_DIR), but not variables injected later from C++ (like NGEN_LOG_FILE_PATH and _LOGLEVEL).

Added a helper method to ensure the Python os environment is not stale when ngen-focing BMI runs.

Merging this to development because the release being delivered on February 25, 2026 does not include BMI Forcing and this only is an issue when running ngen with BMI Forcing.

@cmaynard-ngwpc cmaynard-ngwpc force-pushed the cmaynard_NGWPC-9804_fix_missing_os_env_var branch from 188fc67 to b61e448 Compare February 18, 2026 20:23
Copy link

@kyle-larkin kyle-larkin left a comment

Choose a reason for hiding this comment

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

This makes sense, and the helper seems pretty straightforward.

@cmaynard-ngwpc cmaynard-ngwpc merged commit 757c6c0 into development Feb 18, 2026
6 checks passed
@cmaynard-ngwpc cmaynard-ngwpc deleted the cmaynard_NGWPC-9804_fix_missing_os_env_var branch February 18, 2026 20:32
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