NOAA-EMC / wxflow

Tools for Weather Workflows
https://wxflow.readthedocs.io/en/latest
GNU Lesser General Public License v3.0
0 stars 7 forks source link

Create replace_tmpl filter for Jinja2 #33

Closed DavidNew-NOAA closed 2 months ago

DavidNew-NOAA commented 3 months ago

Description

This PR adds a filter for Jinja2 rendering called replace_tmpl that takes a string and replaces substrings defined in an input dictionary. The motivation is for when we want to replace multiple substrings in a template in the Global Workflow.

This PR also changes the copy() method that creates task_config in the Task class to deepcopy(), since in at least one case in the Global Workflow, a task_config key points to another dictionary.

Type of change

How Has This Been Tested?

ATM JJOB tests in GDASApp on Orion

Checklist

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 48.23%. Comparing base (8566ea3) to head (6a790fc).

Files Patch % Lines
src/wxflow/task.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #33 +/- ## =========================================== + Coverage 48.17% 48.23% +0.06% =========================================== Files 18 18 Lines 1642 1644 +2 Branches 334 335 +1 =========================================== + Hits 791 793 +2 Misses 791 791 Partials 60 60 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.