-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/pdct 1418 Map GCF event data to new json structure (#11)
* Add raise in docstring for verify_required_fields_present * Add make command to run tests under coverage * Update docstrings & return types * Add make command for generating coverage html report * Fix comment * Declare empty df to return at end of function * Remove unused code * Remove unused code * Remove old assertion * Add output file to git ignore * Dump JSON to file with error handling * Update cspell.json * WIP for generating the mapping for GCF events data * DRY: Break event function into smaller functions * Bump to 0.1.8 * Move event enums into separate file * Use verbose pytest * Create tests for initialise_event_counter * Update cspell.json * Create test_append_event.py * Create test_check_event_dates.py * Create test_process_event.py * Fix test_event tests
- Loading branch information
1 parent
bab7919
commit cf13a5e
Showing
18 changed files
with
528 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,3 +174,6 @@ plugins | |
user_trunk.yaml | ||
user.yaml | ||
tmp | ||
|
||
# Output files | ||
output.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from collections import namedtuple | ||
from enum import Enum | ||
|
||
Event = namedtuple("event", ["name", "type", "column_name"]) | ||
|
||
|
||
class EventColumnNames(Enum): | ||
"""The fields the GCF data mapper needs to parse event data.""" | ||
|
||
APPROVED = "ApprovalDate" | ||
UNDER_IMPLEMENTATION = "StartDate" | ||
COMPLETED = "DateCompletion" | ||
APPROVED_REF = "ApprovedRef" | ||
PROJECTS_ID = "ProjectsID" | ||
|
||
|
||
class EventTypeNames(Enum): | ||
"""The GCF event type names (should map to the GCF taxonomy).""" | ||
|
||
APPROVED = "Approved" | ||
UNDER_IMPLEMENTATION = "Under Implementation" | ||
COMPLETED = "Completed" | ||
|
||
|
||
class Events: | ||
APPROVED = Event( | ||
"approved", | ||
EventTypeNames.APPROVED.value, | ||
EventColumnNames.APPROVED.value, | ||
) | ||
UNDER_IMPLEMENTATION = Event( | ||
"under_implementation", | ||
EventTypeNames.UNDER_IMPLEMENTATION.value, | ||
EventColumnNames.UNDER_IMPLEMENTATION.value, | ||
) | ||
COMPLETED = Event( | ||
"completed", | ||
EventTypeNames.COMPLETED.value, | ||
EventColumnNames.COMPLETED.value, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.