EnergySystemsModellingLab/MUSE2

Disallow running models from within output dir

Open

#1,299 opened on May 20, 2026

View on GitHub
 (1 comment) (0 reactions) (1 assignee)Rust (3 forks)auto 404
good first issue

Repository metrics

Stars
 (7 stars)
PR merge metrics
 (PR metrics pending)

Description

After #1282 There was a concern about running models from within the results folder and accidentally deleting the input files before the model has a chance to load. See below.

I think it was suggested that the safest way to avoid this would be to disallow running models from within results_root. We'd have to make an allowance for the reproduce command if we do #1289.


The other concern about running the input files from the results folder is that, since the name of the model will match the name of the results folder you're running it from, then if --overwrite is set to true, running this model will delete the original output files, which is probably not what you want! Further, it would delete the input files themselves so I think you wouldn't actually be able to do it unless we reorder the events in handle_run_command. You could get around this by setting --output-dir, but this is still quite a dangerous trap.

At least with the --reproduce option we could ensure that this doesn't happen

Originally posted by @tsmbland in https://github.com/EnergySystemsModellingLab/MUSE2/pull/1282#discussion_r3233774972

Contributor guide