rosshamish / classtime

university schedule generation and course data API
MIT License
16 stars 2 forks source link

Expose schedule preferences in the API #67

Closed rosshamish closed 9 years ago

rosshamish commented 9 years ago

First round of preference support will include

rosshamish commented 9 years ago

Example usage

(from tests/angular_flask/test_api.py):

"q": {  # 1st year engineering Fall Term 2014
        # preferences => start late, marathon class blocks
        "institution": "ualberta",
        "term": "1490",
        "courses": ["001343", # Chem 103
                    "004093",
                    "004096",
                    "006768",
                    "009019"],
        "electives": [
            {
                "courses": ["000268", # Anthr 101
                            "000269", # Anthr 110
                            "000270", # Anthr 150
                            ]
            }
        ],
        "preferences": {
            "start-early": -10,
            "no-marathons": -10
        }
}

Example output:

With preferences (start late and long marathons):

   0 1 2 3 4 5 6 7 8 9 A B C 1 2 3 4 5 6 7 8 9 A B 
M:                 IIIIII    DDKKFF                
T:                       GGGGGGHHHBBB              
W:                           DDKKFF                
R:                 CCCC    EEAAHHHBBB              
F:                           DDKKFFJJ              

Without preferences (defaults are start early, no marathons):

   0 1 2 3 4 5 6 7 8 9 A B C 1 2 3 4 5 6 7 8 9 A B 
M:                 KKFF  DD  EEIIIIII              
T:                 BBBHHH        CCCC              
W:                 KKFF  DD    GGGGGG              
R:                 BBBHHH    AA                    
F:                 KKFF  DD    JJ