-
Notifications
You must be signed in to change notification settings - Fork 26
Resolve relative path relative to osw file #1965
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,7 +112,7 @@ def run(model, runner, user_arguments) | |
| Model.reset(runner, model) | ||
|
|
||
| args = runner.getArgumentValues(arguments(model), user_arguments) | ||
| set_file_paths(args) | ||
| set_file_paths(runner, args) | ||
|
|
||
| begin | ||
| hpxml = create_hpxml_object(runner, args) | ||
|
|
@@ -177,16 +177,16 @@ def run(model, runner, user_arguments) | |
| # | ||
| # @param args [Hash] Map of :argument_name => value | ||
| # @return [nil] | ||
| def set_file_paths(args) | ||
| def set_file_paths(runner, args) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add to method documentation above |
||
| if not (Pathname.new args[:hpxml_path]).absolute? | ||
| args[:hpxml_path] = File.expand_path(args[:hpxml_path]) | ||
| args[:hpxml_path] = File.join(runner.workflow.absoluteRootDir.to_s, args[:hpxml_path]) | ||
| end | ||
| if not File.exist?(args[:hpxml_path]) && args[:hpxml_path].downcase.end_with?('.xml') | ||
| fail "'#{args[:hpxml_path]}' does not exist or is not an .xml file." | ||
| end | ||
|
|
||
| if not (Pathname.new args[:output_dir]).absolute? | ||
| args[:output_dir] = File.expand_path(args[:output_dir]) | ||
| args[:output_dir] = File.join(runner.workflow.absoluteRootDir.to_s, args[:output_dir]) | ||
| end | ||
|
|
||
| if File.extname(args[:annual_output_file_name]).length == 0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,8 +6,8 @@ | |
| "steps": [ | ||
| { | ||
| "arguments": { | ||
| "hpxml_path": "../../sample_files/base.xml", | ||
| "output_dir": "..", | ||
| "hpxml_path": "sample_files/base.xml", | ||
| "output_dir": "run", | ||
|
Comment on lines
+9
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I completely agree that the Can
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It has to match the "run_directory" argument above (in line 2). If run_directory is not specified, it defaults to "run" and output_dir has to be "run" in that case. I think we should just remove this argument from the measure. We can find out the run_directory using
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We can't remove it, it is one of the most commonly used arguments (e.g.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can still allow run_simulation.rb to have output dir. Looks like the current behavior is that it creates a my_output_dir/run folder and places the results there. We can replicate this without needing the output_dir parameter for the measure. |
||
| "debug": false, | ||
| "add_component_loads": false, | ||
| "skip_validation": false, | ||
|
|
||
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.
runner.workflow.absoluteRootDir: this will resolve to '.'. '.' is the location defined as the root key inside the workflow.osw, or if not specified the location of the workflow.osw itself