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

Create replace_tmpl filter for Jinja2 #33

Merged
merged 8 commits into from
Jun 14, 2024

Conversation

DavidNew-NOAA
Copy link
Contributor

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

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

ATM JJOB tests in GDASApp on Orion

  • pynorms
  • pytests

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes need updates to the documentation. I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • Any dependent changes have been merged and published

Copy link

codecov bot commented Jun 13, 2024

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 ⚠️
Additional details and impacted files
@@             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              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/wxflow/template.py Outdated Show resolved Hide resolved
src/wxflow/jinja.py Outdated Show resolved Hide resolved
Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

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

looks good.

@aerorahul aerorahul merged commit f6938c7 into NOAA-EMC:develop Jun 14, 2024
9 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.

None yet

2 participants