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

Add support for EECS renumbering #31

Merged
merged 10 commits into from
Apr 30, 2022
Merged

Conversation

psvenk
Copy link
Member

@psvenk psvenk commented Apr 18, 2022

Fixes #30. I can confirm that these changes generate the "Subject Old Id" and "Subject New Id" columns properly in the output of the catalog parser, but I could not test the API endpoint because I had trouble getting the database set up properly. (The deltas were not being generated correctly; I could look into this further if necessary.)

psvenk added 3 commits April 17, 2022 13:12
To support the fall 2022 EECS subject renumbering, expand the course
attributes to store old and new IDs for subjects affected by the
renumbering.
Use the EECS renumbering data to populate the "Old Subject Id" and
"New Subject Id" columns.
Copy link
Collaborator

@venkatesh-sivaraman venkatesh-sivaraman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Pratyush, thanks for taking care of this! Overall it looks great, I just left two minor comments/questions about the field naming.

Have you spoken to @georgiashay about this yet? It would be good to deploy this branch on fireroad-dev for a bit and use it to test CourseRoad before merging and deploying on prod. Let me know if you need any help doing that!

@psvenk
Copy link
Member Author

psvenk commented Apr 18, 2022

Hi, Venkatesh, thank you for reviewing this so quickly.

I have not yet spoken to @georgiashay about this; should I reach out to her separately? Sorry, I'm not very familiar with how FireRoad deployment works.

Once this is on fireroad-dev (or I get the local setup figured out and I can npm run devdev for CourseRoad), I can work on adding support to CourseRoad, which should help in testing this.

psvenk added 2 commits April 18, 2022 11:52
For renumbered subjects in Course 6, store the new ID in subject_id
directly instead of having a separate new_id column.
I forgot a step in 9056421, causing old_id not to be reflected in the
JSON output.
@psvenk psvenk requested a review from georgiashay April 18, 2022 15:56
@psvenk
Copy link
Member Author

psvenk commented Apr 23, 2022

@georgiashay Is this ready to be deployed on fireroad-dev? If not, I would be happy to make changes to bring it to that state.

@georgiashay
Copy link
Collaborator

Sorry about the wait. I've been busy this week but I should have time to properly review this soon.

@georgiashay
Copy link
Collaborator

It looks like the course catalog hasn't transitioned to the new numbers yet so it is hard to test whether everything still works (including the scraper) until that happens

@georgiashay
Copy link
Collaborator

(The new listings should be up hopefully by the end of the month)

@psvenk
Copy link
Member Author

psvenk commented Apr 23, 2022

Yes, I noticed that the catalog was updated today (?) with the new categories but not the new numbers. I guess we can just wait until the new listings are up and test it then.

Now that the fall 2022 catalog has been released with a regular format
for displaying old subject IDs, extract the old subject ID from the
catalog instead of cross-referencing the EECS website.
@psvenk psvenk force-pushed the eecs-renumbering branch from f625eec to dda63d7 Compare April 25, 2022 23:11
@psvenk
Copy link
Member Author

psvenk commented Apr 25, 2022

Now that the fall 2022 catalog has been released, it turns out that the old subject IDs are displayed there in a regular format, so I was able to greatly simplify the code by just parsing the catalog to extract the old ID rather than cross-referencing the EECS website.

Should this be ready for testing now, or is further work needed?

@georgiashay
Copy link
Collaborator

Catalog looks good to me. We should consider whether the backend (i.e. fireroad server) should translate roads from old to new ids, or whether the frontend (i.e. fireroad apps, courseroad) should be responsible for that.

@venkatesh-sivaraman
Copy link
Collaborator

IMO, the best option is we don't touch the roads in the backend, and keep the road format such that both old and new road formats will be readable, but only the new road format will be written. If we have the ability to retrieve course data for display by either the old or new subject IDs, this should be straightforward. Does that sound good?

Also, @georgiashay let me know when fireroad-dev is running this branch, or if you have any issues with the database migration etc. I will try to update the apps for compatibility as soon as I can.

@georgiashay
Copy link
Collaborator

I've deployed this branch to fireroad-dev and updated the catalog. I will start working on getting courseroad compatible with the changes. I suspect the roads will display fine as-is (the old courses are still there as "historical courses"), but that they wouldn't show as satisfying requirements that use the new ids. Not sure if we should make the old subjects satisfy the requirements, or just force roads to be migrated to the new numbering when a user opens them.

@georgiashay
Copy link
Collaborator

I think we might want to get rid of the historical courses that are just renamed courses. @psvenk, can you look into changing this? I think it would probably involve a change to the build_consensus function.

@psvenk
Copy link
Member Author

psvenk commented Apr 28, 2022

I can work on getting rid of the historical courses in the next few days. On a somewhat related note, do you know how new courses can be made to satisfy old requirements? Or should this just be done by updating requirements (in the requirements editor, I assume) to use new IDs?

@georgiashay
Copy link
Collaborator

We'll update the requirements to use the new IDs. Miriam (who works on Courseroad with me) has written a script to do this, and we'll deploy the new requirements once everything else is ready.

When a course has been renumbered, remove the version under the old
number so that there is only one number for the course stored in the
database.
@psvenk
Copy link
Member Author

psvenk commented Apr 30, 2022

I can confirm that the historical courses are removed in 7ddd0c9. (I managed to get the database and server working.)

@georgiashay
Copy link
Collaborator

Thanks for the update! This is thinking ahead, but old id's actually can be reused after 5 years. So we don't want to remove all subjects that are old id's, because some of them can come back. We only want to remove classes that are old id's in a future semester, not a past semester.

@georgiashay
Copy link
Collaborator

(For reference, course 6 is planning on reusing 3-digit course numbers after that 5 year period)

Only remove classes whose IDs are marked as old IDs in a future
semester, not in a past semester, given that old IDs can be reused after
5 years.
@psvenk
Copy link
Member Author

psvenk commented Apr 30, 2022

Good point; this should now be fixed in c40933c. (I did some informal testing and there don't seem to be any regressions.) I just made sure that the old ID is from a future semester as you suggested. This does leave open some weird edge cases over 10-year periods if courses are renumbered in specific ways, but I think it's unlikely that this will be realized in practice (and anyway, being overzealous in deleting historical subjects from 10 years ago is not the end of the world).

Do you think this (and sipb/courseroad2#476) is ready to merge?

@georgiashay
Copy link
Collaborator

I am running into a weird issue where this throws errors on the dev server (but not locally). Still investigating this, I'll let you know when I figure out what's going on.

@georgiashay
Copy link
Collaborator

I figured it out - previous semesters do not have the old id attribute, so the build_consensus will throw an error in these cases.

Here is one way to fix this:

old_ids = set().union(*(data.loc[:, CourseAttribute.oldID].dropna()
                                if CourseAttribute.oldID in data.columns else []
                                for semester, data in semester_data[:i]))

Can you add this fix in?

When checking if something is an old ID in build_consensus, handle the
case that the oldID column does not exist because some of the future
semesters (relative to the semester being viewed) are before fall 2022.
@georgiashay georgiashay merged commit e5a1db6 into sipb:master Apr 30, 2022
@georgiashay
Copy link
Collaborator

Thanks for all the great work! This is deployed on fireroad-dev, and I'll merge into master. I'll let @venkatesh-sivaraman update the mobile apps before we deploy on prod.

@psvenk psvenk deleted the eecs-renumbering branch April 30, 2022 23:13
@psvenk
Copy link
Member Author

psvenk commented Apr 30, 2022

Thank you for merging and for all of your feedback! I would like to help transition the requirements to the new numbers. Should this be done in the Requirements Editor on prod or dev? Should I wait until it's on prod before submitting a request?

@georgiashay
Copy link
Collaborator

Miriam has already transitioned the requirements on prod, but we are waiting to deploy these changes until all the clients (web/mobile apps) are updated. I've just released these transitioned requirements on dev so that the clients have access to them for testing.

@psvenk
Copy link
Member Author

psvenk commented May 1, 2022

I noticed that the transition only applies to the old majors — "6-1 Major", "6-2 Major", and "6-3 Major" — and not the new majors — "6-2 Major (New)", "6-3 Major (New)", and "6-4 Major". Do these still need to be transitioned to the new numbers?

@georgiashay
Copy link
Collaborator

Those still need to be transitioned, I think I might have added these after Miriam ran her script.

@venkatesh-sivaraman
Copy link
Collaborator

Thanks so much for putting together and merging these changes. I've put together updates for the iOS and Android apps - the iOS version should be approved by the App Store within 24-48 hours. Let me know the target date/time for deploying on prod, and I will release the apps around the same time!

@georgiashay
Copy link
Collaborator

I am ready to deploy whenever you are, do you want to wait until the app is approved and then deploy right away?

@venkatesh-sivaraman
Copy link
Collaborator

Great, you can go ahead and deploy then! The apps just got approved so I will go ahead and release them now.

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.

Add support for fall 2022 EECS subject renumbering
3 participants