Add support for non-merlin blocks in specification file
Adding capability for non-user blocks of yaml code to be included in the merlin specification, and propegated to the .partial and .expanded versions at runtime. This allows the users to define yaml specifications for steps in the workflow in the same file, and for user code to perform consistency checks between the merlin spec and code in the steps - for example, checking consistency between variable names, etc.
A new "user" block has been added to the MerlinSpec class in spec/specification.py. The user block is not included in any checking and does not have default values. The yaml code has shell and merlin parameters substituted and is copied to the working directories verbatim.
Changelog:
- Added a static method
load_user_blockto theMerlinSpecclass, which loads theuserblock from the yaml specification and returns the python representation - In functions
load_specificationandload_spec_from_string, added definitions ofself.userthrough calls toload_user_block - In the
yaml_sectionsandsectionsproperties, added references toself.user - In the
dict_to_stringmethod ofMerlinSpecobject, adduserblock support for pretty printing of lists
When no user block is present in the yaml file, the MerlinSpec.user attribute is an empty dictionary
Test Functionality:
- correct generation of problems in
merlintest problems (with-cleanoption) - correct generation of problems and variable substitution when a
userblock is added to the test problems (with-cleanoption) - complete execution of
merlintest problems
Please change PR to go into develop, not main
—— J. Luc Peterson, PhD (he/him) LLNL @.***
On Jun 14, 2022, at 4:52 PM, Jim Gaffney @.***> wrote:
You can view, comment on, or merge this pull request online at:
https://github.com/LLNL/merlin/pull/367https://urldefense.us/v3/__https://github.com/LLNL/merlin/pull/367__;!!G2kpM7uM-TzIFchu!i644q1r4nZzXEjKdJMBhHmGKtg1ACsfnbyzV5clipOtdI1UH1yQc-DhtVdzO8DQULwQ$
Commit Summary
- cd603e4https://urldefense.us/v3/__https://github.com/LLNL/merlin/pull/367/commits/cd603e4100099f8d50497b754bd005f259092266__;!!G2kpM7uM-TzIFchu!i644q1r4nZzXEjKdJMBhHmGKtg1ACsfnbyzV5clipOtdI1UH1yQc-DhtVdzO4ch-hn4$ initial working example with a single "user" block
File Changes
- M merlin/spec/specification.pyhttps://urldefense.us/v3/__https://github.com/LLNL/merlin/pull/367/files*diff-21d22c6bc760d710e66ee1b3d71760b4ff39bf3ce6374424056f4d0a98b304f6__;Iw!!G2kpM7uM-TzIFchu!i644q1r4nZzXEjKdJMBhHmGKtg1ACsfnbyzV5clipOtdI1UH1yQc-DhtVdzOW_IWUlY$ (21)
Patch Links:
- https://github.com/LLNL/merlin/pull/367.patchhttps://urldefense.us/v3/__https://github.com/LLNL/merlin/pull/367.patch__;!!G2kpM7uM-TzIFchu!i644q1r4nZzXEjKdJMBhHmGKtg1ACsfnbyzV5clipOtdI1UH1yQc-DhtVdzO192Q1VU$
- https://github.com/LLNL/merlin/pull/367.diffhttps://urldefense.us/v3/__https://github.com/LLNL/merlin/pull/367.diff__;!!G2kpM7uM-TzIFchu!i644q1r4nZzXEjKdJMBhHmGKtg1ACsfnbyzV5clipOtdI1UH1yQc-DhtVdzOtik0F8E$
— Reply to this email directly, view it on GitHubhttps://urldefense.us/v3/__https://github.com/LLNL/merlin/pull/367__;!!G2kpM7uM-TzIFchu!i644q1r4nZzXEjKdJMBhHmGKtg1ACsfnbyzV5clipOtdI1UH1yQc-DhtVdzO8DQULwQ$, or unsubscribehttps://urldefense.us/v3/__https://github.com/notifications/unsubscribe-auth/AAEPYRHL4YYTPVGI5OECE4TVPD5I5ANCNFSM5YZFTDGQ__;!!G2kpM7uM-TzIFchu!i644q1r4nZzXEjKdJMBhHmGKtg1ACsfnbyzV5clipOtdI1UH1yQc-DhtVdzO8GoU30Q$. You are receiving this because you are subscribed to this thread.Message ID: @.***>
OK done
Is there an integration test we can add to make sure it’s working?
Resolved with PR #376