Skip to content

Conversation

@Bruk
Copy link
Contributor

@Bruk Bruk commented May 7, 2025

This is the APBundle with performance optimization. Otherwise, the output is identical.

@jayckaiser tagging you as there is a pre-execute step

sasalter and others added 28 commits January 21, 2025 12:23
…riptors from template and destination in earthmover.
* APBundle:
  Fixed Academic subject seed
* APBundle:
  Fixed if statement on score result to show irregularity code if available.
@Bruk
Copy link
Contributor Author

Bruk commented May 7, 2025

@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%}"
Copy link
Collaborator

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

Copy link
Collaborator

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]
Copy link
Contributor

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:
Copy link
Contributor

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%}"
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants