Skip to content

Commit

Permalink
Updated de minimis rate regex to allow for processing more rate relat… (
Browse files Browse the repository at this point in the history
#3196)

* Updated de minimis rate regex to allow for processing more rate related response

* Update backend/census_historical_migration/workbooklib/notes_to_sefa.py

Co-authored-by: Phil Dominguez <[email protected]>

* Update backend/census_historical_migration/workbooklib/notes_to_sefa.py

Co-authored-by: Phil Dominguez <[email protected]>

* More regex for minimis rate pattern

* Removed redundant pattern

* Fixed pattern to ensure it covers deleted pattern

---------

Co-authored-by: Phil Dominguez <[email protected]>
  • Loading branch information
sambodeme and phildominguez-gsa authored Jan 12, 2024
1 parent e7dc08e commit 577fd96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ def test_rate_not_used(self):
),
"N",
)
self.assertEqual(
xform_is_minimis_rate_used(
"There are no additional indirect costs allocated to the Corporation."
),
"N",
)

def test_rate_with_multiple_spaces(self):
"""Test that the function returns the correct results when the rate is used and there are multiple spaces between words."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,17 @@ def xform_is_minimis_rate_used(rate_content):
r"not\s+opt\s+to\s+use",
r"not\s+us(e|ed)",
r"not\s+elec(t|ted)",
r"has\s+not\s+charged.*not\s+applicable",
r"not\s+applicable",
r"has\s+elected\s+not",
r"did\s+not\s+charge\s+indirect\s+costs",
r"did\s+not\s+make\s+an\s+election",
r"not\s+eligible\s+to\s+use",
r"made\s+no\s+inderect\s+cost\s+rate\s+election",
r"rather\s+than\s+the\s+10%",
r"no\s+additional\s+indirect\s+costs",
r"(rate|costs)\s+does\s+not\s+apply",
r"not\s+based\s+on\s+eligible\s+costs",
r"no\s+indirect\s+costs?",
r"not\s+utilized\s+the\s+10%",
]

# Patterns that indicate the de minimis rate WAS used
Expand All @@ -84,6 +88,7 @@ def xform_is_minimis_rate_used(rate_content):
r"has\s+adopted",
r"elected\s+to",
r"is\s+subject\s+to\s+the\s+10-percent",
r"utilized\s+the\s+10%",
]

# Check for each pattern in the respective lists
Expand Down

0 comments on commit 577fd96

Please sign in to comment.