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 a helper function to prepare the inputs #103

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

superstar54
Copy link
Contributor

This PR refactors the launch_shell_job function by extracting the input preparation logic into a new helper function, prepare_shell_job_inputs. The launch_shell_job function now calls this helper function to prepare the inputs before submitting or running the job. This allows others to reuse the input preparation logic elsewhere if needed.

Use case:
In aiida-workgraph, we use the prepare_for_shell_task function to prepare inputs for the ShellJob task, as in the launch_shell_job. The challenge, however, is that we need to keep the prepare_for_shell_task function up to date with any changes made to launch_shell_job. By extracting the input logic into prepare_shell_job_inputs, we can now directly reuse this function in aiida-workgraph, ensuring consistency.

Move the input preparation logic into a separate function called prepare_shell_job_inputs
src/aiida_shell/launch.py Outdated Show resolved Hide resolved
Copy link
Owner

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @superstar54

@sphuber sphuber merged commit cc72abd into sphuber:master Sep 18, 2024
6 checks passed
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.

2 participants