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

Add globals and kwargs to Workflow and Job #113

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

noahfpf
Copy link
Contributor

@noahfpf noahfpf commented Jul 10, 2024

Add globals to Workflow and Job

For shared functionality across Workflow classes that depends on some variable
data, it's useful to have named parameters for the Workflow that are
automatically forwarded to all Job instances.

This commit adds a globals keyword arg to the Workflow initializer, which
should be a hash that is then stored in a globals hash attribute, is
persisted, and is merged into the params sent to each Job instance.

Add kwargs to Workflow

For workflows that take a larger number of parameters or optional parameters,
it's useful to specify these as keyword arguments rather than positional ones.

This commit adds support to Workflow#initialize for kwargs, and stores them
in a new kwargs attribute.

For shared functionality across Workflow classes that depends on some variable
data, it's useful to have named parameters for the Workflow that are
automatically forwarded to all Job instances.

This commit adds a `globals` keyword arg to the Workflow initializer, which
should be a hash that is then stored in a `globals` hash attribute, is
persisted, and is merged into the `params` sent to each Job instance.
For workflows that take a larger number of parameters or optional parameters,
it's useful to specify these as keyword arguments rather than positional ones.

This commit adds support to `Workflow#initialize` for kwargs, and stores them
in a new `kwargs` attribute.
@pokonski
Copy link
Contributor

Thank you for this, this is a good idea!

@pokonski pokonski merged commit 68bc23f into chaps-io:master Jul 17, 2024
12 checks passed
@noahfpf noahfpf deleted the workflow-kwargs branch August 1, 2024 18:00
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.

3 participants