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

Bugs/epic 13898 #248

Merged
merged 3 commits into from
Sep 25, 2023
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
12 changes: 1 addition & 11 deletions migrations/support_geoids.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,5 @@ CREATE TABLE support_geoids AS (
FROM tmp
WHERE geotype LIKE 'CDTA%'
ORDER BY geogname ASC
) UNION ALL
(
SELECT
geoid,
geotype,
geogname as label,
'City Council Districts (CCDs)' AS typelabel
FROM tmp
WHERE geotype LIKE 'CCD%'
ORDER BY geogname ASC
)
);
);
46 changes: 23 additions & 23 deletions special-calculations/data/bins.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,28 +244,28 @@ module.exports = {
],
},
mdage: [
['mdpop0t4', [ 0, 4.9999 ]],
['mdpop5t9', [ 5, 9.9999 ]],
['mdpop10t14', [ 10, 14.9999 ]],
['mdpop15t17', [ 15, 17.9999 ]],
['mdpop18t19', [ 18, 19.9999 ]],
['mdpop20', [ 20, 20.9999 ]],
['mdpop21', [ 21, 21.9999 ]],
['mdpop22t24', [ 22, 24.9999 ]],
['mdpop25t29', [ 25, 29.9999 ]],
['mdpop30t34', [ 30, 34.9999 ]],
['mdpop35t39', [ 35, 39.9999 ]],
['mdpop40t44', [ 40, 44.9999 ]],
['mdpop45t49', [ 45, 49.9999 ]],
['mdpop50t54', [ 50, 54.9999 ]],
['mdpop55t59', [ 55, 59.9999 ]],
['mdpop60t61', [ 60, 61.9999 ]],
['mdpop62t64', [ 62, 64.9999 ]],
['mdpop65t66', [ 65, 66.9999 ]],
['mdpop67t69', [ 67, 69.9999 ]],
['mdpop70t74', [ 70, 74.9999 ]],
['mdpop75t79', [ 75, 79.9999 ]],
['mdpop80t84', [ 80, 84.9999 ]],
['mdpop85pl', [ 85, 115 ]]
[/^(mdpop0t4|ageu5)$/, [ 0, 4.9999 ]],
[/^(mdpop|age)5t9$/, [ 5, 9.9999 ]],
[/^(mdpop|age)10t14$/, [ 10, 14.9999 ]],
[/^(mdpop|age)15t17$/, [ 15, 17.9999 ]],
[/^(mdpop|age)18t19$/, [ 18, 19.9999 ]],
[/^(mdpop|age)20$/, [ 20, 20.9999 ]],
[/^(mdpop|age)21$/, [ 21, 21.9999 ]],
[/^(mdpop|age)22t24$/, [ 22, 24.9999 ]],
[/^(mdpop|age)25t29$/, [ 25, 29.9999 ]],
[/^(mdpop|age)30t34$/, [ 30, 34.9999 ]],
[/^(mdpop|age)35t39$/, [ 35, 39.9999 ]],
[/^(mdpop|age)40t44$/, [ 40, 44.9999 ]],
[/^(mdpop|age)45t49$/, [ 45, 49.9999 ]],
[/^(mdpop|age)50t54$/, [ 50, 54.9999 ]],
[/^(mdpop|age)55t59$/, [ 55, 59.9999 ]],
[/^(mdpop|age)60t61$/, [ 60, 61.9999 ]],
[/^(mdpop|age)62t64$/, [ 62, 64.9999 ]],
[/^(mdpop|age)65t66$/, [ 65, 66.9999 ]],
[/^(mdpop|age)67t69$/, [ 67, 69.9999 ]],
[/^(mdpop|age)70t74$/, [ 70, 74.9999 ]],
[/^(mdpop|age)75t79$/, [ 75, 79.9999 ]],
[/^(mdpop|age)80t84$/, [ 80, 84.9999 ]],
[/^(mdpop|age)85pl$/, [ 85, 115 ]]
],
};
4 changes: 2 additions & 2 deletions special-calculations/decennial.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = [
{
variable: 'popacre',
specialType: 'mean',
options: { args: ['pop5', 'landacres'], formulaName: { sum: 'ratio' } },
options: { args: ['pop5', 'landacres'] },
},
// Median Age
{
Expand All @@ -15,7 +15,7 @@ module.exports = [
{
variable: 'agdpdrt',
specialType: 'mean',
options: { args: ['agu1865p', 'ag18t64'], formulaName: { sum: 'ratio' } }
options: { args: ['agu1865pl', 'ag18t64'], formulaName: { sum: 'ratio' } }
},
// Old age dependency ratio
{
Expand Down
2 changes: 1 addition & 1 deletion utils/interpolate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function interpolate(data, variable, year) {
const scenario = bins.map((bin) => {
const [key, range] = bin;
const [min, max] = range;
const row = find(data, ['variable', key]);
const row = find(data, (row) => row.variable.match(key) !== null);

if (!row) throw new Error(`${key} was not found in the ${year} dataset.`);

Expand Down