feat: add special education disaggregation

This commit is contained in:
rebuilt 2023-10-05 14:51:36 -07:00
parent a9b4f97a84
commit acfdaf5587
23 changed files with 379 additions and 52 deletions

View file

@ -1,11 +1,11 @@
Race Qualtrics Code,Race/Ethnicity,Gender Qualtrics Code,Sex/Gender,Income,ELL
1,American Indian or Alaskan Native,2,Male,Economically Disadvantaged N,ELL
2,Asian or Pacific Islander,1,Female,Economically Disadvantaged Y,Not ELL
3,Black or African American,4,Non-Binary,Unknown,Unknown
4,Hispanic or Latinx,99,Unknown,,
5,White or Caucasian,,,,
6,Prefer not to disclose,,,,
7,Prefer to self-describe,,,,
8,Middle Eastern,,,,
99,Race/Ethnicity Not Listed,,,,
100,Multiracial,,,,
Race Qualtrics Code,Race/Ethnicity,Gender Qualtrics Code,Sex/Gender,Income,ELL,Special Ed Status
1,American Indian or Alaskan Native,2,Male,Economically Disadvantaged N,ELL,Special Education
2,Asian or Pacific Islander,1,Female,Economically Disadvantaged Y,Not ELL,Not Special Education
3,Black or African American,4,Non-Binary,Unknown,Unknown,Unknown
4,Hispanic or Latinx,99,Unknown,,,
5,White or Caucasian,,,,,
6,Prefer not to disclose,,,,,
7,Prefer to self-describe,,,,,
8,Middle Eastern,,,,,
99,Race/Ethnicity Not Listed,,,,,
100,Multiracial,,,,,

1 Race Qualtrics Code Race/Ethnicity Gender Qualtrics Code Sex/Gender Income ELL Special Ed Status
2 1 American Indian or Alaskan Native 2 Male Economically Disadvantaged – N ELL Special Education
3 2 Asian or Pacific Islander 1 Female Economically Disadvantaged – Y Not ELL Not Special Education
4 3 Black or African American 4 Non-Binary Unknown Unknown Unknown
5 4 Hispanic or Latinx 99 Unknown
6 5 White or Caucasian
7 6 Prefer not to disclose
8 7 Prefer to self-describe
9 8 Middle Eastern
10 99 Race/Ethnicity Not Listed
11 100 Multiracial

View file

@ -21,6 +21,10 @@ describe DemographicLoader do
["ELL", "Not ELL", "Unknown"]
end
let(:speds) do
["Special Education", "Not Special Education", "Unknown"]
end
before :each do
DemographicLoader.load_data(filepath:)
end
@ -68,5 +72,12 @@ describe DemographicLoader do
expect(Ell.find_by_designation(ell).designation).to eq ell
end
end
it "load all the special ed designations" do
expect(Sped.all.count).to eq 3
speds.each do |sped|
expect(Sped.find_by_designation(sped).designation).to eq sped
end
end
end
end

View file

@ -251,6 +251,44 @@ RSpec.describe SurveyItemValues, type: :model do
end
end
context ".sped" do
before :each do
attleboro
ay_2022_23
end
it 'translates "active" into "Special Education"' do
headers = ["Raw SpEd"]
row = { "Raw SpEd" => "active" }
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
expect(values.sped).to eq "Special Education"
end
it 'translates "exited" into "Not Special Education"' do
headers = ["Raw SpEd"]
row = { "Raw SpEd" => "exited" }
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
expect(values.sped).to eq "Not Special Education"
end
it 'translates blanks into "Not Special Education' do
headers = ["Raw SpEd"]
row = { "Raw SpEd" => "" }
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
expect(values.sped).to eq "Not Special Education"
end
it 'tranlsates NA into "Unknown"' do
headers = ["Raw SpEd"]
row = { "Raw SpEd" => "NA" }
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
expect(values.sped).to eq "Unknown"
row = { "Raw SpEd" => "#NA" }
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
expect(values.sped).to eq "Unknown"
end
end
context ".valid_duration" do
context "when duration is valid" do
it "returns true" do