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

😴 feat: allow 1 week of inactivity (#128) #129

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions nationcred/output/nationcred-171.csv
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2022-12-11,1.24,0,0,1.24,141.5,true
2022-12-18,2.42,0,0,2.42,143.92,true
2022-12-25,2.46,0.17,0,2.63,146.54,true
2023-01-01,0.45,0,0,0.45,147,false
2023-01-01,0.45,0,0,0.45,147,true
2023-01-08,2.08,0,0,2.08,149.08,false
2023-01-15,14.89,0,0,14.89,163.97,false
2023-01-22,1.68,0.17,0,1.85,165.82,false
Expand All @@ -45,7 +45,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-04-02,4.56,0.17,0,4.73,192.41,false
2023-04-09,6.26,0.17,0,6.43,198.84,true
2023-04-16,3.15,0,0,3.15,201.99,true
2023-04-23,0.53,0,0,0.53,202.53,false
2023-04-23,0.53,0,0,0.53,202.53,true
2023-04-30,1.31,0,0,1.31,203.83,false
2023-05-07,0.59,0.51,0,1.1,204.93,false
2023-05-14,0.27,0,0,0.27,205.21,false
Expand All @@ -60,7 +60,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-07-16,42.1,0,0,42.1,287.74,true
2023-07-23,13,0,0,13,300.74,true
2023-07-30,1.37,0.17,0,1.54,302.27,true
2023-08-06,0.15,0,0,0.15,302.43,false
2023-08-06,0.15,0,0,0.15,302.43,true
2023-08-13,0.16,0,0,0.16,302.59,false
2023-08-20,0.03,0,0,0.03,302.62,false
2023-08-27,0.16,0,0,0.16,302.78,false
Expand Down
6 changes: 3 additions & 3 deletions nationcred/output/nationcred-172.csv
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-04-02,12.16,0.17,0,12.33,389.31,true
2023-04-09,3.16,0.17,0,3.33,392.64,true
2023-04-16,1.95,0,0,1.95,394.59,true
2023-04-23,0.33,0,0,0.33,394.92,false
2023-04-23,0.33,0,0,0.33,394.92,true
2023-04-30,0.03,0,0,0.03,394.95,false
2023-05-07,0,0.17,0,0.17,395.12,false
2023-05-14,0,0,0,0,395.12,false
Expand All @@ -69,7 +69,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-09-17,2.33,0.17,0,2.5,455.42,true
2023-09-24,1.18,0,0,1.18,456.6,true
2023-10-01,3.34,0,0,3.34,459.94,true
2023-10-08,0.89,0,0,0.89,460.83,false
2023-10-08,0.89,0,0,0.89,460.83,true
2023-10-15,0.13,0,0,0.13,460.96,false
2023-10-22,0.41,0,0,0.41,461.37,false
2023-10-29,0.4,0,0,0.4,461.77,false
Expand All @@ -89,7 +89,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2024-02-04,1.25,0,0,1.25,514.56,true
2024-02-11,2.05,0,0,2.05,516.61,true
2024-02-18,1.7,0,0,1.7,518.3,true
2024-02-25,0.32,0,0,0.32,518.63,false
2024-02-25,0.32,0,0,0.32,518.63,true
2024-03-03,1.55,0.34,0,1.89,520.51,false
2024-03-10,0.16,0.17,0,0.33,520.84,false
2024-03-17,0.02,0,0,0.02,520.86,false
Expand Down
4 changes: 2 additions & 2 deletions nationcred/output/nationcred-176.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2022-07-17,15.06,0,0,15.06,73.09,true
2022-07-24,3.11,0,0,3.11,76.21,true
2022-07-31,6.78,0,0,6.78,82.98,true
2022-08-07,0.84,0,0,0.84,83.83,false
2022-08-07,0.84,0,0,0.84,83.83,true
2022-08-14,1.23,0,0,1.23,85.06,false
2022-08-21,11.11,0,0,11.11,96.17,false
2022-08-28,9.06,0,0,9.06,105.23,false
Expand All @@ -35,7 +35,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-01-22,4.17,0,0,4.17,304.11,true
2023-01-29,2.12,0,0,2.12,306.23,true
2023-02-05,1.08,0,0,1.08,307.31,true
2023-02-12,0.11,0,0,0.11,307.42,false
2023-02-12,0.11,0,0,0.11,307.42,true
2023-02-19,0.01,0,0,0.01,307.43,false
2023-02-26,0.04,0,0,0.04,307.47,false
2023-03-05,0.42,0,0,0.42,307.89,false
Expand Down
6 changes: 3 additions & 3 deletions nationcred/output/nationcred-202.csv
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-03-26,5.62,0.68,0,6.3,194.71,true
2023-04-02,2.43,0.17,0,2.6,197.31,true
2023-04-09,0.85,0.17,0,1.02,198.33,true
2023-04-16,0.59,0,0,0.59,198.91,false
2023-04-16,0.59,0,0,0.59,198.91,true
2023-04-23,0.06,0,0,0.06,198.98,false
2023-04-30,0.07,0,0,0.07,199.05,false
2023-05-07,0.37,0.34,0,0.71,199.76,false
Expand All @@ -62,12 +62,12 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-07-30,3.62,0,0,3.62,251.18,true
2023-08-06,7.12,0,0,7.12,258.3,true
2023-08-13,1.29,0,0,1.29,259.58,true
2023-08-20,0.29,0,0,0.29,259.88,false
2023-08-20,0.29,0,0,0.29,259.88,true
2023-08-27,1.64,0,0,1.64,261.52,false
2023-09-03,8.18,0,0,8.18,269.69,false
2023-09-10,1.46,0,0,1.46,271.16,false
2023-09-17,0.76,0.34,0,1.1,272.26,true
2023-09-24,0.38,0,0,0.38,272.64,false
2023-09-24,0.38,0,0,0.38,272.64,true
2023-10-01,3.02,0,0,3.02,275.66,false
2023-10-08,0.3,0,0,0.3,275.96,false
2023-10-15,0.03,0,0,0.03,276,false
Expand Down
2 changes: 1 addition & 1 deletion nationcred/output/nationcred-233.csv
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-04-02,20.59,0.17,0,20.76,1115.32,true
2023-04-09,8.52,0,0,8.52,1123.84,true
2023-04-16,3.1,0,0,3.1,1126.93,true
2023-04-23,0.55,0,0,0.55,1127.49,false
2023-04-23,0.55,0,0,0.55,1127.49,true
2023-04-30,2.25,0,0,2.25,1129.73,false
2023-05-07,1.18,0.17,0,1.35,1131.09,false
2023-05-14,0.13,0,0,0.13,1131.22,false
Expand Down
2 changes: 1 addition & 1 deletion nationcred/output/nationcred-272.csv
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2024-01-14,14.42,0,1.5,15.92,359.58,true
2024-01-21,4.01,0,0,4.01,363.59,true
2024-01-28,1.47,0,1.33,2.8,366.39,true
2024-02-04,0.16,0,0,0.16,366.56,false
2024-02-04,0.16,0,0,0.16,366.56,true
2024-02-11,0.15,0,0,0.15,366.71,false
2024-02-18,0.52,0,0.33,0.85,367.56,false
2024-02-25,0.07,0,0,0.07,367.63,false
Expand Down
4 changes: 2 additions & 2 deletions nationcred/output/nationcred-280.csv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-10-29,5.8,0,6.64,12.44,142.8,true
2023-11-05,4,0,0.33,4.33,147.12,true
2023-11-12,3.55,0,0,3.55,150.67,true
2023-11-19,0.92,0,0,0.92,151.59,false
2023-11-19,0.92,0,0,0.92,151.59,true
2023-11-26,3.41,0,0,3.41,155.01,false
2023-12-03,3.41,0.34,0,3.75,158.76,false
2023-12-10,5.91,0.51,0,6.42,165.18,false
Expand All @@ -84,7 +84,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-12-31,3.02,0,0,3.02,173.56,true
2024-01-07,5.3,0,0,5.3,178.86,true
2024-01-14,2.67,0,0,2.67,181.53,true
2024-01-21,0.55,0,0,0.55,182.08,false
2024-01-21,0.55,0,0,0.55,182.08,true
2024-01-28,2.49,0,0,2.49,184.57,false
2024-02-04,0.29,0,0,0.29,184.87,false
2024-02-11,0.45,0,0,0.45,185.32,false
Expand Down
2 changes: 1 addition & 1 deletion nationcred/output/nationcred-283.csv
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-10-01,2.46,0,0,2.46,26.65,false
2023-10-08,5.55,0,0,5.55,32.19,true
2023-10-15,1.05,0,0,1.05,33.24,true
2023-10-22,0.14,0,0,0.14,33.38,false
2023-10-22,0.14,0,0,0.14,33.38,true
2023-10-29,0.01,0,0,0.01,33.39,false
2023-11-05,0,0,0,0,33.39,false
2023-11-12,0,0,0,0,33.39,false
Expand Down
2 changes: 1 addition & 1 deletion nationcred/output/nationcred-288.csv
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2024-03-03,32.56,0.84,0,33.4,84.94,true
2024-03-10,4.84,0,0,4.84,89.78,true
2024-03-17,1.08,0,0,1.08,90.86,true
2024-03-24,0.68,0,0,0.68,91.54,false
2024-03-24,0.68,0,0,0.68,91.54,true
2024-03-31,0.79,0,0,0.79,92.33,false
2024-04-07,1.43,0,0,1.43,93.76,false
10 changes: 5 additions & 5 deletions nationcred/output/nationcred-36.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2022-07-10,10.58,0,0,10.58,47.19,false
2022-07-17,7.07,0.17,0,7.24,54.43,true
2022-07-24,1.27,0,0,1.27,55.7,true
2022-07-31,0.55,0,0,0.55,56.25,false
2022-07-31,0.55,0,0,0.55,56.25,true
2022-08-07,0.8,0.17,0,0.97,57.22,false
2022-08-14,2.39,0,0,2.39,59.61,false
2022-08-21,10.21,0,0,10.21,69.82,false
Expand All @@ -18,7 +18,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2022-09-25,4.11,0,0,4.11,121.17,true
2022-10-02,12.63,0,0,12.63,133.8,true
2022-10-09,1.49,0,0,1.49,135.29,true
2022-10-16,0.93,0,0,0.93,136.23,false
2022-10-16,0.93,0,0,0.93,136.23,true
2022-10-23,4.01,0.17,0,4.18,140.4,false
2022-10-30,2.71,0,0,2.71,143.11,false
2022-11-06,5.34,0,0,5.34,148.45,false
Expand All @@ -39,14 +39,14 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-02-19,7.14,0,0,7.14,300.69,true
2023-02-26,3.28,0,0,3.28,303.97,true
2023-03-05,3.53,0,0,3.53,307.49,true
2023-03-12,0.98,0,0,0.98,308.48,false
2023-03-12,0.98,0,0,0.98,308.48,true
2023-03-19,0.23,0,0,0.23,308.71,false
2023-03-26,0.32,0,0,0.32,309.03,false
2023-04-02,2.82,0,0,2.82,311.84,false
2023-04-09,2.03,0,0,2.03,313.87,false
2023-04-16,1.42,0,0,1.42,315.3,false
2023-04-23,2.12,0,0,2.12,317.42,true
2023-04-30,0.58,0,0,0.58,318,false
2023-04-30,0.58,0,0,0.58,318,true
2023-05-07,0.8,0,0,0.8,318.81,false
2023-05-14,0.08,0,0,0.08,318.89,false
2023-05-21,0.04,0,0,0.04,318.93,false
Expand All @@ -59,7 +59,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-07-09,1.88,0,0,1.88,324.4,false
2023-07-16,7.41,0.17,0,7.58,331.99,false
2023-07-23,1.69,0,0,1.69,333.68,true
2023-07-30,0.17,0,0,0.17,333.85,false
2023-07-30,0.17,0,0,0.17,333.85,true
2023-08-06,0.02,0,0,0.02,333.86,false
2023-08-13,0,0,0,0,333.86,false
2023-08-20,0,0,0,0,333.86,false
Expand Down
4 changes: 2 additions & 2 deletions nationcred/output/nationcred-43.csv
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-03-19,33.48,0,0,33.48,581.77,true
2023-03-26,10.24,0,0,10.24,592.02,true
2023-04-02,6.25,0,0,6.25,598.26,true
2023-04-09,0.79,0,0,0.79,599.05,false
2023-04-09,0.79,0,0,0.79,599.05,true
2023-04-16,0.08,0,0,0.08,599.13,false
2023-04-23,0.01,0,0,0.01,599.14,false
2023-04-30,0.01,0,0,0.01,599.14,false
Expand All @@ -59,7 +59,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-07-09,8.41,0,0,8.41,615.12,false
2023-07-16,3.4,0,0,3.4,618.52,false
2023-07-23,2.39,0,0,2.39,620.91,true
2023-07-30,0.6,0,0,0.6,621.52,false
2023-07-30,0.6,0,0,0.6,621.52,true
2023-08-06,0.06,0,0,0.06,621.58,false
2023-08-13,0,0,0,0,621.58,false
2023-08-20,0,0,0,0,621.58,false
Expand Down
2 changes: 1 addition & 1 deletion nationcred/output/nationcred-71.csv
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ week_end,value_creation_hours,governance_hours,operations_hours,nationcred_score
2023-10-22,2.93,0,0,2.93,54.22,true
2023-10-29,3.22,0,0,3.22,57.44,true
2023-11-05,1.24,0,0,1.24,58.67,true
2023-11-12,0.22,0,0,0.22,58.89,false
2023-11-12,0.22,0,0,0.22,58.89,true
2023-11-19,0.06,0,0,0.06,58.96,false
2023-11-26,0.43,0,0,0.43,59.39,false
2023-12-03,2.37,0,0,2.37,61.76,false
Expand Down
44 changes: 22 additions & 22 deletions nationcred/output/nationcred-active-citizens.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ week_end,total_citizens_count,voting_citizens_count,active_citizens_count,active
2022-07-10,,,4,"43,172,176,233"
2022-07-17,,,5,"36,43,172,176,233"
2022-07-24,,,5,"36,43,172,176,233"
2022-07-31,,,4,"43,172,176,233"
2022-08-07,,,3,"43,172,233"
2022-07-31,,,5,"36,43,172,176,233"
2022-08-07,,,4,"43,172,176,233"
2022-08-14,,,3,"43,172,233"
2022-08-21,,,3,"43,172,233"
2022-08-28,,,3,"43,172,233"
Expand All @@ -18,7 +18,7 @@ week_end,total_citizens_count,voting_citizens_count,active_citizens_count,active
2022-09-25,,,6,"36,43,171,172,176,233"
2022-10-02,,,6,"36,43,171,172,176,233"
2022-10-09,,,6,"36,43,171,172,176,233"
2022-10-16,,,6,"43,171,172,176,202,233"
2022-10-16,,,7,"36,43,171,172,176,202,233"
2022-10-23,,,6,"43,171,172,176,202,233"
2022-10-30,,,6,"43,171,172,176,202,233"
2022-11-06,,,6,"43,171,172,176,202,233"
Expand All @@ -29,24 +29,24 @@ week_end,total_citizens_count,voting_citizens_count,active_citizens_count,active
2022-12-11,,,7,"36,43,171,172,176,202,233"
2022-12-18,,,7,"36,43,171,172,176,202,233"
2022-12-25,,,7,"36,43,171,172,176,202,233"
2023-01-01,,,6,"36,43,172,176,202,233"
2023-01-01,,,7,"36,43,171,172,176,202,233"
2023-01-08,,,6,"36,43,172,176,202,233"
2023-01-15,,,6,"36,43,172,176,202,233"
2023-01-22,,,6,"36,43,172,176,202,233"
2023-01-29,,,6,"36,43,172,176,202,233"
2023-02-05,,,6,"36,43,172,176,202,233"
2023-02-12,,,5,"36,43,172,202,233"
2023-02-12,,,6,"36,43,172,176,202,233"
2023-02-19,,,5,"36,43,172,202,233"
2023-02-26,,,5,"36,43,172,202,233"
2023-03-05,,,5,"36,43,172,202,233"
2023-03-12,,,4,"43,172,202,233"
2023-03-12,,,5,"36,43,172,202,233"
2023-03-19,,,4,"43,172,202,233"
2023-03-26,,,4,"43,172,202,233"
2023-04-02,,,4,"43,172,202,233"
2023-04-09,,,4,"171,172,202,233"
2023-04-16,,,3,"171,172,233"
2023-04-23,,,1,36
2023-04-30,,,0,
2023-04-09,,,5,"43,171,172,202,233"
2023-04-16,,,4,"171,172,202,233"
2023-04-23,,,4,"36,171,172,233"
2023-04-30,,,1,36
2023-05-07,,,0,
2023-05-14,,,0,
2023-05-21,,,0,
Expand All @@ -59,23 +59,23 @@ week_end,total_citizens_count,voting_citizens_count,active_citizens_count,active
2023-07-09,,,0,
2023-07-16,,,3,"171,172,233"
2023-07-23,,,6,"36,43,171,172,202,233"
2023-07-30,,,4,"171,172,202,233"
2023-08-06,,,3,"172,202,233"
2023-07-30,,,6,"36,43,171,172,202,233"
2023-08-06,,,4,"171,172,202,233"
2023-08-13,,,4,"172,202,233,272"
2023-08-20,,,3,"172,233,272"
2023-08-20,,,4,"172,202,233,272"
2023-08-27,,,3,"172,233,272"
2023-09-03,,,3,"172,233,272"
2023-09-10,,,3,"172,233,272"
2023-09-17,,,4,"172,202,233,272"
2023-09-24,,,3,"172,233,272"
2023-09-24,,,4,"172,202,233,272"
2023-10-01,,,4,"172,233,272,280"
2023-10-08,,,5,"71,233,272,280,283"
2023-10-08,,,6,"71,172,233,272,280,283"
2023-10-15,,,5,"71,233,272,280,283"
2023-10-22,,,4,"71,233,272,280"
2023-10-22,,,5,"71,233,272,280,283"
2023-10-29,,,4,"71,233,272,280"
2023-11-05,,,4,"71,233,272,280"
2023-11-12,,,3,"233,272,280"
2023-11-19,,,2,"233,272"
2023-11-12,,,4,"71,233,272,280"
2023-11-19,,,3,"233,272,280"
2023-11-26,,,2,"233,272"
2023-12-03,,,2,"233,272"
2023-12-10,,,2,"233,272"
Expand All @@ -84,15 +84,15 @@ week_end,total_citizens_count,voting_citizens_count,active_citizens_count,active
2023-12-31,,,4,"172,233,272,280"
2024-01-07,,,4,"172,233,272,280"
2024-01-14,,,4,"172,233,272,280"
2024-01-21,,,3,"172,233,272"
2024-01-21,,,4,"172,233,272,280"
2024-01-28,,,3,"172,233,272"
2024-02-04,,,2,"172,233"
2024-02-04,,,3,"172,233,272"
2024-02-11,,,3,"172,233,288"
2024-02-18,,,3,"172,233,288"
2024-02-25,,,2,"233,288"
2024-02-25,,,3,"172,233,288"
2024-03-03,,,2,"233,288"
2024-03-10,,,2,"233,288"
2024-03-17,,,2,"233,288"
2024-03-24,,,1,233
2024-03-24,,,2,"233,288"
2024-03-31,,,1,233
2024-04-07,,,1,233
15 changes: 11 additions & 4 deletions nationcred/src/generate-datasets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
}
// console.info('snapshotData:', snapshotData)

// Prepare variables for keeping track of NationCred scores during the past 4 weeks
// Prepare variables for keeping track of NationCred scores during the past 5 weeks
let nationCredScore5WeeksAgo = undefined
let nationCredScore4WeeksAgo = undefined
let nationCredScore3WeeksAgo = undefined
let nationCredScore2WeeksAgo = undefined
Expand All @@ -87,7 +88,7 @@
let valueCreationHours = 0

let sourceCredScore = 0
sourceCredData.forEach((dataRow: any) => {

Check warning on line 91 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type

Check warning on line 91 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
const weekEnd = dataRow.week_end
if (weekEnd == weekEndDate.toISOString().substring(0, 10)) {
sourceCredScore = dataRow.sourcecred_score
Expand All @@ -99,7 +100,7 @@
valueCreationHours += sourceCredHours

let coordinapeMarketingHours = 0
coordinapeData.forEach((dataRow: any) => {

Check warning on line 103 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type

Check warning on line 103 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
const weekEnd = dataRow.week_end
if (weekEnd == weekEndDate.toISOString().substring(0, 10)) {
coordinapeMarketingHours = Number(dataRow.marketing_hours)
Expand All @@ -112,7 +113,7 @@
let governanceHours = 0

let snapshotScore = 0
snapshotData.forEach((dataRow: any) => {

Check warning on line 116 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type

Check warning on line 116 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
const weekEnd = dataRow.week_end
if (weekEnd == weekEndDate.toISOString().substring(0, 10)) {
const votesCount: number = dataRow.votes_count
Expand All @@ -127,7 +128,7 @@
let operationsHours = 0

let coordinapeOpsHours = 0
coordinapeData.forEach((dataRow: any) => {

Check warning on line 131 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type

Check warning on line 131 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
const weekEnd = dataRow.week_end
if (weekEnd == weekEndDate.toISOString().substring(0, 10)) {
coordinapeOpsHours = Number(dataRow.ops_hours)
Expand All @@ -142,16 +143,22 @@

nationCredScoreAccumulated += nationCredScore

// Check the if the Citizen is active or not (based on the NationCred score for the past 4 weeks)
// Check the if the Citizen is active or not (based on the NationCred score in the past 5 weeks)
nationCredScore5WeeksAgo = nationCredScore4WeeksAgo
nationCredScore4WeeksAgo = nationCredScore3WeeksAgo
nationCredScore3WeeksAgo = nationCredScore2WeeksAgo
nationCredScore2WeeksAgo = nationCredScore1WeekAgo
nationCredScore1WeekAgo = nationCredScore
const activeThreshold = 1.00
const isActive = (nationCredScore4WeeksAgo && (nationCredScore4WeeksAgo > activeThreshold))
const isActive = ((nationCredScore4WeeksAgo && (nationCredScore4WeeksAgo > activeThreshold))
&& (nationCredScore3WeeksAgo && (nationCredScore3WeeksAgo > activeThreshold))
&& (nationCredScore2WeeksAgo && (nationCredScore2WeeksAgo > activeThreshold))
&& (nationCredScore1WeekAgo && (nationCredScore1WeekAgo > activeThreshold))
&& (nationCredScore1WeekAgo && (nationCredScore1WeekAgo > activeThreshold)))
||
((nationCredScore5WeeksAgo && (nationCredScore5WeeksAgo > activeThreshold))
&& (nationCredScore4WeeksAgo && (nationCredScore4WeeksAgo > activeThreshold))
&& (nationCredScore3WeeksAgo && (nationCredScore3WeeksAgo > activeThreshold))
&& (nationCredScore2WeeksAgo && (nationCredScore2WeeksAgo > activeThreshold)))
console.info('isActive:', isActive)

// Export to CSV
Expand All @@ -174,7 +181,7 @@
}
}

async function loadCSVData(filePath: string): Promise<any> {

Check warning on line 184 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type

Check warning on line 184 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
console.info('loadCSVData')

const dataFile: File = fs.readFileSync(filePath)
Expand All @@ -184,7 +191,7 @@
return new Promise(resolve => {
Papa.parse(csvData, {
header: true,
complete: (results: any) => {

Check warning on line 194 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type

Check warning on line 194 in nationcred/src/generate-datasets.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
console.log('complete')
resolve(results.data)
}
Expand Down
Loading