adding path to the further_reading in runscripts #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request (must be used together with the correspondig PR in the
esm_runscripts
esm-tools/esm_runscripts#162)solves the issue when
further_reading
contains a relative path. Normally, on the release branch this does not work in a user runscript:where
fesom_output_control.yaml
is inside theoutput
directory under where the runscript resides.Unfortunately, initially the
further_reading
is not very robustly implemented in theesm_tools
. Check these. These are the all occurences offurther_reading
in all YAML filesThese are neither absolute nor relative paths. For this reason the functions have strange interfaces:
def look_for_file(model, item, all_config=None)
but it is called aslook_for_file(path, attach_value, all_config=all_config)
Although I have a more robust idea to solve this, just for the sake of time I implemented an easier solution.
Solution:
Determine the type of the
path
expression. Is it a path like in thefurther_reading: foo.yaml
)It then contructs the correct path and passes to the
look_for_file
.A separate change should also be implemented to the
esm_runscripts
since after resolving the sources now we also need to update the targets. No matter where thefurther_reading
file resides in the home directory, they should always go to<EXPDIR>/run_20010101-20011231/scripts/fesom_output_control.yaml
<EXPDIR>./scripts/fesom_output_control.yaml
I tested these cases
further_reading
formatrun command:
esm_runscripts fesom2-ollie-initial-yearly.yaml -e further_reading_test_1 --check
I compared the test 2,3,4 against test_1 (reference) with both
diff
and diff tree. Eg.diff -qr further_reading_test_1 further_reading_test_4
tree further_reading_test_4 > tree_further_reading_test_4
vimdiff tree_further_reading_test_1 tree_further_reading_test_4
The output of the comparison 1 is something like
Output of the comparison 2 is something like
As you can see that the experiment tree structure is completely preserved and there are not differences in the copied files.