Skip to content

Commit

Permalink
chore: resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ejcheng committed Dec 5, 2024
1 parent 425c9de commit 13be067
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 67 deletions.
88 changes: 21 additions & 67 deletions src/data/colleges/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { AdvisorGroup } from '../../tools/advisors/types';
import { lastNameRange, lastNameRanges } from '../../tools/advisors/checkers';

const previousEngineeringLiberalArtsGroups: Record<string, string[]> = {
const previousEngineeringLiberalArtsGroups: readonly string[][] = Object.values({
'Group 1': [
'CA-AAP',
'CA-AG',
Expand Down Expand Up @@ -43,9 +43,9 @@ const previousEngineeringLiberalArtsGroups: Record<string, string[]> = {
],
'Group 5': ['FL-AAP', 'FL-AG'],
'Group 6': ['CE-EN'],
};
});

const currentEngineeringLiberalArtsGroups: Record<string, string[]> = {
const currentEngineeringLiberalArtsGroups: readonly string[][] = Object.values({
'Group 1': [
'CA-AAP',
'CA-AG',
Expand Down Expand Up @@ -78,7 +78,7 @@ const currentEngineeringLiberalArtsGroups: Record<string, string[]> = {
'Group 5': ['FL-AAP', 'FL-AG'],
'Group 6': ['CE-EN'],
'Group 7': ['SCD-AS', 'D-AG'],
};
});

const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
{
Expand Down Expand Up @@ -164,7 +164,7 @@ const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
'https://www.engineering.cornell.edu/students/undergraduate-students/advising/liberal-studies',
checker: [
(course: Course): boolean =>
Object.values(currentEngineeringLiberalArtsGroups).some(group =>
currentEngineeringLiberalArtsGroups.some(group =>
group.some(distribution => hasCategory(course, distribution) ?? false)
) || courseIsForeignLang(course),
],
Expand All @@ -174,46 +174,21 @@ const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
additionalRequirements: {
'Courses must be from 3 groups.': {
checker: [
(course: Course): boolean =>
currentEngineeringLiberalArtsGroups['Group 1'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
currentEngineeringLiberalArtsGroups['Group 2'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
currentEngineeringLiberalArtsGroups['Group 3'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
currentEngineeringLiberalArtsGroups['Group 4'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
currentEngineeringLiberalArtsGroups['Group 5'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
currentEngineeringLiberalArtsGroups['Group 6'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
currentEngineeringLiberalArtsGroups['Group 7'].some(
distribution => hasCategory(course, distribution) ?? false
),
...currentEngineeringLiberalArtsGroups.map(group => (course: Course): boolean =>
group.some(distribution => hasCategory(course, distribution) ?? false)
),
],
fulfilledBy: 'courses',
perSlotMinCount: [1, 1, 1, 1, 1, 1],
slotNames: Object.keys(currentEngineeringLiberalArtsGroups),
perSlotMinCount: [1, 1, 1, 1, 1, 1, 1],
slotNames: ['Group 1', 'Group 2', 'Group 3', 'Group 4', 'Group 5', 'Group 6', 'Group 7'],
minNumberOfSlots: 3,
},
'One course of 3 or more credits must come from Group 7.': {
checker: [
(course: Course): boolean =>
currentEngineeringLiberalArtsGroups['Group 7'].some(
distribution => hasCategory(course, distribution) ?? false
),
currentEngineeringLiberalArtsGroups[
currentEngineeringLiberalArtsGroups.length - 1
].some(distribution => hasCategory(course, distribution) ?? false),
],
fulfilledBy: 'courses',
perSlotMinCount: [1],
Expand All @@ -222,7 +197,7 @@ const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
'Courses must have at least 18 credits.': {
checker: [
(course: Course): boolean =>
Object.values(currentEngineeringLiberalArtsGroups).some(group =>
currentEngineeringLiberalArtsGroups.some(group =>
group.some(distribution => hasCategory(course, distribution) ?? false)
) || courseIsForeignLang(course),
],
Expand All @@ -235,7 +210,7 @@ const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
const { catalogNbr } = course;
return (
!ifCodeMatch(catalogNbr, '1***') &&
(Object.values(currentEngineeringLiberalArtsGroups).some(group =>
(currentEngineeringLiberalArtsGroups.some(group =>
group.some(distribution => hasCategory(course, distribution) ?? false)
) ||
courseIsForeignLang(course))
Expand Down Expand Up @@ -360,7 +335,7 @@ export const engMigrations: RequirementMigration[] = [
'https://www.engineering.cornell.edu/students/undergraduate-students/advising/liberal-studies',
checker: [
(course: Course): boolean =>
Object.values(previousEngineeringLiberalArtsGroups).some(group =>
previousEngineeringLiberalArtsGroups.some(group =>
group.some(distribution => hasCategory(course, distribution) ?? false)
) || courseIsForeignLang(course),
],
Expand All @@ -370,30 +345,9 @@ export const engMigrations: RequirementMigration[] = [
additionalRequirements: {
'Courses must be from 3 categories.': {
checker: [
(course: Course): boolean =>
previousEngineeringLiberalArtsGroups['Group 1'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
previousEngineeringLiberalArtsGroups['Group 2'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
previousEngineeringLiberalArtsGroups['Group 3'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
previousEngineeringLiberalArtsGroups['Group 4'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
previousEngineeringLiberalArtsGroups['Group 5'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
previousEngineeringLiberalArtsGroups['Group 6'].some(
distribution => hasCategory(course, distribution) ?? false
),
...previousEngineeringLiberalArtsGroups.map(group => (course: Course): boolean =>
group.some(distribution => hasCategory(course, distribution) ?? false)
),
],
fulfilledBy: 'courses',
perSlotMinCount: [1, 1, 1, 1, 1, 1],
Expand All @@ -403,7 +357,7 @@ export const engMigrations: RequirementMigration[] = [
'Courses must have at least 18 credits.': {
checker: [
(course: Course): boolean =>
Object.values(previousEngineeringLiberalArtsGroups).some(group =>
previousEngineeringLiberalArtsGroups.some(group =>
group.some(distribution => hasCategory(course, distribution) ?? false)
) || courseIsForeignLang(course),
],
Expand All @@ -416,7 +370,7 @@ export const engMigrations: RequirementMigration[] = [
const { catalogNbr } = course;
return (
!ifCodeMatch(catalogNbr, '1***') &&
(Object.values(previousEngineeringLiberalArtsGroups).some(group =>
(previousEngineeringLiberalArtsGroups.some(group =>
group.some(distribution => hasCategory(course, distribution) ?? false)
) ||
courseIsForeignLang(course))
Expand Down
1 change: 1 addition & 0 deletions src/requirements/decorated-requirements.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13be067

Please sign in to comment.