Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
705d005
new pd table for grants (monthly)
RabiaSajjad Oct 29, 2024
a80a726
add changelog for PR# 1525
RabiaSajjad Oct 29, 2024
8c2c6e9
change template version and add excel style to grantsmonthly
RabiaSajjad Oct 30, 2024
20e79d7
fix sorting for recombinant update pd record template
RabiaSajjad Oct 30, 2024
dc6dc09
add more choices to fields in grantsmonthly template
RabiaSajjad Oct 31, 2024
4c1ec00
change title for grantsmonthly template and add example for Other field
RabiaSajjad Nov 4, 2024
0bf4940
update notes for grantsmonthly template
RabiaSajjad Nov 4, 2024
56908ed
add translations for grantsmonthly
RabiaSajjad Nov 5, 2024
b23f76b
add translation for other_dem_intended_beneficiary_description_fr fie…
RabiaSajjad Nov 5, 2024
e42e129
add field rating_risk to grantsmonthly template
RabiaSajjad Nov 14, 2024
929f9ae
Merge branch 'master' into 'grants-monthly'
RabiaSajjad Nov 15, 2024
f997c28
format description for risk rating field in grants monthly template
RabiaSajjad Nov 15, 2024
4330fa2
add grants-monthly to makefile
RabiaSajjad Feb 12, 2025
d96ac2e
Merge branch 'master' into 'grants-monthly'
RabiaSajjad Feb 13, 2025
0f56810
change quarterly to monthly for grants-monthly table
RabiaSajjad Feb 13, 2025
e963416
remove plugins.py from grants-monthly
RabiaSajjad Feb 13, 2025
ad4c0d9
add grantsmonthly.csv to makefile
RabiaSajjad Feb 13, 2025
86bd105
add published_resource_id for grantsmonthly.csv
RabiaSajjad Feb 13, 2025
7f6a954
fix linting error in filter_grants_monthly
RabiaSajjad Feb 13, 2025
bd29ef3
add grantsmonthly to test ini file
RabiaSajjad Feb 13, 2025
35a046e
fix linting error in grants filter
RabiaSajjad Feb 13, 2025
7e82779
fix(pd): grants monthly example value;
JVickery-TBS Feb 25, 2025
a78d70c
fix(tests): make grants;
RabiaSajjad Feb 25, 2025
83350f8
dep updates for grantsmonthly
RabiaSajjad Mar 5, 2025
e3b60c4
Merge branch 'master' into grants-monthly
JVickery-TBS Mar 5, 2025
a5b0711
fix(pd): grantsmonthly column type;
JVickery-TBS Mar 5, 2025
6ff92cc
fix(syntax): lint;
JVickery-TBS Mar 5, 2025
bccb9b9
Merge branch 'master' into grants-monthly
JVickery-TBS Oct 17, 2025
1b2f8dd
Grants monthly pilot, phase 2
RabiaSajjad Oct 31, 2025
d824b49
add translations for grantsmonthly phase 2
RabiaSajjad Nov 3, 2025
35ce57a
add trigger string for grants montthly pilot phase 2
RabiaSajjad Nov 3, 2025
97871f0
add more trigger string for grants montthly pilot phase 2
RabiaSajjad Nov 3, 2025
91403ae
remove validation from grants monthly pilot phase 1 fields
RabiaSajjad Nov 4, 2025
944e293
change required fields from grants monthly pilot phase 1
RabiaSajjad Nov 4, 2025
a4fe84c
fix Y/N options for grants monthly pilot phase 2 fields
RabiaSajjad Nov 4, 2025
aeba1b5
update option label for the recipient_type field
RabiaSajjad Nov 18, 2025
f293761
change the ref_number field description to show Q instead of M
RabiaSajjad Nov 19, 2025
75c8f79
update description for field agreement_start_date
RabiaSajjad Dec 9, 2025
d292ff2
Merge branch 'master' into grants-monthly
JVickery-TBS Dec 15, 2025
6f92e76
Merge branch 'master' into grants-monthly
JVickery-TBS Dec 15, 2025
6286a35
feat(pd): grants pilot;
JVickery-TBS Dec 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions bin/filter/filter_grants_monthly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python3
"filter for grantsmonthly.csv"

import csv
import sys

REMOVE_COLUMNS = [
'record_created',
'record_modified',
'user_modified',
]


def main():
reader = csv.DictReader(sys.stdin)
outnames = [f for f in reader.fieldnames if f not in REMOVE_COLUMNS]
writer = csv.DictWriter(sys.stdout, outnames)
writer.writeheader()
for row in reader:
try:
for rem in REMOVE_COLUMNS:
del row[rem]
writer.writerow(row)
except ValueError:
pass


main()
15 changes: 12 additions & 3 deletions bin/pd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ csv_files := \
consultations.csv \
dac.csv \
experiment.csv \
grants.csv grants-nil.csv \
grants.csv grants-nil.csv grantsmonthly.csv \
hospitalityq.csv hospitalityq-nil.csv \
nap5.csv \
reclassification.csv reclassification-nil.csv \
Expand Down Expand Up @@ -430,17 +430,20 @@ $(workdir)/filtered/experiment.csv: $(workdir)/experiment.csv
grants: upload-grants rebuild-grants

.PHONY: upload-grants
upload-grants: $(workdir)/filtered/grants.csv $(workdir)/filtered/grants-nil.csv
upload-grants: $(workdir)/filtered/grants.csv $(workdir)/filtered/grants-nil.csv $(workdir)/filtered/grantsmonthly.csv
@$(echo_date) Uploading Grants and Contributions...
@$(ckanapi) action resource_patch -c $(registry_ini) \
id=1d15a62f-5656-49ad-8c88-f40ce689d831 upload@"$(workdir)/filtered/grants.csv" \
> /dev/null
@$(ckanapi) action resource_patch -c $(registry_ini) \
id=4e4db232-f5e8-43c7-b8b2-439eb7d55475 upload@"$(workdir)/filtered/grants-nil.csv" \
> /dev/null
@$(ckanapi) action resource_patch -c $(registry_ini) \
id=a4fa27d7-0c7c-4e31-bc0a-2d1cf249f749 upload@"$(workdir)/filtered/grantsmonthly.csv" \
> /dev/null

.PHONY: rebuild-grants
rebuild-grants: $(workdir)/filtered/grants.csv $(workdir)/filtered/grants-nil.csv
rebuild-grants: $(workdir)/filtered/grants.csv $(workdir)/filtered/grants-nil.csv $(workdir)/filtered/grantsmonthly.csv
@$(echo_date) Rebuilding Grants and Contributions...
mkdir -p $(workdir)/amendments
$(registry_python) $(fdir)/amendment_delta_records.py \
Expand All @@ -454,12 +457,18 @@ $(workdir)/grants.csv:
$(workdir)/grants-nil.csv:
$(ckan_command) -c $(registry_ini) $(combine) grants-nil -d $(workdir)

$(workdir)/grantsmonthly.csv:
$(ckan_command) -c $(registry_ini) $(combine) grantsmonthly -d $(workdir)

$(workdir)/filtered/grants.csv: $(workdir)/grants.csv
$(fdir)/filter_grants.py < $< > $@

$(workdir)/filtered/grants-nil.csv: $(workdir)/grants-nil.csv
$(fdir)/filter_grants.py < $< > $@

$(workdir)/filtered/grantsmonthly.csv: $(workdir)/grantsmonthly.csv
$(fdir)/filter_grants_monthly.py < $< > $@

###
### Hospitality Expenses
###
Expand Down
21 changes: 21 additions & 0 deletions changes/1525.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
New recombinant PD template for Grants (monthly). This template would be separate from
the existing Grants template and is targeted only for the Staging environment. Major difference
between the two templates are:
* Data collection is done quarterly for Grants vs monthly for Grants (monthly)
* The following fields exist in Grants but deprecated in Grants (monthly):
- 3.9 research_organization_name
- 3.14 federal_riding_name_en
- 3.15 federal_riding_name_fr
- 3.21 agreement_title_en
- 3.22 agreement_title_fr
- 3.25 foreign_currency_type
- 3.26 foreign_currency_value
- 3.29 coverage
- 3.32 naics_identifier
- 3.35 additional_information_en
- 3.36 additional_information_fr
* The following fields are new in the Grants (monthly) template:
- 3.26 dem_intended_beneficiary
- 3.27 other_dem_intended_beneficiary_description_en
- 3.28 other_dem_intended_beneficiary_description_fr
- 3.29 reason_amendment
Loading
Loading