Skip to content

fix: the config decides where its results go - #6

Merged
sotashimozono merged 1 commit into
mainfrom
fix/outdir-belongs-to-the-config
Sep 8, 2026
Merged

sotashimozono merged 1 commit into
mainfrom
fix/outdir-belongs-to-the-config

Conversation

@sotashimozono

Copy link
Copy Markdown
Member

Every driver did this:

const OUTDIR = get(ENV, "DATAVAULT_OUTDIR", joinpath(@__DIR__, "..", "out"))
vault = DataVault.Vault(CONFIG; run="phase1", outdir=OUTDIR)

Vault already resolves outdir itself:

resolved = if outdir !== nothing        # keyword
    string(outdir)
elseif haskey(ENV, "DATAVAULT_OUTDIR")  # environment
    ENV["DATAVAULT_OUTDIR"]
else
    spec.study.outdir                   # the config
end

A keyword wins, so passing one made the config's own [study] outdir permanently unreachable.
The comment above the line said "outdir precedence (DataVault resolves it): kwarg > ENV > config"
while the next line took the decision away from it. The documented order was "environment beats
config"; the real order was "the script beats everything".

Measured, both directions

DATAVAULT_OUTDIR unset    ->  out/data/example/phase1/       the config's [study] outdir
DATAVAULT_OUTDIR=/tmp/x   ->  /tmp/x/data/example/phase1/    the environment overriding it

The first of those could not happen before this change.

The drivers now pass run= only, and say why in a comment where the temptation is.

Every driver computed `OUTDIR` from the environment and handed it to `DataVault.Vault` as a keyword.
`Vault` already resolves that itself — keyword, then `DATAVAULT_OUTDIR`, then the config's `[study]
outdir` — and a keyword wins, so passing one made the config's own setting permanently unreachable.
The comment above the line said "outdir precedence (DataVault resolves it)" while the next line took
the decision away from it.

The drivers now pass `run=` only. Measured both directions, which is the point of the change:

    DATAVAULT_OUTDIR unset      -> out/data/example/phase1/     (the config's [study] outdir)
    DATAVAULT_OUTDIR=/tmp/x     -> /tmp/x/data/example/phase1/  (the environment overriding it)

Before, the second worked and the first could not: the documented order was "environment beats
config", the real order was "the script beats everything".
@github-actions github-actions Bot added the bug Something isn't working label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

📚 Docs preview: https://qatlashub.github.io/templateHPC.jl/previews/PR6/

(updates on each push to this PR)

@sotashimozono
sotashimozono merged commit 5733f7c into main Sep 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant