Skip to content

Use Jinja2 to generate job scripts #338

Closed

Description

@wtbarnes

Currently, each job script is generated by a combination of old-style (i.e. not f-strings) string interpolation and joining of lists of strings. Using a templating language like Jinja would simplify this approach and offload the string formatting to a separate file.

It looks like the possibility of using jinja2 was discussed in #321 and #133. Is there a consensus on whether this is a good idea? It would certainly clean up some of the code, but maybe at the cost of readability as it would offload a lot of the logic (e.g. whether to include certain flags/options) to a different file.

If there's interest in this approach, I'd be happy to take a crack at it.

Activity

  1. lesteve commented on Sep 11, 2019

    @lesteve
    Member

    I think the consensus is that there is definitely an interest in using Jinja2 and we would certainly welcome an attempt to do it.

    I would advise waiting for #307 (refactoring to use SpecCluster) to be merged before having a go at it. I would expect this is a matter of days before we can merge this in master.

    I am going to close this issue in favour of #133. If you can post a comment in #133 to say you are interested to work on this, it would be great.

    Side-comment: we are still supporting Python 3.5 so we can not use f-strings.

  2. wtbarnes commented on Sep 11, 2019

    @wtbarnes
    MemberAuthor

    Thanks for the feedback @lesteve.

    I would advise waiting for #307 (refactoring to use SpecCluster) to be merged before having a go at it. I would expect this is a matter of days before we can merge this in master.

    For some reason I thought this had already been merged. I'll definitely wait on that. I'm not in a huge hurry!

    I am going to close this issue in favour of #133. If you can post a comment in #133 to say you are interested to work on this, it would be great.

    Will do

    Side-comment: we are still supporting Python 3.5 so we can not use f-strings.

    I figured as much.

  3. lesteve commented on Sep 25, 2019

    @lesteve
    Member

    I would advise waiting for #307 (refactoring to use SpecCluster) to be merged before having a go at it. I would expect this is a matter of days before we can merge this in master.

    FYI #307 has been merged. If you want to consider working on this again, that'd be great.

    If you are looking for smaller issues to work on, #332 could be a good one to get started. Other than this #122 would be a great one to get to the bottom of. In particular having a snippet to reproduce the problem would be a great start (see #122 (comment) for what I would try).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions