-
Notifications
You must be signed in to change notification settings - Fork 7
Ap bundle performance #162
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
base: main
Are you sure you want to change the base?
Conversation
…d mapping files for performance levels.
…riptors from template and destination in earthmover.
… render only exams taken.
… needed and fixed earthmover file.
* APBundle: Fixed Academic subject seed
* APBundle: Fixed if statement on score result to show irregularity code if available.
|
@jalvord1 here is the modified AP package with the pre-execute step. @jayckaiser tagging you as this has a pre-execute step. |
| - codeValue | ||
| - operation: add_columns | ||
| columns: | ||
| assessmentIdentifier: "{%raw%}AP - {{AP_Exam_Code}}{%endraw%}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally all of this should live in an assessment.csv so it's easier to find and is consistent with other bundles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change to this logic (we've tested this resolves issues we are running into): "{%raw-%} {%- if AwardType != 'nan' and AwardType != '' and AwardType is not none -%} {{'%02d' % AwardType | int}} {%-endif-%} {%-endraw%}"
| 'IrregularityCode1': f'Irregularity Code #1 {exam_id}', | ||
| 'IrregularityCode2': f'Irregularity Code #2 {exam_id}' | ||
| } | ||
| available_cols = [col for col in columns.values() if col in df_copy.columns] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a major proponent of the Return-Early design pattern in programming. I'd recommend changing the code below to as follows:
# [Comment about why 3 has been chosen as the threshold here]
if len(available_cols) < 3:
continue
subset = df_copy[id_columns + available_cols].copy()
rename_dict = {v: k for k, v in columns.items() if v in subset.columns}
subset.rename(columns=rename_dict, inplace=True)
subset.rename(columns={
'Student Identifier': 'studentId',
'Grade Level': 'GradeLevel',
'AI Code': 'SchoolCode'
}, inplace=True)
subset = subset[subset['studentId'].astype(str) != '']
subset['studentId'] = subset['studentId'].astype(str)
subset['ExamCode'] = subset['ExamCode'].astype(str)
unpivoted_exams.append(subset)
| 'AwardYear': f'Award Year {award_id}' | ||
| } | ||
| available_cols = [col for col in cols.values() if col in df_copy.columns] | ||
| if len(available_cols) == 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here regarding early-return.
| whenAssessedGradeLevelDescriptor: "{%raw-%} {{Grade_Namespace}}#{{Grade_CodeValue}}{%-endraw%}" | ||
| administrationDate: "{%raw-%} {{'05/01/'~ School_Year }}{%-endraw%}" | ||
| descriptorNamespace: ${DESCRIPTOR_NAMESPACE} | ||
| performanceLevel: "{%raw-%} {%- if AwardType != 'nan'-%} {{AwardType}} {%-endif-%} {%-endraw%}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bruk can we edit this to pad with a 0 if the digit length is = 1? We are seeing a few failures because of this
This is the APBundle with performance optimization. Otherwise, the output is identical.
@jayckaiser tagging you as there is a pre-execute step