Skip to content

hydra.job.chdir from python script #2384

Answered by Jasha10
dagap asked this question in Q&A
Discussion options

You must be logged in to vote

Indeed, hydra.job.chdir does not have any effect when used with the compose API; it is only relevant for the hydra.main API.
The motivation for this difference is that compose is supposed to be a pure function, while hydra.main is not a pure function and is has side-effects (such as performing a chdir operation).
When using the compose API, my recommendation would be to manually change the working directory in your user code (e.g. by calling os.chdir).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dagap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants