cobalt-uoft / uoft-scrapers

Public web scraping scripts for the University of Toronto.
https://pypi.python.org/pypi/uoftscrapers
MIT License
48 stars 14 forks source link

View breadth requirements for UTSC courses #86

Closed chintans1 closed 7 years ago

chintans1 commented 7 years ago

This change will allow for courses that are at UTSC to have breadth requirements. Previously the scraper would only fetch breadths for UTSG courses. I have changed that now so we can populate breadths for UTSC courses as well. It still holds the model validations so "breadths" is still a list of numbers.

For UTSC, the numbers correspond the breadth in this fashion: 1 => Arts, Literature & Language 2 => "History, Philosophy & Cultural Studies" 3 => "Natural Sciences" 4 => "Social & Behavioural Sciences" 5 => "Quantitative Reasoning"

UTSC courses don't have more than one breadth so I feel this change should work for all courses at UTSC. I have tested it and confirmed the outputted data to be correct.

g3wanghc commented 7 years ago

@chintans1 I think UTM also has a Distribution Requirements, it might be worthwhile to just handle all cases in tri-campus

chintans1 commented 7 years ago

Yea, but I feel that is would be wrong to have UTM Distribution Requirement under breadths. The list of numbers would not directly correlate to the distribution. For UTSC, the breadths are basically the same with the just the wording different but UTM sort of has a different system altogether.

g3wanghc commented 7 years ago

@chintans1 maybe you can handle this by using different fields to avoid any ambiguity

chintans1 commented 7 years ago

@g3wanghc I suppose, but also, the UTM Distribution field does not appear for all courses at UTM and I don't see another field to use for this unless I add one myself which would I think require work in the scraper and the API itself.

arkon commented 7 years ago

Yes, that's beyond the scope of this PR.

chintans1 commented 7 years ago

@arkon I've made some changes to clean it up. I think it is better now with the usage of a dictionary

kashav commented 7 years ago

~Any chance that a course will have more than one breadth category?~

Edit: Oops, just read the PR description 😅, LGTM.

chintans1 commented 7 years ago

@kshvmdn I have yet to see any UTSC course cover more than one breadth which made me do it this way.

kashav commented 7 years ago

@chintans1 I think I can confirm that -- all of the following appear to be empty.

chintans1 commented 7 years ago

That's great. Hopefully this can be merged then! :)

chintans1 commented 7 years ago

@arkon I think that is better. I made it so we don't declare any variables that we won't use. We find the breadths now for only UTSG and UTSC courses so UTM is always empty.

qasim commented 7 years ago

LGTM.

Thanks for the contribution @chintans1 :) always appreciate help to improve UTSC/UTM data.