Skip to content
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

feat: migration for new cs major requirements #939

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion src/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import chemERequirements, { chemEAdvisors } from './majors/chemE';
import civilRequirements, { civilAdvisors } from './majors/ce';
import commRequirements, { commAdvisors } from './majors/comm';
import crpRequirements, { crpAdvisors } from './majors/crp';
import csRequirements, { csAdvisors } from './majors/cs';
import csRequirements, { csAdvisors, csMigrations } from './majors/cs';
import deaRequirements, { deaAdvisors } from './majors/dea';
import easRequirements, { easAdvisors } from './majors/eas';
import economicsRequirements, { economicsAdvisors } from './majors/econ';
Expand Down Expand Up @@ -238,6 +238,7 @@ const json: RequirementsJson = {
requirements: csRequirements,
specializations: [MATH2940, CHEM2080],
advisors: csAdvisors,
migrations: csMigrations,
abbrev: 'CS',
},
DEA: {
Expand Down
116 changes: 94 additions & 22 deletions src/data/majors/cs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Course, CollegeOrMajorRequirement } from '../../requirements/types';
import { Course, CollegeOrMajorRequirement, RequirementMigration } from '../../requirements/types';
import {
includesWithSingleRequirement,
includesWithSubRequirements,
Expand All @@ -25,29 +25,32 @@ const csRequirements: readonly CollegeOrMajorRequirement[] = [
},
{
name: 'Computer Science Core',
description: 'CS 2800 or CS 2802, CS 3110, CS 3410 or CS 3420, CS 4410, and CS 4820',
description:
'CS 2800 or CS 2802, CS 3110, CS 3410 or CS 3420, CS 3700 or CS 3780, CS 4410, and CS 4820',
source: 'https://www.cs.cornell.edu/undergrad/csmajor',
checker: includesWithSubRequirements(
['CS 2800', 'CS 2802'],
['CS 3110'],
['CS 3410', 'CS 3420'],
['CS 3700', 'CS 3780'],
['CS 4820'],
['CS 4410', 'CS 4414']
),
fulfilledBy: 'courses',
perSlotMinCount: [1, 1, 1, 1, 1],
perSlotMinCount: [1, 1, 1, 1, 1, 1],
slotNames: [
'CS 2800 or CS 2802',
'CS 3110',
'CS 3410 or CS 3420',
'CS 3700 or CS 3780',
'CS 4820',
'CS 4410 or CS 4414',
],
},
{
name: 'CS Electives',
description:
'Three 4000+ CS electives each at 3 credits. CS 4090, CS 4998, and CS 4999 are NOT allowed.',
'Two 4000+ CS electives each at 3 credits. CS 4090, CS 4998, and CS 4999 are NOT allowed. CS 3700 or CS 3780 allowed if not used in CS core.',
source:
import-brain marked this conversation as resolved.
Show resolved Hide resolved
'http://www.cs.cornell.edu/undergrad/rulesandproceduresengineering/choosingyourelectives',
checker: [
Expand All @@ -56,6 +59,8 @@ const csRequirements: readonly CollegeOrMajorRequirement[] = [
courseMatchesCodeOptions(course, ['CS 4090', 'CS 4998', 'CS 4999', 'CS 4410', 'CS 4820'])
) {
return false;
} else if (courseMatchesCodeOptions(course, ['CS 3700', 'CS 3780'])) {
return true;
}
return (
import-brain marked this conversation as resolved.
Show resolved Hide resolved
ifCodeMatch(course.subject, 'CS') &&
Expand All @@ -67,8 +72,9 @@ const csRequirements: readonly CollegeOrMajorRequirement[] = [
);
},
],
checkerWarning: 'We do not check whether you are allowed to take CS 3700/3780 towards this requirement.',
fulfilledBy: 'courses',
perSlotMinCount: [3],
perSlotMinCount: [2],
slotNames: ['Course'],
},
{
Expand Down Expand Up @@ -150,23 +156,6 @@ const csRequirements: readonly CollegeOrMajorRequirement[] = [
fulfilledBy: 'credits',
perSlotMinCount: [3],
},
{
name: 'Probability',
description: 'Must take BTRY 3080, CS 4850, ECE 3100, ECON 3130, ENGRD 2700, or MATH 4710.',
source: 'https://www.cs.cornell.edu/undergrad/csmajor',
allowCourseDoubleCounting: true,
checker: includesWithSubRequirements([
'BTRY 3080',
'CS 4850',
'ECE 3100',
'ECON 3130',
'ENGRD 2700',
'MATH 4710',
]),
fulfilledBy: 'courses',
perSlotMinCount: [1],
slotNames: ['Course'],
},
];

export default csRequirements;
Expand All @@ -186,3 +175,86 @@ export const csAdvisors: AdvisorGroup = {
],
source: 'https://www.cs.cornell.edu/undergrad/ustaff/contact-academic-advisor',
};

export const csMigrations: RequirementMigration[] = [
{
entryYear: 2023, // CS students entering Fall 2024 or later have new core requirements (listed above)
type: 'Modify',
fieldName: 'Computer Science Core',
newValue: {
name: 'Computer Science Core',
description: 'CS 2800 or CS 2802, CS 3110, CS 3410 or CS 3420, CS 4410, and CS 4820',
source: 'https://www.cs.cornell.edu/undergrad/csmajor',
checker: includesWithSubRequirements(
['CS 2800', 'CS 2802'],
['CS 3110'],
['CS 3410', 'CS 3420'],
['CS 4820'],
['CS 4410', 'CS 4414']
),
fulfilledBy: 'courses',
perSlotMinCount: [1, 1, 1, 1, 1],
slotNames: [
'CS 2800 or CS 2802',
'CS 3110',
'CS 3410 or CS 3420',
'CS 4820',
'CS 4410 or CS 4414',
],
},
},
{
entryYear: 2023, // CS students entering Fall 2024 or later have new CS elective requirements (listed above)
type: 'Modify',
fieldName: 'CS Electives',
newValue: {
name: 'CS Electives',
description:
'Three 4000+ CS electives each at 3 credits. CS 4090, CS 4998, and CS 4999 are NOT allowed.',
source:
'http://www.cs.cornell.edu/undergrad/rulesandproceduresengineering/choosingyourelectives',
checker: [
(course: Course): boolean => {
if (
courseMatchesCodeOptions(course, ['CS 4090', 'CS 4998', 'CS 4999', 'CS 4410', 'CS 4820'])
) {
return false;
}
return (
ifCodeMatch(course.subject, 'CS') &&
!(
ifCodeMatch(course.catalogNbr, '1***') ||
ifCodeMatch(course.catalogNbr, '2***') ||
ifCodeMatch(course.catalogNbr, '3***')
)
);
},
],
fulfilledBy: 'courses',
perSlotMinCount: [3],
slotNames: ['Course'],
},
},
{
entryYear: 2023, // CS students entering Fall 2024 or later no longer have a Probability requirement
type: 'Add',
fieldName: 'Probability',
import-brain marked this conversation as resolved.
Show resolved Hide resolved
newValue: {
name: 'Probability',
description: 'Must take BTRY 3080, CS 4850, ECE 3100, ECON 3130, ENGRD 2700, or MATH 4710.',
source: 'https://www.cs.cornell.edu/undergrad/csmajor',
allowCourseDoubleCounting: true,
checker: includesWithSubRequirements([
'BTRY 3080',
'CS 4850',
'ECE 3100',
'ECON 3130',
'ENGRD 2700',
'MATH 4710',
]),
fulfilledBy: 'courses',
perSlotMinCount: [1],
slotNames: ['Course'],
},
},
];
Loading
Loading