You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
absolute paths in currentdir (conditionmanager) #178
Sometimes, instead of changing to a directory via os.chdir(), I set the current directory of the control manager to an absolute path. This is especially helpful when copying models from one directory to another.
However, it is not intended for absolute paths to be used. When condition files are saved, the control file that is generated is linked in the control check. In the case of absolute paths, this should be a raw string, but it is not.
As an example: This is part of the condition file as an outcome of setting absolute paths in the control manager:
Model.save_conditions could then use the first version if pub.controlmanager.currentdir is a simple directory name or a complete path that points to the "normal" location of condition files. And it could use the second version if pub.controlmanager.currentdir is a full path pointing to a "special" location.
There are likely cases where this heuristic would not yield the desired results. Users may sometimes be unsure if and how they will move directories later. So, we should probably also add something like an omit_controlcheck option to Model.save_conditions and HydPy.save_conditions.
Activity
tyralla commentedon Jan 20, 2026
I am unsure about the desired behaviour. I think
controlcheckcurrently only works for the standard project directory structure.Maybe we could support two different signatures:
Model.save_conditionscould then use the first version ifpub.controlmanager.currentdiris a simple directory name or a complete path that points to the "normal" location of condition files. And it could use the second version ifpub.controlmanager.currentdiris a full path pointing to a "special" location.There are likely cases where this heuristic would not yield the desired results. Users may sometimes be unsure if and how they will move directories later. So, we should probably also add something like an
omit_controlcheckoption toModel.save_conditionsandHydPy.save_conditions.Any objections?