-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix WorkingDir of Driver.py #1870
Conversation
# If a user chooses to run RAVEN outside of the directory containing the | ||
# xml input file, then we should should change the python working directory | ||
# to the directory containing the input file to avoid confusion. | ||
os.chdir(cwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change just solve part of the problem. Take the test "raven/tests/framework/test_iostep_load.xml" for example (see the following attached screenshot), the files provided by Files using relative path, which I think currently based on the WorkingDir provided by the RunInfo. I think the confusion here is we do not have a consistent way to explain and use the path. The issue #1687 suggest we use the input file folder as the base directory. The following is my suggestion: I think the default behavior is use the input file folder as the base directory and search the files, if the files do not exist, then using the WorkingDir listed in RunInfo as the base directory, if the files are still not found, then use the running directory as the base directory. After trying search all these places, error will be raise if we can not find these files. @dylanjm @Jimmy-INL @joshua-cogliati-inl @PaulTalbot-INL @mandd please let me know what do you think.
@dylanjm Do you have a change to resolve this issue? |
@wangcj05 I'm having trouble finding where we read files in the code that still has access to the RunInfo node. |
@dylanjm the path in the Code.py is assigned in initialize method, the 'subSubDirectory', is it the place that you are looking for? |
@wangcj05 This could be the place I need to add it. My only question is are there files that won't go into Models that we need to check different directories for? Seems like this code is only checking the files that are passed as inputs to a Models block. |
@dylanjm do you by chance have time to fix this issue? |
83d5f2c
to
004da72
Compare
@wangcj05 A few things to note:
This fix allows users to run RAVEN from whichever directory they'd like but keeps the expected output the same no matter what. As long as users specify their files relative to the working directory. I may be missing something, so I'm open to any feedback you have on the matter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good.
Checklist is good, and tests are green. PR can be merged. @dylanjm Thanks for your contribution. |
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
#1033
close #1687
What are the significant changes in functionality due to this change request?
No significant changes. RAVEN will now adjust its working directory to be wherever the input file is pointed.
For example, before this would break raven:
Now it doesn't.
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.
<internalParallel>
to True.raven/tests/framework/user_guide
andraven/docs/workshop
) have been changed, the associated documentation must be reviewed and assured the text matches the example.