Skip to content

Refactor generate_script function and put relevant parts in a header #92

Open

Description

@corentincarton

Is your feature request related to a problem? Please describe.

The generate_script function should be refactored to be more modular: https://github.com/ecmwf/pyflow/blob/develop/pyflow/nodes.py#L1412

Describe the solution you'd like

A nice improvement could be to put all the header into an include to hide the redundant information from user (most of the header is the same for all tasks).

Describe alternatives you've considered

No response

Additional context

No response

Organisation

No response

Activity

  1. added
    enhancement
    on Dec 4, 2025
  2. corentincarton commented on Dec 4, 2025

    @corentincarton
    CollaboratorAuthor

    We could do the following for instance:

    
    #!/bin/bash
    
    #TROIKA ....
    
    # custom exit/cleanup code
    exit_hook () {
        echo "cleaning up ...."
    }
    
    %include<trap.h>
    
    export MYVAR=...
    ...
    
    %nopp
    ...
    %end
    
    %include<exit.h>
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions