Skip to content
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

Operational options: add initfiles #155

Merged
merged 1 commit into from
Jul 10, 2020
Merged

Conversation

alintulu
Copy link
Member

@alintulu alintulu commented Jun 25, 2020

Add operational option initfiles that people can use in their reana.yaml, similarly to the options initdir and toplevel. initfiles expects an array of files to read the input parameters from.

Example

inputs:
  options:
    initfiles: 
      - workflow/yadage/input_filenames.yml
      - workflow/yadage/input_cross_sections.yml

closes reanahub/reana#305

@@ -53,6 +54,11 @@ def load_yadage_operational_options(ctx, param, operational_options):
operational_options["initdir"] = os.path.join(
workflow_workspace, operational_options.get("initdir", "")
)

operational_options["initfiles"] = operational_options.get("initfiles", [])
for i, initfile in enumerate(operational_options["initfiles"]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally list comprehensions look more complicated than they should, but I feel in this case it would be more illustrative than the explicit loop:

operational_options["initfiles"] = [
    os.path.join(workflow_workspace, initfile) for initfile in operational_options.get("initfiles", [])]

There is no need to change anything if you don't think the same after reading the comment :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually prefer list comprehensions, not sure why I didn't think of it here :) I'll change it.

@diegodelemos
Copy link
Member

All works nicely. Just making Travis pass left :)

@mvidalgarcia
Copy link
Member

All works nicely. Just making Travis pass left :)

I think the travis issue happens because we have checksumdir pinned in reana-commons (checksumdir>=1.1.4,<1.2) and packtivity has it unpinned so it installs 1.2. There're two options:

  • Bump checksumdir version to 1.2 in reana-commons and check that everything works fine.
  • Pin checksumdir in reana-workflow-engine-yadage to be <1.2

@tiborsimko
Copy link
Member

  • Can you please add yourself to the AUTHORS.rst file?

  • Can you leave a one-line note in CHANGES.rst about this change?

@tiborsimko tiborsimko merged commit 31e0912 into reanahub:master Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reana.yaml: parameter array read from file
4 participants