yacs icon indicating copy to clipboard operation
yacs copied to clipboard

Standardize period types

Open Bad-Science opened this issue 6 years ago • 5 comments

We currently do not have a standard for period types. This could be a problem down the road, as it could prevent us from using that information meaningfully and consistently. So, we should add this to the API / schema doc. We should also add some validation to the periods jsonb column.

At RPI, the possible types are test, lecture, lab and recitation. These are listed as TES, LEC, LAB, and REC, though, so we should update adapter-banner-rpi to transform those appropriately.

@A1Liu , do you know what all of the possible class types are at NYU?

cc @bmcutler

Related: #354

Bad-Science avatar Nov 03 '18 05:11 Bad-Science

NYU has lecture, lab, seminar, and recitation as far as I can tell. Depending on the source they're formatted differently - the course catalog has them capitalized, and Gallatin doesn't have them at all.

A1Liu avatar Nov 05 '18 03:11 A1Liu

Ok cool, thanks. So we can start off our official list of types as lecture, lab, test, recitation, and seminar. If needed we can add to this at any point. Can you have your adapters transform them all to lower case to be consistent?

Bad-Science avatar Nov 05 '18 04:11 Bad-Science

ok sounds good, will do.

A1Liu avatar Nov 05 '18 04:11 A1Liu

Do you think it would be better to store them in the database with code numbers and have them be translated afterwards, or just store them as strings?

A1Liu avatar Nov 05 '18 04:11 A1Liu

Good question... right now periods are stored as a binary json column anyway so it would be a little tedious and not have much benefit, but if we ever normalize periods into its own table it would make sense to use an enum like you suggest. I don't plan on normalizing periods though unless a very good reason comes up. I think for now we can probably just add some validation to ensure only permitted values are saved.

Bad-Science avatar Nov 05 '18 23:11 Bad-Science