Skip to content

Fix #934: expand environment variables in include file paths - #1425

Open
mchamberland wants to merge 2 commits into
nrc-cnrc:developfrom
mchamberland:fix/include-file-egsExpandPath
Open

Fix #934: expand environment variables in include file paths#1425
mchamberland wants to merge 2 commits into
nrc-cnrc:developfrom
mchamberland:fix/include-file-egsExpandPath

Conversation

@mchamberland

Copy link
Copy Markdown
Contributor

Fixes #934.

Applies egsExpandPath() when opening include file paths in addContentFromFile() and inline include-file handling, matching behaviour of other egs++ file-path inputs (e.g. spectrum files, beam sources).

After this change, paths such as $EGS_HOME/egs_brachy/lib/geometry/my.geom or %HEN_HOUSE%/pegs4/data/521icru.pegs4dat work in include file statements. Only the first environment variable is expanded; it must be followed by / or \.

Documentation added to PIRS-898 common input syntax (common.doxy).

Made with Cursor

Apply egsExpandPath() when opening include file paths in
addContentFromFile() and inline include file handling, matching
behaviour of other egs++ file-path inputs. Document syntax in PIRS-898.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mchamberland

Copy link
Copy Markdown
Contributor Author

Follow-up commit: pegsless material data file and density correction file now call existing Fortran replace_env() (same mechanism as dosxyznrc/beamnrc spectrum paths). PIRS-898 docs updated.

Call existing Fortran replace_env() before opening material data
and density correction files in get_media_inputs.mortran. Document
material data file env-var syntax in PIRS-898 (extends nrc-cnrc#934).

Co-authored-by: Cursor <cursoragent@cursor.com>
@mchamberland
mchamberland force-pushed the fix/include-file-egsExpandPath branch from d5a17de to 0b5c486 Compare June 22, 2026 02:04
@mchamberland

mchamberland commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Commit d5a17de accidentally copied get_media_inputs.mortran (and an older common.doxy) from the CLRP fork onto develop, reverting newer pegsless media documentation and other develop-only changes. That was a packaging mistake, not intentional.

Fixed: force-pushed 0b5c4866 — only +2 lines in get_media_inputs.mortran (call replace_env for material data file and density correction file) and a +1 sentence in PIRS-898. All develop media-definition docs are preserved.

@ftessier ftessier added this to the Release 2027 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants