Skip to content

Commit

Permalink
schools None
Browse files Browse the repository at this point in the history
  • Loading branch information
guinslym committed Dec 10, 2019
1 parent 2d94ca3 commit 4457d14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions ask_schools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.2.6'
__version__ = '0.2.7'

school_name = {
'Toronto':{'suffix':'_tor', 'short':'Toronto', 'full':'University of Toronto'},
Expand All @@ -23,7 +23,7 @@
'Ottawa':{'suffix':'_ott', 'short':'Ottawa', 'full':'Ottawa University'}
}

def find_school_by_operator_suffix(operator: str) -> str:
def find_school_by_operator_suffix(operator):
"""from a suffix find the short name of that School
Arguments:
Expand All @@ -32,6 +32,10 @@ def find_school_by_operator_suffix(operator: str) -> str:
Returns:
str -- The short name of the school i.e. Toronto
"""
if operator is None:
return operator


if "_tor" in operator:
return "Toronto"
elif "_int" in operator:
Expand Down Expand Up @@ -80,6 +84,9 @@ def find_school_by_operator_suffix(operator: str) -> str:


def find_school_by_queue_or_profile_name(queue):
if queue is None:
return queue

if queue in ["toronto-st-george", 'toronto-st-george-proactive', 'toronto-scarborough', 'toronto-mississauga']:
return "University of Toronto"
elif queue in ["york", 'york-glendon-fr', 'york-glendon']:
Expand Down Expand Up @@ -122,6 +129,9 @@ def find_school_by_queue_or_profile_name(queue):
return "Unknown"

def find_school_abbr_by_queue_or_profile_name(queue):
if queue is None:
return queue

if queue in ["toronto-st-george", 'toronto-st-george-proactive', 'toronto-scarborough', 'toronto-mississauga']:
return "UofT"
elif queue in ["york", 'york-glendon-fr', 'york-glendon']:
Expand Down Expand Up @@ -169,6 +179,8 @@ def find_school_abbr_by_queue_or_profile_name(queue):
"Queens University"]

def find_routing_model_by_profile_name(university_name):
if university_name is None:
return university_name
if university_name in HTF_schools:
return "HTF"
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ask_schools"
version = "0.2.6"
version = "0.2.7"
description = "Ask Scholars Portal Name Conversion"
authors = ["Guinsly Mondesir <[email protected]>"]
keywords = ["Ask", "Scholars Portal", "Ontario"]
Expand Down

0 comments on commit 4457d14

Please sign in to comment.