Fix hs only admin data item. Use alternate method to check if a school is a high school

rpp-main
nelson 10 months ago committed by rebuilt
parent 82f0c9f769
commit 2a71e2cc99

@ -20,6 +20,7 @@ module Dese
browser.close
end
# We don't need to check to see if this is a high school because the link only lists relevant schools
def run_a_ovpe_i1(filepath:)
run do |academic_year|
admin_data_item_id = 'a-ovpe-i1'

@ -38,6 +38,7 @@ module Dese
browser.close
end
# We don't need to check to see if this is a high school because the link only lists relevant schools
def run_a_degr_i1(filepath:)
run do |academic_year|
admin_data_item_id = 'a-degr-i1'
@ -59,6 +60,7 @@ module Dese
end
end
# We don't need to check to see if this is a high school because the link only lists relevant schools
def run_a_degr_i2(filepath:)
run do |academic_year|
admin_data_item_id = 'a-degr-i2'

@ -84,5 +84,10 @@ module Dese
end
end
end
def is_hs?(school_id:, school_name:)
school_id = school_id.to_s
school_id[-3] == "5" || school_name =~ /\sHigh$|\sHigh\s/i
end
end
end

@ -8,7 +8,11 @@ module Dese
def initialize(filepaths: [Rails.root.join("data", "admin_data", "dese", "3B_1_masscore.csv"),
Rails.root.join("data", "admin_data", "dese", "3B_1_advcoursecomprate.csv"),
Rails.root.join("data", "admin_data", "dese", "3B_1_ap.csv"),
Rails.root.join("data", "admin_data", "dese", "3B_1_course_ratio.csv")])
Rails.root.join("data", "admin_data", "dese", "3B_1_adv_courses.csv"),
Rails.root.join("data", "admin_data", "dese", "3B_1_course_ratio.csv"),
Rails.root.join("data" , "admin_data", "dese", "3B_1_enrollments_by_race.csv") ,
Rails.root.join("data" , "admin_data", "dese", "3B_1_enrollments_by_grade.csv") ,
Rails.root.join("data" , "admin_data", "dese", "3B_1_adv_courses_white_students.csv") ])
@filepaths = filepaths
end
@ -35,6 +39,7 @@ module Dese
run_a_curv_i3(filepath:)
filepath = filepaths[3]
filepath = filepaths[4]
headers = ["Raw likert calculation", "Likert Score", "Admin Data Item", "Academic Year", "School Name", "DESE ID",
"Total # of Classes", "Average Class Size", "Number of Students", "Female %", "Male %", "English Language Learner %", "Students with Disabilities %", "Low Income %"]
write_headers(filepath:, headers:)
@ -105,10 +110,10 @@ module Dese
"ctl00_ContentPlaceHolder1_ddYear" => range }
submit_id = "btnViewReport"
calculation = lambda { |headers, items|
dese_id = items[headers["School Code"]].to_i
school = School.find_by_dese_id(dese_id)
school_id = items[headers["School Code"]].to_i
school_name = items[headers["School Name"]]
return "NA" unless school.present? && school.is_hs?
return "NA" unless is_hs?(school_id:, school_name:)
classes_index = headers["Total # of Classes"]
num_classes = items[classes_index].gsub(",", "").to_f

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save